diff --git a/include/cfiles.c b/include/cfiles.c index b5e3516ba..a1f0be13c 100755 --- a/include/cfiles.c +++ b/include/cfiles.c @@ -20,11 +20,9 @@ int hashfun(const char *); void setdec(char *, int); const char* prefname(); -HIDDEN BOOLEAN pathpread = 0; - BOOLEAN dispferr = 1; int dirfl[2] = {0, 0}, recfl[2] = {0, 0} ; -PathSt __ptprf = ""; +PathSt __ptprf = ""; // Nome della directory con lo studio corrente /* @(#) COpenDir FILES @@ -379,8 +377,6 @@ void CPutRec(logicname,recd,dirflg) @(FSV) */ -#ifndef FOXPRO - HIDDEN const char* prefname() { static char* s = NULL; @@ -389,11 +385,11 @@ HIDDEN const char* prefname() { #ifdef DOS char *s1 = getenv("PREFPATH"); - if (s1 == NULL) s1 = "prefix.txt"; + if (s1 == NULL) s1 = "campo.ini"; s = strdup(s1); #else s = malloc(32); - sprintf(s, "prefix.%-d", getuid()); + sprintf(s, "campo%u.ini", getuid()); #endif } @@ -411,7 +407,7 @@ const char* CGetPrawinName(void) char path[_MAX_PATH]; char tmp[_MAX_PATH]; _splitpath(prefname(), drive, path, NULL, NULL); - _makepath(tmp, drive, path, "prawin", ".ini"); + _makepath(tmp, drive, path, "campo", ".ini"); if (access(tmp, 0) != 0) // se non esiste ... { FILE* pw = fopen(tmp, "w"); // ... lo creo @@ -459,29 +455,12 @@ BOOLEAN CPutPrawin(const char* pref) { const char* prawin = CGetPrawinName(); BOOLEAN good = WritePrivateProfileString("Main", "Firm", pref, prawin); - int disk = toupper(*prawin) - 'A'; WritePrivateProfileString("Main", "Study", __ptprf, prawin); - -#if XVT_OS == XVT_OS_WIN32 - if (GetDriveType("") == DRIVE_FIXED) -#else - if (GetDriveType(_getdrive() -1 ) == DRIVE_FIXED) -#endif - { - // Aggiorna anche il vecchio pathpref.ini, ma solo sui dischi locali: - // nei dischi remoti lo studio va cambiato modificando direttamente il file - FILE* pppi; // PathPrefPuntoIni - pppi = fopen("pathpref.ini", "w"); - fprintf(pppi, "%s\n", __ptprf); - fclose(pppi); - } return good; } #endif -#endif - /* @(#) CGetPref FILES @@ -502,67 +481,11 @@ BOOLEAN CPutPrawin(const char* pref) const char* CGetPref() { -#ifdef DOS if (!CGetPrawin()) -#endif { - const char* p = prefname(); - FILE *f = fopen(p, "r"); - - if (f == NULL) - { - strcpy(cprefix, ""); - } - else - { - if (fgets(cprefix, 42, f) != NULL) - { - int len; - for (len = LENGTH(cprefix)-1; len >= 0 && cprefix[len] <= ' '; len--) - cprefix[len] = '\0'; - } - else - *cprefix = '\0'; - fclose(f); - } - - if (!pathpread) - { - FILE* f = fopen("pathpref.ini", "r"); - pathpread = 1; - if (f != NULL) - { - if (fgets(__ptprf, 42, f) != NULL) - { - const int len = LENGTH(__ptprf)-1; - if (len >= 0 && __ptprf[len] <= ' ') - { - __ptprf[len] = '\0'; - if (len > 0 && __ptprf[len-1] != '\\' && __ptprf[len-1] != '/') - { -#ifdef DOS - strcat(__ptprf, "\\"); -#else - strcat(__ptprf, "/"); -#endif - } - } - } - else - *__ptprf = '\0'; - fclose(f); - } - } + strcpy(cprefix, "COM"); CPutPrawin(cprefix); - if (*__ptprf) - { - char* copy_of_prefix = strdup(cprefix); - strcpy(cprefix, __ptprf); - strcat(cprefix, copy_of_prefix); - free(copy_of_prefix); - } } - return cprefix; } @@ -587,22 +510,7 @@ const char* CGetPref() void CPutPref(const char* pref) /* stringa contenente il nuovo prefisso */ { -#ifdef DOS CPutPrawin(pref); -#endif - { - FILE *f; - const int l = strlen(__ptprf); - if (l && strncmp(pref, __ptprf, l) == 0) pref += l; - f = fopen(prefname(), "w"); - if (f != NULL) - { - fprintf(f, "%s\n", pref); - fclose(f); - } - else - message_box("Impossibile scrivere %s", prefname()); - } } /* @@ -686,7 +594,6 @@ char *CInsPref(name,dirflg) if (*cprefix == '\0') strcpy(s, name); else -// sprintf(s,"%s%c%s",cprefix, DIRSEP, name); _makepath(s, NULL, cprefix, name, NULL); } else @@ -694,41 +601,3 @@ char *CInsPref(name,dirflg) return s; } -/* - @(#) CGetIdxName FILES - - @(ID) - Dato un nome file costruisce il nome del file indice corrispondente. - @(FD) - - @(ISV) - fdst,s1,s2 = stringhe di lavoro. - @(FSV) - - @(IN) - NON UTILIZZARE !!. - - Se si utilizza spiegarne dettagliatamente il motivo. - - L' estensione dei file indice e' ndx; e' quindi vietato utilizzare un nome - di file che abbia tale estensione. L' estensione dei file dati e' dta. - @(FN) - */ - -char *CGetIdxName(s) - char *s; /* stringa contenente il nome file */ - -{ - static char* fdst = NULL; - char *s1, *s2; - - if (fdst == NULL) - fdst = malloc(_MAX_PATH); - strcpy(fdst, s) ; - s1 = strrchr(fdst,DIRSEP) ; - if (s1 == NULL) s1 = fdst; - s2 = strchr(s1,'.') ; - if (s2 != NULL) s2[0] = '\0' ; - s1 = strcat(fdst, ".ndx") ; - return(fdst) ; -} diff --git a/include/cfiles.h b/include/cfiles.h index 5cbe321f5..d81fccfbd 100755 --- a/include/cfiles.h +++ b/include/cfiles.h @@ -105,8 +105,6 @@ extern "C" { char *CAddPref(char *); /* @(!) 2.3.01.144 */ char *CInsPref(char *, int); - /* @(:) 2.3.01.144 */ - char *CGetIdxName(char *); const char* CGetPrawinName(void); diff --git a/include/config.cpp b/include/config.cpp index 6b29d0989..a19bfed17 100755 --- a/include/config.cpp +++ b/include/config.cpp @@ -698,9 +698,9 @@ TConfig::TConfig(int which_config, const char* paragraph) { case CONFIG_DITTA: _file = firm2dir(prefix().get_codditta()); - _file.add("prassid.ini"); - if (!fexist(_file) && fexist("prassid.ini")) - fcopy("prassid.ini", _file); + _file.add("ditta.ini"); + if (!fexist(_file) && fexist("ditta.ini")) + fcopy("ditta.ini", _file); break; case CONFIG_STUDIO: case CONFIG_USER: @@ -713,9 +713,9 @@ TConfig::TConfig(int which_config, const char* paragraph) switch (which_config) { case CONFIG_STUDIO: - _file.add("prassis.ini"); - if (!_file.exist() && fexist("prassis.ini")) - fcopy("prassis.ini", _file); + _file.add("studio.ini"); + if (!_file.exist() && fexist("studio.ini")) + fcopy("studio.ini", _file); break; case CONFIG_STAMPE: _file.add("print.ini"); @@ -729,10 +729,10 @@ TConfig::TConfig(int which_config, const char* paragraph) u.upper(); _file.add(u); _file.ext("ini"); - if (u != "PRASSI" && !_file.exist()) + if (u != "ADMIN" && !_file.exist()) { TFilename prassi = _file.path(); - prassi.add("prassi.ini"); + prassi.add("admin.ini"); fcopy(prassi, _file); } } diff --git a/include/csort.c b/include/csort.c index e9d827ecd..bd148bc25 100755 --- a/include/csort.c +++ b/include/csort.c @@ -379,10 +379,14 @@ static void dumpbuff() static FILE *wopen(char* name) /* nome del file temporaneo */ { FILE *fp; + +/* char s[42]; static int n = 0; sprintf(s, "srt%02d", ++n); TMPFNAME(name,s); +*/ + tmpnam(name); fp = fopen(name, "wb+"); if (fp == NULL) diff --git a/include/extcdecl.h b/include/extcdecl.h index 0c59bd652..1903cd557 100755 --- a/include/extcdecl.h +++ b/include/extcdecl.h @@ -72,7 +72,6 @@ extern "C" { const char* CGetPref(void); void CPutPref(const char *); char *CInsPref(char *, int); - char *CGetIdxName(char *); int init_sort(struct s_prm *); void sort(char *); char *sort_op(void); diff --git a/include/fastapi.h b/include/fastapi.h new file mode 100755 index 000000000..177698e41 --- /dev/null +++ b/include/fastapi.h @@ -0,0 +1,644 @@ +/****************************************************************************/ +/** **/ +/** Hardlock **/ +/** API-Structures and definitions **/ +/** **/ +/** This file contains some helpful defines to access a Hardlock using **/ +/** the application programming interface (API) for Hardlock. **/ +/** **/ +/** Aladdin Germany **/ +/** **/ +/** Revision history **/ +/** ---------------- +*** $Log: not supported by cvs2svn $ +*** Revision 1.1.2.1 2002/05/30 13:42:20 guy +*** Patch level : 2.0 nopatch +*** Files correlati : fastapi.h +*** Ricompilazione Demo : [ ] +*** Commento : +*** Sarà d'uopo includere anch'esso, va là! +*** +*** Revision 1.46 2000/12/19 16:37:41 chris +*** detect MacOS X +*** +*** Revision 1.45 2000/07/30 22:22:17 chris +*** ia64 detection +*** +*** Revision 1.44 2000/07/10 09:45:09 chris +*** Module2 field +*** +*** Revision 1.43 2000/05/25 14:11:43 chris +*** added some HASP stuff +*** +*** Revision 1.42 2000/03/21 14:18:28 chris +*** HL_SIS and HL_LIS structure definitions +*** +*** Revision 1.41 2000/02/18 14:04:44 chris +*** fixed pascal define for CygWin & MingW32 +*** +*** Revision 1.40 1999/12/06 13:06:11 chris +*** fixed structure packing for MSC compiler +*** +*** Revision 1.39 1999/11/28 01:39:46 chris +*** added 64bit support (only tested with AlphaLinux currently) +*** +*** Revision 1.38 1999/10/07 11:28:45 chris +*** Duplicate revision +*** +*** Revision 1.37 1999/10/07 11:28:45 Henri +*** Removed uneeded TLV defines. +*** +*** Revision 1.36 1999/10/07 10:47:04 Henri +*** Removed unused flags. +*** +*** Revision 1.35 1999/09/30 09:27:46 Henri +*** Added PORT_BUSY. +*** +*** Revision 1.34 1999/09/24 07:49:43 Werner +*** Added RUS_RTB_EXPIRED and RUS_SERIAL_MISMATCH +*** error codes. +*** +*** Revision 1.33 1999/09/21 12:06:57 Henri +*** Arranged error codes. +*** +*** Revision 1.32 1999/09/20 12:56:28 Werner +*** Added FORCE_ALF_CREATE constant. +*** +*** Revision 1.31 1999/09/15 17:04:18 Henri +*** Changed WriteLicense. +*** +*** Revision 1.30 1999/09/01 15:06:44 Adi +*** Added special handling of global expiration date. +*** +*** Revision 1.29 1999/08/16 13:03:58 chris +*** restore previous structure packing after HL_API definition +*** (for MSVC) +*** +*** Revision 1.28 1999/08/08 23:10:55 chris +*** added 2 bytes to reserved field: API structure was 2 bytes too short +*** +*** Revision 1.27 1999/08/04 13:04:41 chris +*** API_FFS_GETRUSINFO define +*** +*** Revision 1.26 1999/08/04 11:03:33 chris +*** API_FFS_WRITE_LIC definition and some more status codes +*** +*** Revision 1.25 1999/08/03 20:36:15 chris +*** renamed FIB structure to RUS_FIB to avoid clash +*** with api_defs.h +*** +*** Revision 1.24 1999/07/26 10:58:28 Henri +*** Added FIB structure. +*** +*** Revision 1.23 1999/07/19 10:29:35 Henri +*** Renamed define for BUFFER_TOO_SMALL +*** +*** Revision 1.22 1999/07/19 10:11:30 Henri +*** Added RUS functionality. +*** +*** Revision 1.21 1998/10/21 15:56:53 Henri +*** Changed defines for Borland Builder. +*** +*** Revision 1.20 1998/08/14 11:33:54 Henri +*** Changed driver comment. +*** +*** Revision 1.19 1998/07/10 12:34:05 Henri +*** Added define for Borland Builder. +*** +*** Revision 1.18 1998/06/29 09:01:36 Henri +*** Extended API struc. +*** +*** Revision 1.17 1998/06/08 16:36:31 chris +*** fixed structure packing on gcc version 2.7 and above +*** +*** Revision 1.16 1998/05/08 14:11:33 Henri +*** Added defines for HL_READID. +*** +*** Revision 1.15 1998/04/07 13:14:59 chris +*** added API_READ_ID function code +*** +*** Revision 1.14 1998/02/17 21:56:19 Henri +*** Added pragma pack(1) for Watcom 11/DOS +*** +*** Revision 1.13 1997/07/01 13:56:54 henri +*** Fixed defines for LabView. +*** +*** Revision 1.12 1997/04/28 15:30:53 chris +*** define UNIX32 ifdef __QNX__ +*** +*** Revision 1.11 1997/02/03 18:08:36 henri +*** Renamed error 17 +*** +*** Revision 1.10 1997/01/30 17:16:55 henri +*** Added LM return codes. +*** +*** Revision 1.9 1997/01/28 08:23:30 henri +*** Missed a semicolon ;-) +*** +*** Revision 1.8 1997/01/27 17:57:11 henri +*** Added slot number in API structure. +*** +*** Revision 1.7 1997/01/16 18:18:11 henri +*** Added API_LMINIT function code. +*** +*** Revision 1.6 1996/11/13 16:55:49 chris +*** added SOLARIS & UNIX32 define +*** +*** Revision 1.5 1996/08/12 16:23:43 henri +*** Added VCS log. +*** +**/ +/****************************************************************************/ + +#if !defined(_FASTAPI_H_) +#define _FASTAPI_H_ + +#if defined(LINUX) || defined(SOLARIS) || defined(SCO) || defined(__QNX__) || defined(DARWIN) || defined(MACOSX) + #define UNIX32 + #if defined(__alpha__) || defined(__ia64__) + #ifndef __64BIT__ + #define __64BIT__ + #endif + #define NO_UNALIGN + #endif +#endif + +#ifdef __OS2__ + #ifdef INTERNAL_16BITDLL + #define LOAD_DS + #else + #ifdef __WATCOMC__ + #ifdef __386__ /* not the 16bit compiler */ + #include + #endif + #else + #include + #endif + #endif + #ifdef OS_16 + #define RET_ Word + #define FAR_ far pascal + #define DATAFAR_ far + #else + #define RET_ APIRET + #define FAR_ + #define CALL_ APIENTRY + #define DATAFAR_ + #endif + #pragma pack(2) +#endif + +#ifdef UNIX32 + #define __386__ + #define pascal + #pragma pack(1) +#endif + +#ifdef __GNUC__ + #define __386__ + #if !defined(__CYGWIN__) && !defined(__MINGW32__) + #define pascal + #endif + #if ((__GNUC__==2) && (__GNUC_MINOR__>=7)) || (__GNUC__>2) + #define ALIGN_GCC __attribute__ ((__packed__)) + #ifdef NO_UNALIGN + #define AS_ALIGN __attribute__ ((__aligned__(8))) + #endif + #else + #pragma pack(1) + #endif +#endif + +#ifdef _MSC_VER +#if _MSC_VER >= 900 + #pragma pack(push,_fastapi_h_,1) +#else + #pragma pack(1) +#endif +#endif + +#if defined(WINNT) || defined(__WIN32__) || defined(_WIN32) + #ifndef __386__ /* Watcom doesnt like it */ + #define __386__ + #endif + #ifdef DLL + #define CALL_ __stdcall + #else + #define CALL_ + #endif +#endif + +#ifdef DOS386 /* Symantec C */ + #define __386__ + #pragma pack(2) +#endif + +#ifdef __HIGHC__ /* Metaware High C */ + #define __386__ + #define _PACKED _Packed +#endif + +#ifdef __ZTC__ /* Zortech C */ + #define __386__ +#endif + +#ifdef SALFORD /* Salford C */ + #define ALIGN_ 8 +#endif + +#ifdef __WATCOMC__ + #pragma pack(1) + #ifndef __386__ + #ifndef OS_16 + #define CALL_ cdecl + #endif + #endif +#endif + +#ifdef _CVI_ /* LabWindows/CVI */ + #define RET_ Word + #ifndef _NI_mswin32_ + #define CALL_ pascal + #else /* No pascal in WIN32-Version of LabWindows/CVI 4.0.1 */ + #define CALL_ _stdcall + #endif + #ifndef __386__ /* __386__ defined by LabWindows/CVI */ + #define FAR_ far + #define DATAFAR_ far + #endif +#endif + +#ifdef __386__ + #define DATAFAR_ + #define FAR_ +#endif + +#ifdef HLHIGH_DLL + #define CALL_ pascal _export +#endif + +#ifdef LOAD_DS + #define CALL_ _loadds +#endif + +#ifndef CALL_ + #define CALL_ +#endif + +#ifndef _PACKED + #define _PACKED +#endif + +#ifndef ALIGN_GCC +# define ALIGN_GCC +#endif + +#ifndef DATAFAR_ + #define DATAFAR_ far +#endif + +#ifndef FAR_ + #define FAR_ far +#endif + +#ifndef RET_ + #define RET_ Word +#endif + +#ifndef ALIGN_ + #define ALIGN_ +#endif + +#ifndef AS_ALIGN + #define AS_ALIGN +#endif + +/* -------------------------------- */ +/* Definitions and API structures : */ +/* -------------------------------- */ +#ifdef __64BIT__ +typedef unsigned int Long; +typedef unsigned long Int64; +#else +typedef unsigned long Long; +#endif +#ifndef __BCPLUSPLUS__ + typedef unsigned char Byte; + typedef unsigned short Word; +#else + #ifndef VCL_H + typedef unsigned char Byte; + typedef unsigned short Word; + #endif +#endif +#ifndef __64BIT__ +#define set_data_ptr(api,buf) (api)->Data=(Byte DATAFAR_ *)(buf) +#define get_data_ptr(api) ((void *)((api)->Data)) +#else /* above macros for <=32 bit, below macros for >32 bit */ +#define set_data_ptr(api,buf) do { (api)->Data=(((Long)(buf)) & 0xffffffffu); \ + (api)->DataHigh=(((Long)(((Int64)(buf))>>32)) \ + & 0xffffffffu);} while (0) +#define get_data_ptr(api) ((void *)((Int64)((api)->Data) | \ + (((Int64)((api)->DataHigh))<<32))) +#endif + +typedef struct + { + Word Use_Key; + Byte Key[8]; + } ALIGN_GCC DES_MODE; + +typedef struct + { + Word ModAd; /* Hardlock module address */ + Word Reg; /* Memory register adress */ + Word Value; /* Memory value */ + Byte Reserved[4]; + } ALIGN_GCC EYE_MODE; + +typedef struct + { + Long PW1; /* HASP passwords */ + Long PW2; + Word P1; + } ALIGN_GCC HASP_MODE; + +typedef struct + { + Word LT_Reserved; + Word Reg; /* Memory register adress */ + Word Value; /* Memory value */ + Word Password[2]; /* Access passwords */ + } ALIGN_GCC LT_MODE; + +typedef union + { + DES_MODE Des; + EYE_MODE Eye; + LT_MODE Lt; + HASP_MODE Hasp; + } HARDWARE; + +typedef struct + { + Word P2; + Word P3; + } ALIGN_GCC HASP_MODE2; + +typedef union + { + HASP_MODE2 Hasp2; + } HARDWARE2; + +typedef struct rus_fib + { + Byte MARKER[2]; + Long SERIAL_ID; + Byte VERSION[2]; + Word FIXED; + Word VAR; + Word CRC; + } ALIGN_GCC RUS_FIB; + +typedef _PACKED struct ALIGN_ hl_api + { + Byte API_Version_ID[2]; /* Version */ + Word API_Options[2]; /* API Optionflags */ + Word ModID; /* Modul-ID (EYE = 0...) */ + HARDWARE Module; /* Hardware type */ + +#ifdef __OS2__ /* Pointer to cipher data */ + #ifdef OS_16 + void far *Data; + #else + #ifdef __BORLANDC__ + void FAR16PTR Data; + #else + void * _Seg16 Data; + #endif + #endif +#else + #ifndef __64BIT__ + void DATAFAR_ *Data; + #else + Long Data; /* low part only */ + #endif +#endif + + Word Bcnt; /* Number of blocks */ + Word Function; /* Function number */ + Word Status; /* Actual status */ + Word Remote; /* Remote or local?? */ + Word Port; /* Port address if local */ + Word Speed; /* Speed of port if local */ + Word NetUsers; /* Current Logins (HL-Server) */ + Byte ID_Ref[8]; /* Referencestring */ + Byte ID_Verify[8]; /* Encrypted ID_Ref */ + Long Task_ID; /* Multitasking program ID */ + Word MaxUsers; /* Maximum Logins (HL-Server) */ + Long Timeout; /* Login Timeout in minutes */ + Word ShortLife; /* (multiple use) */ + Word Application; /* Application number */ + Word Protocol; /* Protocol flags */ + Word PM_Host; /* DOS Extender type */ + Long OSspecific; /* ptr to OS specific data */ + Word PortMask; /* Default local search (in) */ + Word PortFlags; /* Default local search (out) */ + Word EnvMask; /* Use env string search (in) */ + Word EnvFlags; /* Use env string search (out) */ + Byte EEFlags; /* EE type flags */ + Word Prot4Info; /* (internal use) */ + Byte FuncOptions; /* Enable add. functionality */ + Word Slot_ID; /* Licence slot number */ + Word Slot_ID_HIGH; /* Licence slot High value */ + Word RUS_ExpDate; /* RUS Expiration date */ + Long DataHigh; /* Pointer to data high value */ +#ifndef __64BIT__ + void DATAFAR_ *VendorKey; /* Pointer to RUS vendor key */ +#else + Long VendorKey; /* dto. */ +#endif + Long VendorKeyHigh; /* Vendor key high value */ + Long OSspecificHigh; /* ptr to OS specific data */ + Long RUS_MaxInfo; /* RUS max user/counter */ + Long RUS_CurInfo; /* RUS current user/counter */ + RUS_FIB RUS_Fib; /* RUS FIB structure */ + HARDWARE2 Module2; /* 2nd hw dependend fields */ + Byte Reserved2[122]; /* Reserved area */ + } ALIGN_GCC AS_ALIGN HL_API, LT_API, HS_API; + +typedef _PACKED struct ALIGN_ { /* HL_LIS slot information */ + Long max_user; + Long cur_user; + Word exp_date; + Byte flag; /* singularity flag */ + Byte res; /* filler to make structure size multiple of 4 bytes */ +} ALIGN_GCC HL_SIS; + +/* License Information Structure (HL_LIS) */ +typedef _PACKED struct ALIGN_ { + Word current_date; + Word res; + Long num_slots; + Word glob_exp_date; + Word res2; /* filler to make size multiple of 4 bytes */ + HL_SIS slots[1]; +} ALIGN_GCC HL_LIS; + +#ifdef UNIX32 + #pragma pack() +#endif + +#ifdef __OS2__ + #pragma pack() +#endif + +#ifdef _MSC_VER +#if _MSC_VER >= 900 + #pragma pack(pop,_fastapi_h_) +#else + #pragma pack() +#endif +#endif + + +/* ------------- */ +/* Module-ID's : */ +/* ------------- */ +#define EYE_DONGLE 0 /* Hardlock E-Y-E */ +#define DES_DONGLE 1 /* FAST DES */ +#define LT_DONGLE 3 /* Hardlock LT */ +#define HASP_DONGLE 4 /* HASP */ + +/* --------------------- */ +/* API function calls : */ +/* --------------------- */ +#define API_INIT 0 /* Init API structure */ +#define API_DOWN 1 /* Free API structure */ +#define API_FORCE_DOWN 31 /* Force deinintialization */ +#define API_MULTI_SHELL_ON 2 /* MTS is enabled */ +#define API_MULTI_SHELL_OFF 3 /* MTS is disabled */ +#define API_MULTI_ON 4 /* Enable MTS */ +#define API_MULTI_OFF 5 /* Disable MTS */ +#define API_AVAIL 6 /* Dongle available? */ +#define API_LOGIN 7 /* Login dongle server */ +#define API_LOGOUT 8 /* Logout dongle server */ +#define API_INFO 9 /* Get API informations */ +#define API_GET_TASKID 32 /* Get TaskID from API */ +#define API_LOGIN_INFO 34 /* Get API Login informations */ + +/* --------------------------- */ +/* Data and memory functions : */ +/* --------------------------- */ +#define API_KEYE 11 /* Use KEYE for encryption */ +#define API_READ 20 /* Read one word of dongle EEPROM */ +#define API_WRITE 21 /* Write one word of dongle EEPROM */ +#define API_READ_BLOCK 23 /* Read EEPROM in one block */ +#define API_WRITE_BLOCK 24 /* Write EEPROM in one block */ +#define API_READ_ID 29 /* Read USB ID memory */ +#define API_ABORT 51 /* Critical Error Abort */ + +/* -------------- */ +/* LM functions : */ +/* -------------- */ +#define API_LMINIT 40 /* LM compatible API_INIT replacement */ +#define API_LMPING 41 /* checks if LM dongle and slot is available */ +#define API_LMINFO 42 /* info about currently used LIMA */ + +/* --------------- */ +/* RUS functions : */ +/* --------------- */ +#define API_FFS_INIT 256 /* RUS init function, downed with API_DOWN */ +#define API_FFS_ISRUSHL 257 /* Is RUS HL ? */ +#define API_FFS_LOGIN 258 /* RUS Login to Hardlock server */ +#define API_FFS_CHECK_LIC 259 /* RUS Create LIS */ +#define API_FFS_READ_LICBLOCK 260 /* RUS Read LIC Block */ +#define API_FFS_QUERY_SLOT 261 /* RUS query slot function */ +#define API_FFS_FREE_SLOT 262 /* RUS free slot */ +#define API_FFS_OCCUPY_SLOT 263 /* RUS occupies a slot */ +#define API_FFS_INC_CNTR 264 /* RUS counter increment */ +#define API_FFS_PARSERTB 265 /* RUS Parse RTB */ +#define API_FFS_GET_HWDEP_INFO 266 /* RUS get hardware dependent information */ +#define API_FFS_WRITE_LIC 267 /* RUS write updated license information */ +#define API_FFS_GETRUSINFO 269 /* get RUS info */ + +/* -------------------- */ +/* Dongle access mode : */ +/* -------------------- */ +#define LOCAL_DEVICE 1 /* Query local HL only */ +#define NET_DEVICE 2 /* Query remote HL only */ +#define DONT_CARE 3 /* Query local or remote HL */ + +/* -------------------- */ +/* EnvMask/Port Flags : */ +/* -------------------- */ +#define USB_DEVICE 256 /* Port flag for USB use */ +#define IGNORE_ENVIRONMENT 0x8000 /* Ignore HL_SEARCH */ +#define EEF_NOAUTOUSB 8 /* No automatic USB search */ + +/* ---------- */ +/* RUS flags: */ +/* ---------- */ +#define FORCE_RUS 1 /* Enable RUS init without VK */ +#define FORCE_ALF_CREATE 1 /* Force creation of ALF file in HLM_WRITELICENSE */ + +/* ------------------ */ +/* API PM_Host ID's : */ +/* ------------------ */ +#define API_XTD_DETECT 0 +#define API_XTD_DPMI 1 /* QDPMI, Borland, Windows ... */ +#define API_XTD_PHAR386 2 +#define API_XTD_PHAR286 3 +#define API_XTD_CODEBLDR 4 /* Intel Code Builder */ +#define API_XTD_COBOLXM 5 + +/* ------------------ */ +/* API Status Codes : */ +/* ------------------ */ +#define STATUS_OK 0 /* API call was succesfull */ +#define NOT_INIT 1 /* DONGLE not initialized */ +#define ALREADY_INIT 2 /* Already initialized */ +#define UNKNOWN_DONGLE 3 /* Device not supported */ +#define UNKNOWN_FUNCTION 4 /* Function not supported */ +#define HLS_FULL 6 /* HL-Server login table full */ +#define NO_DONGLE 7 /* No device available */ +#define NETWORK_ERROR 8 /* A network error occured */ +#define NO_ACCESS 9 /* No device available */ +#define INVALID_PARAM 10 /* A wrong parameter occured */ +#define VERSION_MISMATCH 11 /* HL-Server not API version */ +#define DOS_ALLOC_ERROR 12 /* Error on memory allocation */ +#define CANNOT_OPEN_DRIVER 14 /* Can not open Hardlock driver */ +#define INVALID_ENV 15 /* Invalid environment string */ +#define DYNALINK_FAILED 16 /* Unable to get a function entry */ +#define INVALID_LIC 17 /* No valid licence info (LM) */ +#define NO_LICENSE 18 /* Slot/licence not enabled (LM) */ +#define PORT_BUSY 19 /* Cannot acquire port */ +#define RUS_NO_DEVICE 20 /* Key is no Hardlock RUS key */ +#define RUS_INVALID_LIC 21 /* Invalid RUS license */ +#define RUS_SYNC_ERR 22 /* FIB in key and api struc mismatch */ +#define NOT_IMPLEMENTED 23 /* not (yet) implemented */ +#define BUFFER_TOO_SMALL 24 /* Buffer for function too small */ +#define UNKNOWN_HW_TYPE 25 /* unknown hardware descriptor */ +#define RUS_INV_FBPOS 26 /* unknown fixed block position */ +#define RUS_INVALID_SLOT 27 /* Non-existing slot number given */ +#define RUS_DATE_FAKE 28 /* RUS Date fake detected */ +#define RUS_COUNT_DOWN 29 /* RUS dead counter limit reached */ +#define RUS_INVALID_VK 30 /* RUS Vendor key is invalid */ +#define RUS_NO_LIC_FILE 31 /* RUS License file not found */ +#define RUS_INV_VBLOCK 32 /* RUS invalid variable block */ +#define RUS_LIC_FILE_WRITE_ERR 33 /* error writing (updated) license file */ +#define RUS_NO_INFO_AVAILABLE 34 /* GET_HWDEP_INFO: no info there */ +#define RUS_INFO_PACK_ERR 35 /* " " " " : cannot TLV encode data */ +#define RUS_LIC_WRITE_ERR 36 /* write license failed */ +#define RUS_DATE_EXPIRED 37 /* RUS Expiration Date reached. */ +#define TS_DETECTED 38 /* Term. Server / Citrix Winframe detected*/ +#define RUS_INVALID_RTB 39 /* Invalid updated data (RTB) */ +#define RUS_RTB_EXPIRED 40 /* Update data (RTB) has expired. */ +#define RUS_SERIAL_MISMATCH 41 /* Update data serial does not match */ +#define TOO_MANY_USERS 256 /* Login table full (remote) */ +#define SELECT_DOWN 257 /* Printer not On-line */ +#define NO_SERIALID 258 /* Serial ID not readable or n/a */ + +#endif /*_FASTAPI_H_*/ +/* eof */ + diff --git a/include/tmpfname.c b/include/tmpfname.c deleted file mode 100755 index 64bdd7e92..000000000 --- a/include/tmpfname.c +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include -#include -/* - @(H) 2.3.01.316 14/3/95 Vignali Gestione nomi temporanei intelligente - */ - -/* @(!) 2.3.01.316 */ - -void tmpfname(p,n) - char *p; - char *n; -{ - char *pp; - pp = (char *) tempnam("/tmp/",n); - strcpy(p,pp); - free((void *) pp); -} - -/* @(:) 2.3.01.316 */ diff --git a/xi/xi.c b/xi/xi.c index 3cb67858e..a1b4c29fa 100755 --- a/xi/xi.c +++ b/xi/xi.c @@ -3503,9 +3503,11 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct, if ( focus && bd->up_icon_rid == 0 && bd->up_bitmap == NULL ) { XinRect rct2; +/* int middle; int font_height; int font_top; +*/ XinPen pen; rct2 = r; diff --git a/xi/xi.h b/xi/xi.h index e136a6f03..7456009bf 100755 --- a/xi/xi.h +++ b/xi/xi.h @@ -1471,6 +1471,8 @@ xi_tree_realloc_d( p, size, __LINE__, __FILE__ ) /* Bitmap functions and macros */ XI_BITMAP* XVT_CALLCONV1 xi_bitmap_create XVT_CC_ARGS( ( char* filename, XI_BITMAP_MODE mode ) ); +XI_BITMAP* XVT_CALLCONV1 xi_bitmap_create_res XVT_CC_ARGS( ( short id, XI_BITMAP_MODE mode ) ); + XI_BITMAP* XVT_CALLCONV1 xi_bitmap_copy XVT_CC_ARGS( ( XI_BITMAP* bitmap ) ); void XVT_CALLCONV1 xi_bitmap_destroy XVT_CC_ARGS( ( XI_BITMAP* bitmap ) ); void XVT_CALLCONV1 xi_bitmap_draw XVT_CC_ARGS( ( XI_BITMAP* bitmap, XinWindow win, diff --git a/xi/xiport.c b/xi/xiport.c index 588f3af48..d4d17d7c8 100755 --- a/xi/xiport.c +++ b/xi/xiport.c @@ -5047,7 +5047,7 @@ XinBitmapRead( char *filename ) bitmap = XinMemoryAlloc( sizeof( XinBitmap ) ); bitmap->image = image; if ( xin_palette == NULL ) - xin_palette = xvt_palet_create( XVT_PALETTE_USER, NULL ); + xin_palette = xvt_palet_create( XVT_PALETTE_USER, 0 ); xvt_palet_add_colors_from_image( xin_palette, bitmap->image ); xvt_vobj_set_palet( SCREEN_WIN, xin_palette ); return bitmap; @@ -5070,7 +5070,7 @@ XinBitmapReadRes( short id) bitmap = XinMemoryAlloc( sizeof( XinBitmap ) ); bitmap->image = image; if ( xin_palette == NULL ) - xin_palette = xvt_palet_create( XVT_PALETTE_USER, NULL ); + xin_palette = xvt_palet_create( XVT_PALETTE_USER, 0 ); xvt_palet_add_colors_from_image( xin_palette, bitmap->image ); xvt_vobj_set_palet( SCREEN_WIN, xin_palette ); return bitmap;