本文整理汇总了C++中SystemDependentData函数的典型用法代码示例。如果您正苦于以下问题:C++ SystemDependentData函数的具体用法?C++ SystemDependentData怎么用?C++ SystemDependentData使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SystemDependentData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fopen_s
globle FILE *GenOpen(
void *theEnv,
char *fileName,
char *accessType)
{
FILE *theFile;
if (SystemDependentData(theEnv)->BeforeOpenFunction != NULL)
{ (*SystemDependentData(theEnv)->BeforeOpenFunction)(theEnv); }
#if WIN_MVC
#if _MSC_VER >= 1400
fopen_s(&theFile,fileName,accessType);
#else
theFile = fopen(fileName,accessType);
#endif
#else
theFile = fopen(fileName,accessType);
#endif
if (SystemDependentData(theEnv)->AfterOpenFunction != NULL)
{ (*SystemDependentData(theEnv)->AfterOpenFunction)(theEnv); }
return theFile;
}
示例2: genexit
globle void genexit(
void *theEnv,
int num)
{
if (SystemDependentData(theEnv)->jmpBuffer != NULL)
{ longjmp(*SystemDependentData(theEnv)->jmpBuffer,1); }
exit(num);
}
示例3: int
globle int (*EnvSetAfterOpenFunction(void *theEnv,
int (*theFunction)(void *)))(void *)
{
int (*tempFunction)(void *);
tempFunction = SystemDependentData(theEnv)->AfterOpenFunction;
SystemDependentData(theEnv)->AfterOpenFunction = theFunction;
return(tempFunction);
}
示例4: RestoreInterruptVectors
static void RestoreInterruptVectors()
{
#if ALLOW_ENVIRONMENT_GLOBALS
void *theEnv;
theEnv = GetCurrentEnvironment();
_dos_setvect(0x23,SystemDependentData(theEnv)->OldCtrlC);
_dos_setvect(0x1b,SystemDependentData(theEnv)->OldBreak);
#endif
}
示例5: GetSeekSetBinary
globle void GetSeekSetBinary(
void *theEnv,
long offset)
{
#if WIN_MVC
_lseek(SystemDependentData(theEnv)->BinaryFileHandle,offset,SEEK_SET);
#endif
#if (! WIN_MVC)
fseek(SystemDependentData(theEnv)->BinaryFP,offset,SEEK_SET);
#endif
}
示例6: GenTellBinary
globle void GenTellBinary(
void *theEnv,
long *offset)
{
#if WIN_MVC
*offset = _lseek(SystemDependentData(theEnv)->BinaryFileHandle,0,SEEK_CUR);
#endif
#if (! WIN_MVC)
*offset = ftell(SystemDependentData(theEnv)->BinaryFP);
#endif
}
示例7: GenCloseBinary
globle void GenCloseBinary(
void *theEnv)
{
#if MAC
FSClose(SystemDependentData(theEnv)->BinaryRefNum);
#endif
#if IBM_TBC || IBM_MSC || IBM_ICB /* || IBM_MCW */
close(SystemDependentData(theEnv)->BinaryFileHandle);
#endif
#if (! MAC) && (! IBM_TBC) && (! IBM_MSC) && (! IBM_ICB) /* && (! IBM_MCW) */
fclose(SystemDependentData(theEnv)->BinaryFP);
#endif
}
示例8: GenClose
globle int GenClose(
void *theEnv,
FILE *theFile)
{
int rv;
if (SystemDependentData(theEnv)->BeforeOpenFunction != NULL)
{ (*SystemDependentData(theEnv)->BeforeOpenFunction)(theEnv); }
rv = fclose(theFile);
if (SystemDependentData(theEnv)->AfterOpenFunction != NULL)
{ (*SystemDependentData(theEnv)->AfterOpenFunction)(theEnv); }
return rv;
}
示例9: GetSeekSetBinary
globle void GetSeekSetBinary(
void *theEnv,
long offset)
{
#if MAC
SetFPos(SystemDependentData(theEnv)->BinaryRefNum,fsFromStart,offset);
#endif
#if IBM_TBC || IBM_MSC || IBM_ICB /* || IBM_MCW || IBM_ZTC */
lseek(SystemDependentData(theEnv)->BinaryFileHandle,offset,SEEK_SET);
#endif
#if (! MAC) && (! IBM_TBC) && (! IBM_MSC) && (! IBM_ICB) /* && (! IBM_MCW) && (! IBM_ZTC) */
fseek(SystemDependentData(theEnv)->BinaryFP,offset,SEEK_SET);
#endif
}
示例10: genungetchar
globle int genungetchar(
void *theEnv,
int theChar)
{
#if WIN_BTC || WIN_MVC
if (SystemDependentData(theEnv)->getcPosition > 0)
{
SystemDependentData(theEnv)->getcPosition--;
return theChar;
}
else
{ return EOF; }
#else
return(ungetc(theChar,stdin));
#endif
}
示例11: GenTellBinary
globle void GenTellBinary(
void *theEnv,
long *offset)
{
#if MAC
GetFPos(SystemDependentData(theEnv)->BinaryRefNum,offset);
#endif
#if IBM_TBC || IBM_MSC || IBM_ICB /* || IBM_MCW || IBM_ZTC */
*offset = lseek(SystemDependentData(theEnv)->BinaryFileHandle,0,SEEK_CUR);
#endif
#if (! MAC) && (! IBM_TBC) && (! IBM_MSC) && (! IBM_ICB) /* && (! IBM_MCW) && (! IBM_ZTC) */
*offset = ftell(SystemDependentData(theEnv)->BinaryFP);
#endif
}
示例12: GenReadBinary
globle void GenReadBinary(
void *theEnv,
void *dataPtr,
unsigned long size)
{
#if MAC
long dataSize;
dataSize = (long) size;
FSRead(SystemDependentData(theEnv)->BinaryRefNum,&dataSize,dataPtr);
#endif
#if IBM_TBC || IBM_MSC || IBM_ICB /* || IBM_MCW */
char *tempPtr;
tempPtr = (char *) dataPtr;
while (size > INT_MAX)
{
read(SystemDependentData(theEnv)->BinaryFileHandle,tempPtr,INT_MAX);
size -= INT_MAX;
tempPtr = tempPtr + INT_MAX;
}
if (size > 0)
{ read(SystemDependentData(theEnv)->BinaryFileHandle,tempPtr,(STD_SIZE) size); }
#endif
#if (! MAC) && (! IBM_TBC) && (! IBM_MSC) && (! IBM_ICB) /* && (! IBM_MCW) && (! IBM_ZTC) */
unsigned int temp, number_of_reads, read_size;
if (sizeof(int) == sizeof(long))
{ read_size = size; }
else
{ read_size = (1L << (sizeof(int) * 8L)) - 1L ; }
number_of_reads = size / read_size;
temp = size - ((long) number_of_reads * (long) read_size);
while (number_of_reads > 0)
{
fread(dataPtr,(STD_SIZE) read_size,1,SystemDependentData(theEnv)->BinaryFP);
dataPtr = ((char *) dataPtr) + read_size;
number_of_reads--;
}
fread(dataPtr,(STD_SIZE) temp,1,SystemDependentData(theEnv)->BinaryFP);
#endif
}
示例13: gengetchar
globle int gengetchar(
void *theEnv)
{
#if WIN_BTC || WIN_MVC
if (SystemDependentData(theEnv)->getcLength ==
SystemDependentData(theEnv)->getcPosition)
{
TCHAR tBuffer = 0;
DWORD count = 0;
WCHAR wBuffer = 0;
ReadConsole(GetStdHandle(STD_INPUT_HANDLE),&tBuffer,1,&count,NULL);
wBuffer = tBuffer;
SystemDependentData(theEnv)->getcLength =
WideCharToMultiByte(CP_UTF8,0,&wBuffer,1,
(char *) SystemDependentData(theEnv)->getcBuffer,
7,NULL,NULL);
SystemDependentData(theEnv)->getcPosition = 0;
}
return SystemDependentData(theEnv)->getcBuffer[SystemDependentData(theEnv)->getcPosition++];
#else
return(getc(stdin));
#endif
}
示例14: InitializeNonportableFeatures
static void InitializeNonportableFeatures(
void *theEnv)
{
#if MAC_MCW || IBM_MCW
#pragma unused(theEnv)
#endif
#if ! WINDOW_INTERFACE
#if MAC
AddPeriodicFunction("systemtask",CallSystemTask,0);
#endif
#if VAX_VMS || UNIX_V || UNIX_7 || IBM_GCC
signal(SIGINT,CatchCtrlC);
#endif
#if IBM_TBC
SystemDependentData(theEnv)->OldCtrlC = getvect(0x23);
SystemDependentData(theEnv)->OldBreak = getvect(0x1b);
setvect(0x23,CatchCtrlC);
setvect(0x1b,CatchCtrlC);
atexit(RestoreInterruptVectors);
#endif
#if IBM_MSC || IBM_ICB
SystemDependentData(theEnv)->OldCtrlC = _dos_getvect(0x23);
SystemDependentData(theEnv)->OldBreak = _dos_getvect(0x1b);
_dos_setvect(0x23,CatchCtrlC);
_dos_setvect(0x1b,CatchCtrlC);
atexit(RestoreInterruptVectors);
#endif
#if IBM_ZTC || IBM_SC
_controlc_handler = CatchCtrlC;
controlc_open();
#endif
#endif
}
示例15: GenReadBinary
globle void GenReadBinary(
void *theEnv,
void *dataPtr,
size_t size)
{
#if WIN_MVC
char *tempPtr;
tempPtr = (char *) dataPtr;
while (size > INT_MAX)
{
_read(SystemDependentData(theEnv)->BinaryFileHandle,tempPtr,INT_MAX);
size -= INT_MAX;
tempPtr = tempPtr + INT_MAX;
}
if (size > 0)
{ _read(SystemDependentData(theEnv)->BinaryFileHandle,tempPtr,(unsigned int) size); }
#endif
#if WIN_BTC
char *tempPtr;
tempPtr = (char *) dataPtr;
while (size > INT_MAX)
{
read(SystemDependentData(theEnv)->BinaryFileHandle,tempPtr,INT_MAX);
size -= INT_MAX;
tempPtr = tempPtr + INT_MAX;
}
if (size > 0)
{ read(SystemDependentData(theEnv)->BinaryFileHandle,tempPtr,(STD_SIZE) size); }
#endif
#if (! WIN_BTC) && (! WIN_MVC)
fread(dataPtr,size,1,SystemDependentData(theEnv)->BinaryFP);
#endif
}