00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #define LIBTEKLTI_EXPORT (0)
00023
00024 #include "teklti.h"
00025 #include <string.h>
00026
00027 #ifdef DEBUG_USE_FERROR
00028 #include <stdio.h>
00029 #endif
00030
00031
00032 #ifdef DEBUG_USE_FERROR
00033 static const char _mkuuid_t_uuidstr_null[] =
00034 "POTENTIAL SEGFAULT in _mkuuid_t: uuid_str is NULL!\n";
00035 static const char _mkuuid_t_uuidstr_overrun[] =
00036 "POTENTIAL OVERRUN in _mkuuid_t: uuid_str will cause a buffer overrun!\n";
00037 #endif
00038
00039
00040 #ifndef USE_386_ASM
00041 TEKLTI_DECLSPEC void _mkuuid_t ( const char * uuid_str, uuid_t uuid_raw )
00042 {
00043 #ifndef NO_SIZE_T_CHECKS
00044 if ( uuid_str == NULL )
00045 {
00046 #ifdef DEBUG_USE_FERROR
00047 fputs(_mkuuid_t_uuidstr_null, stderr);
00048 #endif
00049 return;
00050 }
00051 if ( strlen(uuid_str) >= 40 * sizeof(char) )
00052 {
00053 #ifdef DEBUG_USE_FERROR
00054 fputs(_mkuuid_t_uuidstr_overrun, stderr);
00055 #endif
00056 return;
00057 }
00058 #endif
00059 (void)uuid_parse(uuid_str, uuid_raw);
00060
00061
00062 return;
00063 }
00064 #endif
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 TEKLTI_DECLSPEC TEKERR TekStdGetGlobalVariables (
00076 struct TekStdGlobalVars * RetVal
00077 )
00078 {
00079 #ifndef NO_SIZE_T_CHECKS
00080
00081 if ( RetVal == NULL )
00082 return TEKERR_POINTER;
00083 #endif
00084
00085
00086 if ( RetVal->TekStdGlobalVarsSize < sizeof(struct TekStdGlobalVars) )
00087 return TEKERR_UNAVAILABLE;
00088
00089
00090 if ( RetVal->TekStdGlobalVarsSize > sizeof(struct TekStdGlobalVars) )
00091 RetVal->TekStdGlobalVarsSize = sizeof(struct TekStdGlobalVars);
00092
00093
00094 if ( RetVal->TekStdGlobalVarsVersion.TekStdVerSize
00095 > sizeof(struct TekStdVersion) )
00096 {
00097 RetVal->TekStdGlobalVarsVersion.TekStdVerSize =
00098 sizeof(struct TekStdVersion);
00099 }
00100
00101
00102 RetVal->TekStdGlobalVarsVersion.TekStdVerMajor = TEKLTI_VER_MAJOR;
00103 RetVal->TekStdGlobalVarsVersion.TekStdVerMinor = TEKLTI_VER_MINOR;
00104 RetVal->TekStdGlobalVarsVersion.TekStdVerRev = TEKLTI_VER_REVISION;
00105 RetVal->TekStdGlobalVarsVersion.TekStdVerPatchNo = TEKLTI_VER_PATCHNO;
00106 strcpy(
00107 RetVal->TekStdGlobalVarsVersion.TekStdVerMisc,
00108 TEKLTI_VER_MISCINFO
00109 );
00110
00111
00112 RetVal->TekStdGlobalVarsMaxImpl = TEKSTD_MAXIMPL;
00113
00114
00115 #ifdef UNICODE
00116 RetVal->TekStdGlobalVarsUnicode = 1;
00117 #else
00118 RetVal->TekStdGlobalVarsUnicode = 0;
00119 #endif
00120
00121 #ifdef USE_386_ASM_MMX
00122 RetVal->TekStdGlobalVarsMMX = 1;
00123 #else
00124 RetVal->TekStdGlobalVarsMMX = 0;
00125 #endif
00126
00127 #ifdef USE_386_ASM_MMX_RESET_MM7
00128 RetVal->TekStdGlobalVarsMMXResetMM7 = 0;
00129 #else
00130 RetVal->TekStdGlobalVarsMMXResetMM7 = 1;
00131 #endif
00132
00133
00134 #ifdef NO_INTERNAL_NULL_CHECKS
00135 RetVal->TekStdGlobalVarsInternalChecks = 0;
00136 #else
00137 RetVal->TekStdGlobalVarsInternalChecks = 1;
00138 #endif
00139
00140
00141 #ifdef NO_SIZE_T_CHECKS
00142 RetVal->TekStdGlobalVarsPassInPointerChecks = 0;
00143 #else
00144 RetVal->TekStdGlobalVarsPassInPointerChecks = 1;
00145 #endif
00146
00147
00148 #ifdef USE_386_ASM_PUSHPOP
00149 RetVal->TekStdGlobalVarsPushPopEnforced = 1;
00150 #else
00151 RetVal->TekStdGlobalVarsPushPopEnforced = 0;
00152 #endif
00153
00154 #ifdef USE_386_ASM_ENFORCE_PRIVACY
00155 RetVal->TekStdGlobalVarsPrivacyEnforced = 1;
00156 #else
00157 RetVal->TekStdGlobalVarsPrivacyEnforced = 0;
00158 #endif
00159
00160 return TEKERR_OK;
00161 }
00162
00163
00164 TEKLTI_DECLSPEC TEKERR TekStdCreateInstance (
00165 CPTekStdCIInput InterfaceStructs,
00166 size_t InterfaceStructCount,
00167 void ** InstanceArray,
00168 size_t InstanceArrayCount,
00169 const uuid_t * UUIDArray,
00170 size_t UUIDArrayCount,
00171 unsigned int Flags,
00172 PTekStdVersion VersionStruct
00173 )
00174 {
00175 return TEKERR_NOTIMPL;
00176 }
00177
00178
00179 TEKLTI_DECLSPEC TEKERR TekStdGetLibraryVersion (
00180 PTekStdVersion * VersionStruct,
00181 size_t VersionStructCount
00182 )
00183 {
00184 return TEKERR_NOTIMPL;
00185 }
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205