home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / gened10.zip / SAMPLE2.H < prev    next >
Text File  |  1996-04-03  |  7KB  |  158 lines

  1. /*
  2.  *      Created 1993  IBM Corp.                                            *
  3.  *                                                                         *
  4.  *      DISCLAIMER OF WARRANTIES.  The following [enclosed] code is        *
  5.  *      sample code created by IBM Corporation. This sample code is not    *
  6.  *      part of any standard or IBM product and is provided to you solely  *
  7.  *      for  the purpose of assisting you in the development of your       *    *
  8.  *      applications.  The code is provided "AS IS", without               *
  9.  *      warranty of any kind.  IBM shall not be liable for any damages     *
  10.  *      arising out of your use of the sample code, even if they have been *
  11.  *      advised of the possibility of such damages.                        *                               *
  12.  */
  13. /***************************************************************
  14.  * header file of GDSTEST4 module
  15.  ***************************************************************
  16.  */
  17. /*************************
  18.  * TYPES
  19.  *************************
  20.  */
  21. /* The following structure is used to pass parms from the function which
  22.  * calls the GDSencode routine to the user exit function. The data type
  23.  * depends on the application. In this case, the only parm is a pointer
  24.  * to the current environment. Note that the GDSencode routine passes
  25.  * the pointer to this structure to the decoding user-exit without
  26.  * use it.
  27.  */
  28.  
  29. struct usrpstruct {             /* parms to pass to encode user-exit */
  30.  struct environment *env;
  31. };
  32.  
  33. /*************************
  34.  * PROTOTYPES
  35.  *************************
  36.  */
  37. /* the following is the prototype of the user writing routine */
  38. unsigned long mywrite(char *buf, unsigned long buflen, void *usrparms);
  39.  
  40. /* the following is the prototype of the user reading routine */
  41. unsigned long myread(char *buf, unsigned long buflen, void *usrparms);
  42.  
  43. /* the following is the prototype of the user-exit for encoding MIU type */
  44. int  encMIU(struct encinh ia,    /* inherited attrs (see enc.h) */
  45.            struct encinhsyn *sa, /* inherited/synthesized attrs */
  46.            enum tagclass cls,    /* class of the item to be encoded */
  47.            long id,              /* identifier of item to be encoded */
  48.            enum frm form,        /* form (primitive/constructed) */
  49.            char *encsubs);       /* indicator for encoding sub-pdus */
  50.  
  51. /*
  52.  * encALH encoding user exit, for ALH type
  53.  */
  54. int
  55. encALH(struct encinh ia,           /* inherited attrs */
  56.        struct encinhsyn *sa,       /* synthesized and inherited attrs */
  57.        enum tagclass cls,          /* class of item to encode */
  58.        long id,                    /* id of class to encode */
  59.        enum frm form,              /* form (prim or constr) of data to encode */
  60.        char *encsubs               /* set to !0 to encode contained types */
  61.        );
  62.  
  63. /*
  64.  * encRSH encoding user exit, for RSH type
  65.  */
  66. int
  67. encRSH(struct encinh ia,           /* inherited attrs */
  68.        struct encinhsyn *sa,       /* synthesized and inherited attrs */
  69.        enum tagclass cls,          /* class of item to encode */
  70.        long id,                    /* id of class to encode */
  71.        enum frm form,              /* form (prim or constr) of data to encode */
  72.        char *encsubs               /* set to !0 to encode contained types */
  73.        );
  74.  
  75. /*
  76.  * encAGD encoding user exit, for AGD
  77.  */
  78. int
  79. encAGD(struct encinh ia,           /* inherited attrs */
  80.        struct encinhsyn *sa,       /* synthesized and inherited attrs */
  81.        enum tagclass cls,          /* class of item to encode */
  82.        long id,                    /* id of class to encode */
  83.        enum frm form,              /* form (prim or constr) of data to encode */
  84.        char *encsubs               /* set to !0 to encode contained types */
  85.        );
  86.  
  87. /*
  88.  * encMSGCLASS encoding user exit, for MSGCLASS
  89.  */
  90. int
  91. encMSGCLASS(struct encinh ia,         /* inherited attrs */
  92.             struct encinhsyn *sa,     /* synthesized and inherited attrs */
  93.             enum tagclass cls,        /* class of item to encode */
  94.             long id,                  /* id of class to encode */
  95.             enum frm form,            /* form (prim or constr) of data to encode */
  96.             char *encsubs             /* set to !0 to encode contained types */
  97.             );
  98.  
  99. /*
  100.  * encDESTNAPS encoding user exit, for DESTNAPS
  101.  */
  102. int
  103. encDESTNAPS(struct encinh ia,         /* inherited attrs */
  104.         struct encinhsyn *sa,     /* synthesized and inherited attrs */
  105.         enum tagclass cls,        /* class of item to encode */
  106.         long id,                  /* id of class to encode */
  107.         enum frm form,            /* form (prim or constr) of data to encode */
  108.         char *encsubs             /* set to !0 to encode contained types */
  109.         );
  110.  
  111. /*
  112.  * encNODENAME encoding user exit, for NODENAME
  113.  */
  114. int
  115. encNODENAME(struct encinh ia,    /* inherited attrs */
  116.        struct encinhsyn *sa,     /* synthesized and inherited attrs */
  117.        enum tagclass cls,        /* class of item to encode */
  118.        long id,                  /* id of class to encode */
  119.        enum frm form,            /* form (prim or constr) of data to encode */
  120.        char *encsubs             /* set to !0 to encode contained types */
  121.        );
  122.  
  123. /*
  124.  * encAGENTNAME encoding user exit, for AGENTNAME
  125.  */
  126. int
  127. encAGENTNAME(struct encinh ia,         /* inherited attrs */
  128.        struct encinhsyn *sa,     /* synthesized and inherited attrs */
  129.        enum tagclass cls,        /* class of item to encode */
  130.        long id,                  /* id of class to encode */
  131.        enum frm form,            /* form (prim or constr) of data to encode */
  132.        char *encsubs             /* set to !0 to encode contained types */
  133.        );
  134.  
  135. /*
  136.  * encNAME64 encoding user exit, for NAME64
  137.  */
  138. int
  139. encNAME64(struct encinh ia,        /* inherited attrs */
  140.        struct encinhsyn *sa,     /* synthesized and inherited attrs */
  141.        enum tagclass cls,        /* class of item to encode */
  142.        long id,                  /* id of class to encode */
  143.        enum frm form,            /* form (prim or constr) of data to encode */
  144.        char *encsubs             /* set to !0 to encode contained types */
  145.        );
  146.  
  147.  
  148. /* the following are the prototypes of the user-exits for the passing of the
  149.  * content */
  150. int agentdata_cont (char **buff, unsigned long *buflen, enum lastflag *lastf);
  151.  
  152. /******************
  153.  * MACROS
  154.  ******************
  155.  */
  156. #define NEW(t)          ((t *) mallocate((unsigned) sizeof(t)))
  157. #define NEW2(n, t)      ((t *) mallocate((unsigned) ((n) * sizeof(t))))
  158.