⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sctpred.h

📁 是一个手机功能的模拟程序
💻 H
📖 第 1 页 / 共 5 页
字号:
/*
# clearcase: CmicroPatchRel2.3.3
*/

/*
+------------------------------------------------------------------------------+
|                                                                              |
|  Copyright by Telelogic AB 1993 - 1998                                       | 
|  Copyright by S&P Media GmbH Germany 1993 - 1998                             | 
|                                                                              |
|  This Program is owned by Telelogic and is protected by national             | 
|  copyright laws and international copyright treaties. Telelogic              | 
|  grants you the right to use this Program on one computer or in              | 
|  one local computer network at any one time.                                 | 
|  Under this License you may only modify the source code for the purpose      | 
|  of adapting it to your environment. You must reproduce and include          | 
|  any copyright and trademark notices on all copies of the source code.       | 
|  You may not use, copy, merge, modify or transfer the Program except as      | 
|  provided in this License.                                                   | 
|  Telelogic does not warrant that the Program will meet your                  | 
|  requirements or that the operation of the Program will be                   | 
|  uninterrupted and error free. You are solely responsible that the           | 
|  selection of the Program and the modification of the source code            | 
|  will achieve your intended results and that the results are actually        | 
|  obtained.                                                                   |
|                                                                              |
+------------------------------------------------------------------------------+
*/ 
 

#ifndef X_SCTPRED_H
#define X_SCTPRED_H

/* This file contains implementation of the predefined data types
   except PId. The functions defined here can be found in the file
   sctpred.c.
*/
/*
FILE INDEX
00   Some utility macros
01   Typedef, Default value, Literals
02   Prototypes and macros for the operators of the data types
03   Read and Write functions

     NOTE: 
     The predefined generators are contained in an extra file
     "sctpredg.h" which is included at the end of this file.
*/
          
/* 
** General check on the codegenerator that is used 
*/ 
#if !defined(XSCT_CBASIC) && !defined(XSCT_CADVANCED) && !defined(XSCT_CMICRO)
 #error "ERROR_in_sctpred_h_Please_Define_A_Codegenerator"
#endif


/****+***************************************************************
00   Some utility macros
********************************************************************/

/* Macros used in the generator implementations */

#if defined(XSCT_CADVANCED) || defined(XSCT_CBASIC)

#ifdef XECSOP
#define xReportStringError(S1,S2)   xSDLOpError(S1,S2);
#else
#define xReportStringError(S1,S2)
#endif /* ... XECSOP */

#else /* then XSCT_CMICRO */

#ifdef XMK_USE_MAX_ERR_CHECK
#define xReportStringError(S1,S2)   xSDLOpError(S1,S2);
#else
#define xReportStringError(S1,S2)   ErrorHandler (ERR_N_PREDEFINED_OPERATOR_CALL);
#endif /* ... XMK_USE_MAX_ERR_CHECK */

#endif /* ... defined(XSCT_CADVANCED) || defined(XSCT_CBASIC) */


/****+***************************************************************
01   Typedef, Default value, Literals
********************************************************************/

/*---+---------------------------------------------------------------
     Boolean
-------------------------------------------------------------------*/

#if !defined(X_COMPACT_BOOL)
typedef int     SDL_Boolean;
typedef int     SDL_boolean;
#else
typedef unsigned char     SDL_Boolean;
typedef unsigned char     SDL_boolean;
#endif

#if defined(XSCT_CADVANCED) || defined(XSCT_CBASIC)

#define xDef_SDL_Boolean(V)       *(V) = (SDL_Boolean)0
#define yDef_SDL_Boolean(V)       xDef_SDL_Boolean(V)

#else /* then XSCT_CMICRO */

#ifdef XMK_USE_KERNEL_INIT
  /* Cmicro Kernel does initialization */
#define xDef_SDL_Boolean(V)

#else

#define xDef_SDL_Boolean(V)       *(V) = (SDL_Boolean)0

#endif /* ... XMK_USE_KERNEL_INIT */

#define yDef_SDL_Boolean(V)       xDef_SDL_Boolean(V)

#endif /* ... defined(XSCT_CADVANCED) || defined(XSCT_CBASIC) */

#define yAssF_SDL_Boolean(V,E,A)  (V = E)
#define yEqF_SDL_Boolean(E1,E2)   (E1) == (E2)
#define yNEqF_SDL_Boolean(E1,E2)  (E1) != (E2)
#define ySrtN_SDL_Boolean         xSrtN_SDL_Boolean

#define SDL_False 0
#define SDL_false 0
#define SDL_True  1
#define SDL_true  1


/*---+---------------------------------------------------------------
     Bit
-------------------------------------------------------------------*/
typedef unsigned char SDL_Bit;

#if defined(XSCT_CADVANCED) || defined(XSCT_CBASIC)

#define xDef_SDL_Bit(V)       *(V) = (SDL_Bit)0

#else /* then XSCT_CMICRO */

#ifdef XMK_USE_KERNEL_INIT
  /* Cmicro Kernel does initialization */
#define xDef_SDL_Bit(V)

#else

#define xDef_SDL_Bit(V)       *(V) = (SDL_Bit)0

#endif /* ... XMK_USE_KERNEL_INIT */

#endif /* ... defined(XSCT_CADVANCED) || defined(XSCT_CBASIC) */

#define yDef_SDL_Bit(V)       xDef_SDL_Bit(V)
#define yAssF_SDL_Bit(V,E,A)  (V = E)
#define yEqF_SDL_Bit(E1,E2)   ((E1) == (E2))
#define yNEqF_SDL_Bit(E1,E2)  ((E1) != (E2))
#define ySrtN_SDL_Bit         xSrtN_SDL_Bit

#define SDL_BIT_LIT(I)        I


/*---+---------------------------------------------------------------
     Bit_String
-------------------------------------------------------------------*/

#ifndef XNOUSEOFOCTETBITSTRING

typedef struct {
  int             Length;
  xbool           IsAssigned;
  xbool           IsUsedInSignal;
  unsigned char * Bits;
} SDL_Bit_String;

#define xDef_SDL_Bit_String(V) \
  (*V).Length = 0; (*V).IsUsedInSignal = (xbool)0; (*V).IsAssigned = (xbool)1; (*V).Bits = 0;
#define yDef_SDL_Bit_String(V)       xDef_SDL_Bit_String(V)
#define yAssF_SDL_Bit_String(V,E,A)  xAss_SDL_Bit_String(&(V),E,A)
#define yEqF_SDL_Bit_String(E1,E2)   xEq_SDL_Bit_String(E1,E2)
#define yNEqF_SDL_Bit_String(E1,E2)  (! xEq_SDL_Bit_String(E1,E2))
#define ySrtN_SDL_Bit_String         xSrtN_SDL_Bit_String

#endif
       /* XNOUSEOFOCTETBITSTRING */


/*---+---------------------------------------------------------------
     Octet
-------------------------------------------------------------------*/

#ifndef XNOUSEOFOCTETBITSTRING

typedef unsigned char SDL_Octet;

#if defined(XSCT_CADVANCED) || defined(XSCT_CBASIC)

#define xDef_SDL_Octet(V)       *(V) = (SDL_Octet)0

#else /* then XSCT_CMICRO */

#ifdef XMK_USE_KERNEL_INIT
  /* Cmicro Kernel does initialization */
#define xDef_SDL_Octet(V)

#else
 
#define xDef_SDL_Octet(V)       *(V) = (SDL_Octet)0
 
#endif /* ... XMK_USE_KERNEL_INIT */
 
#endif /* ... defined(XSCT_CADVANCED) || defined(XSCT_CBASIC) */

#define yDef_SDL_Octet(V)       xDef_SDL_Octet(V)
#define yAssF_SDL_Octet(V,E,A)  (V = E)
#define yEqF_SDL_Octet(E1,E2)   ((E1) == (E2))
#define yNEqF_SDL_Octet(E1,E2)  ((E1) != (E2))
#define ySrtN_SDL_Octet         xSrtN_SDL_Octet

#endif
       /* XNOUSEOFOCTETBITSTRING */


/*---+---------------------------------------------------------------
     Octet_String
-------------------------------------------------------------------*/

#ifndef XNOUSEOFOCTETBITSTRING

typedef SDL_Bit_String SDL_Octet_String;

#define xDef_SDL_Octet_String(V) \
  (*V).Length = 0; (*V).IsUsedInSignal = (xbool)0; (*V).IsAssigned = (xbool)1; (*V).Bits = 0;
#define yDef_SDL_Octet_String(V)       xDef_SDL_Octet_String(V)
#define yAssF_SDL_Octet_String(V,E,A)  xAss_SDL_Bit_String(&(V),E,A)
#define yEqF_SDL_Octet_String(E1,E2)   xEq_SDL_Bit_String(E1,E2)
#define yNEqF_SDL_Octet_String(E1,E2)  (! xEq_SDL_Bit_String(E1,E2))
#define ySrtN_SDL_Octet_String         xSrtN_SDL_Octet_String

#endif
       /* XNOUSEOFOCTETBITSTRING */


/*---+---------------------------------------------------------------
     Character
-------------------------------------------------------------------*/

typedef char    SDL_Character;
typedef char    SDL_character;

#if defined(XSCT_CADVANCED) || defined(XSCT_CBASIC)

#define xDef_SDL_Character(V)       *(V) = '\000'

#else /* then XSCT_CMICRO */

#ifdef XMK_USE_KERNEL_INIT
  /* Cmicro Kernel does initialization */
#define xDef_SDL_Character(V)       

#else

#define xDef_SDL_Character(V)       *(V) = '\000'

#endif /* ... XMK_USE_KERNEL_INIT */

#endif /* ... defined(XSCT_CADVANCED) || defined(XSCT_CBASIC) */

#define yDef_SDL_Character(V)       xDef_SDL_Character(V)
#define yAssF_SDL_Character(V,E,A)  (V = E)
#define yEqF_SDL_Character(E1,E2)   ((E1) == (E2))
#define yNEqF_SDL_Character(E1,E2)  ((E1) != (E2))
#define ySrtN_SDL_Character         xSrtN_SDL_Character

/* predefined literals for non-printable characters,
   other literals as in C */
#define SDL_NUL '\000'
#define SDL_SOH '\001'
#define SDL_STX '\002'
#define SDL_ETX '\003'
#define SDL_EOT '\004'
#define SDL_ENQ '\005'
#define SDL_ACK '\006'
#define SDL_BEL '\007'
#define SDL_BS  '\010'
#define SDL_HT  '\011'
#define SDL_LF  '\012'
#define SDL_VT  '\013'
#define SDL_FF  '\014'
#define SDL_CR  '\015'
#define SDL_SO  '\016'
#define SDL_SI  '\017'
#define SDL_DLE '\020'
#define SDL_DC1 '\021'
#define SDL_DC2 '\022'
#define SDL_DC3 '\023'
#define SDL_DC4 '\024'
#define SDL_NAK '\025'
#define SDL_SYN '\026'
#define SDL_ETB '\027'
#define SDL_CAN '\030'
#define SDL_EM  '\031'
#define SDL_SUB '\032'
#define SDL_ESC '\033'
#define SDL_IS4 '\034'
#define SDL_IS3 '\035'
#define SDL_IS2 '\036'
#define SDL_IS1 '\037'
#define SDL_DEL '\177'


/*---+---------------------------------------------------------------
     Charstring
-------------------------------------------------------------------*/

#ifndef XNOUSEOFCHARSTRING


#if defined(XSCT_CADVANCED) || defined(XSCT_CBASIC)

typedef char   *SDL_Charstring;
typedef char   *SDL_charstring;

#define xDef_SDL_Charstring(V) \
   xAss_SDL_Charstring(V, (SDL_Charstring)0, XASS)
#define yDef_SDL_Charstring(V)       xDef_SDL_Charstring(V)
#define yAssF_SDL_Charstring(V,E,A)  xAss_SDL_Charstring(&(V),E,A)
#define yEqF_SDL_Charstring(E1,E2)   xEq_SDL_Charstring(E1,E2)
#define yNEqF_SDL_Charstring(E1,E2)  (! xEq_SDL_Charstring(E1,E2))
#define ySrtN_SDL_Charstring         xSrtN_SDL_Charstring

#define SDL_CHARSTRING_LIT(P1, P2)   P1

#else /* then XSCT_CMICRO */

/*
** Charstrings are complicated to handle them most efficiently
** in the target. There are two basic mechanisms for Cmicro.
** For most SDL conformity, the XRESTUSEOFCHARSTRING
** flag should NOT BE SET. In this case, the solution with
** dynamic memory allocation is selected.
*/
#ifdef XRESTUSEOFCHARSTRING
  /*
  ** Non-Standard Charstring implementation !
  **
  ** Each SDL Charstring in the system is represented in C as
  ** a buffer with the following upper limit : XMK_MAX_SDL_CHARSTRING.
  ** That is good for ROM memory optimization, but not very good
  ** for RAM optimization. If you prefer RAM optimization, then you
  ** have to use alternative 2 (XMK_USE_SDL_CHARSTRING).
  ** The user must be aware of the case of buffer overflow.
  ** Especially such cases can occur when the environment sends
  ** Charstrings into the SDL system, when the Environment
  ** doesn't care about the upper limit.
  */
  typedef char  SDL_Charstring [XMK_MAX_SDL_CHARSTRING] ;
  typedef char  SDL_charstring [XMK_MAX_SDL_CHARSTRING] ;

  #ifdef XMK_USE_KERNEL_INIT
    /* Cmicro Kernel does initialization */
    #define xDef_SDL_Charstring(V)
  #else
    #define xDef_SDL_Charstring(V)     (*V)[0] = '\0';
  #endif

  #define yDef_SDL_Charstring(V)       xDef_SDL_Charstring(V)
  #define yAssF_SDL_Charstring(V,E,A)  (void)strcpy (V,E) ;
  #define yEqF_SDL_Charstring(E1,E2)   (!strcmp (E1,E2))
  #define yNEqF_SDL_Charstring(E1,E2)  (strcmp (E1,E2))
  #define ySrtN_SDL_Charstring         xSrtN_SDL_Charstring_NotImplemented
  #define xLength_SDL_Charstring(STR)  strlen (STR)
  #define SDL_CHARSTRING_LIT(P1, P2)   P2

  /*
  ** Not implemented Charstring operations ....
  ** These would require dynamic memory management
  */
  #define xMkString_SDL_Charstring(STR)  MkString_SDL_Charstring_NotImplemented
  #define xMod_SDL_Charstring(STR)       Mod_SDL_Charstring_NotImplemented
  #define xSubString_SDL_Charstring(STR) SubString_SDL_Charstring_NotImplemented
  #define xConcat_SDL_Charstring(STR)    Concat_SDL_Charstring_NotImplemented

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -