📄 ctypes.c
字号:
/*
* Copyright (C) Ericsson Mobile Communications AB, 2001.
* Licensed to AU-System AB.
* All rights reserved.
*
* This software is covered by the license agreement between
* the end user and AU-System AB, and may be used and copied
* only in accordance with the terms of the said agreement.
*
* Neither Ericsson Mobile Communications AB nor AU-System AB
* assumes any responsibility or liability for any errors or inaccuracies in
* this software, or any consequential, incidental or indirect damage arising
* out of the use of the Generic WAP Client software.
*/
/* Program generated by SDT Cmicro, version 1.33 */
#ifndef XSCT_CMICRO
#define XSCT_CMICRO
#endif
#define C_MICRO_1_3
#include "ml_typw.h"
#include "ctypes.h"
/*************************************************************************
** #CODE directives, #BODY sections **
*************************************************************************/
/*************************************************************************
** SECTION Variables and Functions **
*************************************************************************/
/*****
* GENERATOR CArray (BODY section)
* <<PACKAGE ctypes>>
* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),559)
******/
/*****
* GENERATOR Ref (BODY section)
* <<PACKAGE ctypes>>
* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),571)
******/
/*****
* SYNTYPE ShortInt (BODY section)
* <<PACKAGE ctypes>>
* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),27)
******/
/* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),27) */
#ifdef XREADANDWRITEF
static char yCTemp_ShortInt[50];
#ifndef XNOPROTO
extern int yRead_z_ctypes_6_ShortInt(
void * Result)
#else
extern int yRead_z_ctypes_6_ShortInt( Result )
void * Result;
#endif
{
z_ctypes_6_ShortInt temp;
xxToken Token;
int Negative;
Token = xPromptQuestionMark(" (ShortInt) : ",
" (ShortInt) : ", yCTemp_ShortInt);
Negative = 0;
if (Token == xxPlus)
Token = xScanToken(yCTemp_ShortInt);
else if (Token == xxMinus) {
Token = xScanToken(yCTemp_ShortInt);
Negative = 1;
}
if (Token == xxId && sscanf(yCTemp_ShortInt, "%hd", &temp) >= 1) {
if (Negative)
*(z_ctypes_6_ShortInt *)Result = -temp;
else
*(z_ctypes_6_ShortInt *)Result = temp;
return 1;
}
xPrintString("Illegal ShortInt value\n");
return 0;
}
#ifndef XNOPROTO
extern char *yWri_z_ctypes_6_ShortInt(
void * C)
#else
extern char *yWri_z_ctypes_6_ShortInt( C )
void * C;
#endif
{
sprintf(yCTemp_ShortInt, "%hd", *(z_ctypes_6_ShortInt *)C);
return yCTemp_ShortInt;
}
#endif
/*****
* SYNTYPE LongInt (BODY section)
* <<PACKAGE ctypes>>
* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),95)
******/
/* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),95) */
#ifdef XREADANDWRITEF
static char yCTemp_Longint[50];
#ifndef XNOPROTO
extern int yRead_z_ctypes_7_LongInt(
void * Result)
#else
extern int yRead_z_ctypes_7_LongInt( Result )
void * Result;
#endif
{
z_ctypes_7_LongInt temp;
xxToken Token;
int Negative;
Token = xPromptQuestionMark(" (LongInt) : ",
" (LongInt) : ", yCTemp_Longint);
Negative = 0;
if (Token == xxPlus)
Token = xScanToken(yCTemp_Longint);
else if (Token == xxMinus) {
Token = xScanToken(yCTemp_Longint);
Negative = 1;
}
if (Token == xxId && sscanf(yCTemp_Longint, "%ld", &temp) >= 1) {
if (Negative)
*(z_ctypes_7_LongInt *)Result = -temp;
else
*(z_ctypes_7_LongInt *)Result = temp;
return 1;
}
xPrintString("Illegal LongInt value\n");
return 0;
}
#ifndef XNOPROTO
extern char *yWri_z_ctypes_7_LongInt(
void * C)
#else
extern char *yWri_z_ctypes_7_LongInt( C )
void * C;
#endif
{
sprintf(yCTemp_Longint, "%ld", *(z_ctypes_7_LongInt *)C);
return yCTemp_Longint;
}
#endif
/*****
* SYNTYPE UnsignedShortInt (BODY section)
* <<PACKAGE ctypes>>
* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),163)
******/
/* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),163) */
#ifdef XREADANDWRITEF
static char yCTemp_UnsignedShortInt[50];
#ifndef XNOPROTO
extern int yRead_z_ctypes_8_UnsignedShortInt(
void * Result)
#else
extern int yRead_z_ctypes_8_UnsignedShortInt( Result )
void * Result;
#endif
{
z_ctypes_8_UnsignedShortInt temp;
xxToken Token;
Token = xPromptQuestionMark(" (UnsignedShortInt) : ",
" (UnsignedShortInt) : ", yCTemp_UnsignedShortInt);
if (Token == xxPlus) Token = xScanToken(yCTemp_UnsignedShortInt);
if (Token == xxId && sscanf(yCTemp_UnsignedShortInt, "%hu", &temp) >= 1) {
*(z_ctypes_8_UnsignedShortInt *)Result = temp;
return 1;
}
xPrintString("Illegal unsigned short int value\n");
return 0;
}
#ifndef XNOPROTO
extern char *yWri_z_ctypes_8_UnsignedShortInt(
void * C)
#else
extern char *yWri_z_ctypes_8_UnsignedShortInt( C )
void * C;
#endif
{
sprintf(yCTemp_UnsignedShortInt, "%hu", *(z_ctypes_8_UnsignedShortInt *)C);
return yCTemp_UnsignedShortInt;
}
#endif
/*****
* SYNTYPE UnsignedInt (BODY section)
* <<PACKAGE ctypes>>
* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),221)
******/
/* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),221) */
#ifdef XREADANDWRITEF
static char yCTemp_UnsignedInt[50];
#ifndef XNOPROTO
extern int yRead_z_ctypes_9_UnsignedInt(
void * Result)
#else
extern int yRead_z_ctypes_9_UnsignedInt( Result )
void * Result;
#endif
{
z_ctypes_9_UnsignedInt temp;
xxToken Token;
Token = xPromptQuestionMark(" (UnsignedInt) : ",
" (UnsignedInt) : ", yCTemp_UnsignedInt);
if (Token == xxPlus) Token = xScanToken(yCTemp_UnsignedInt);
if (Token == xxId && sscanf(yCTemp_UnsignedInt, "%u", &temp) >= 1) {
*(z_ctypes_9_UnsignedInt *)Result = temp;
return 1;
}
xPrintString("Illegal unsigned int value\n");
return 0;
}
#ifndef XNOPROTO
extern char *yWri_z_ctypes_9_UnsignedInt(
void * C)
#else
extern char *yWri_z_ctypes_9_UnsignedInt( C )
void * C;
#endif
{
sprintf(yCTemp_UnsignedInt, "%u", *(z_ctypes_9_UnsignedInt *)C);
return yCTemp_UnsignedInt;
}
#endif
/*****
* SYNTYPE UnsignedLongInt (BODY section)
* <<PACKAGE ctypes>>
* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),278)
******/
/* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),278) */
#ifdef XREADANDWRITEF
static char yCTemp_UnsignedLongInt[50];
#ifndef XNOPROTO
extern int yRead_z_ctypes_A_UnsignedLongInt(
void * Result)
#else
extern int yRead_z_ctypes_A_UnsignedLongInt( Result )
void * Result;
#endif
{
z_ctypes_A_UnsignedLongInt temp;
xxToken Token;
Token = xPromptQuestionMark(" (UnsignedLongInt) : ",
" (UnsignedLongInt) : ", yCTemp_UnsignedLongInt);
if (Token == xxPlus) Token = xScanToken(yCTemp_UnsignedLongInt);
if (Token == xxId && sscanf(yCTemp_UnsignedLongInt, "%lu", &temp) >= 1) {
*(z_ctypes_A_UnsignedLongInt *)Result = temp;
return 1;
}
xPrintString("Illegal unsigned long int value\n");
return 0;
}
#ifndef XNOPROTO
extern char *yWri_z_ctypes_A_UnsignedLongInt(
void * C)
#else
extern char *yWri_z_ctypes_A_UnsignedLongInt( C )
void * C;
#endif
{
sprintf(yCTemp_UnsignedLongInt, "%lu", *(z_ctypes_A_UnsignedLongInt *)C);
return yCTemp_UnsignedLongInt;
}
#endif
/*****
* SYNTYPE Float (BODY section)
* <<PACKAGE ctypes>>
* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),336)
******/
/* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),336) */
#ifdef XREADANDWRITEF
#ifndef XNOUSEOFREAL
#ifndef XNOPROTO
extern int yRead_z_ctypes_B_Float(
void * Result)
#else
extern int yRead_z_ctypes_B_Float( Result )
void * Result;
#endif
{
SDL_Real r;
if (xRead_SDL_Real((void *)&r)) {
*(z_ctypes_B_Float *)Result = (z_ctypes_B_Float)r;
return 1;
}
return 0;
}
#ifndef XNOPROTO
extern char *yWri_z_ctypes_B_Float(
void * C)
#else
extern char *yWri_z_ctypes_B_Float( C )
void * C;
#endif
{
SDL_Real r;
r = (SDL_Real)*(z_ctypes_B_Float *)C;
return xWri_SDL_Real((void *)&r);
}
#endif
#endif
/*****
* NEWTYPE CharStar (BODY section)
* <<PACKAGE ctypes>>
* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),391)
******/
/* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),399) */
#ifndef XSCT_CMICRO
#ifndef XNOPROTO
extern SDL_Charstring z_ctypes_31_CStar2CString(
z_ctypes_3_CharStar C)
#else
extern SDL_Charstring z_ctypes_31_CStar2CString( C )
z_ctypes_3_CharStar C;
#endif
{
SDL_Charstring Result;
int i = 0;
if (C != 0) i = strlen(C);
Result = (SDL_Charstring)xAlloc(i+2);
if (i>0) memcpy(Result+1, C, i);
Result[0] = 'T';
Result[i+1] = '\0';
return Result;
}
#ifndef XNOPROTO
extern z_ctypes_3_CharStar z_ctypes_32_CString2CStar(
SDL_Charstring C)
#else
extern z_ctypes_3_CharStar z_ctypes_32_CString2CStar( C )
SDL_Charstring C;
#endif
{
z_ctypes_3_CharStar Result;
int i;
i = xLength_SDL_Charstring(C);
#ifdef XVALIDATOR_LIB
Result = (z_ctypes_3_CharStar)xSysMalloc(i+1);
#else
Result = (z_ctypes_3_CharStar)xAlloc(i+1);
#endif
if (i>0) memcpy(Result, C+1, i);
Result[i] = '\0';
if (C != 0 && C[0] == 'T')
xFree_SDL_Charstring((void **)&C);
return Result;
}
#endif
#ifdef XREADANDWRITEF
#ifndef XNOPROTO
extern int yRead_z_ctypes_3_CharStar(
void * Result)
#else
extern int yRead_z_ctypes_3_CharStar( Result )
void * Result;
#endif
{
SDL_Charstring temp;
temp = (SDL_Charstring)0;
if (xRead_SDL_Charstring((void *)&temp)) {
temp[0] = 'T';
*(z_ctypes_3_CharStar *)Result = z_ctypes_32_CString2CStar(temp);
return 1;
}
return 0;
}
#ifndef XNOPROTO
extern char *yWri_z_ctypes_3_CharStar(
void * C)
#else
extern char *yWri_z_ctypes_3_CharStar( C )
void * C;
#endif
{
SDL_Charstring temp;
char * Result;
temp = z_ctypes_31_CStar2CString(*(z_ctypes_3_CharStar *)C);
Result = xWri_SDL_Charstring((void *)&temp);
xFree_SDL_Charstring((void **)&temp);
return Result;
}
#endif
/*****
* NEWTYPE VoidStar (BODY section)
* <<PACKAGE ctypes>>
* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),505)
******/
/*****
* NEWTYPE VoidStarStar (BODY section)
* <<PACKAGE ctypes>>
* #SDTREF(SDL,D:\WIP\Maintenance\4.x\System\SystemConfigurations\base_co\sdl\packages\ctypes.sun(1),119(25,40),523)
******/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -