home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / gened10.zip / SAMPLE.H < prev    next >
Text File  |  1996-04-03  |  2KB  |  55 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.  * PROTOTYPES
  15.  *************************
  16.  */
  17. /* the following is the prototype of the user writing routine */
  18. unsigned long mywrite(char *buf, unsigned long buflen, void *usrparms);
  19.  
  20. /* the following is the prototype of the user reading routine */
  21. unsigned long myread(char *buf, unsigned long buflen, void *usrparms);
  22.  
  23. /* the following are the prototypes of the user-exits for the passing of the
  24.  * content */
  25. int mycontent (char **buff, unsigned long *buflen, enum lastflag *lastf);
  26. int mycontent2 (char **buff, unsigned long *buflen, enum lastflag *lastf);
  27. int mycontent3 (char **buff, unsigned long *buflen, enum lastflag *lastf);
  28. int mycontent4 (char **buff, unsigned long *buflen, enum lastflag *lastf);
  29. int mycontent5 (char **buff, unsigned long *buflen, enum lastflag *lastf);
  30. int mycontent6 (char **buff, unsigned long *buflen, enum lastflag *lastf);
  31. int mycontent7 (char **buff, unsigned long *buflen, enum lastflag *lastf);
  32. int mycontent8 (char **buff, unsigned long *buflen, enum lastflag *lastf);
  33.  
  34. /* the following is the prototype of the user-exit for decoding */
  35. int mydec(unsigned short ndx, struct gds *p, char *content,
  36.           unsigned long contlen, void *usrparms);
  37.  
  38. static
  39. void readmodtype(char *readbuf, int buflen, char **readmod);
  40.  
  41. static
  42. char *readline(char *buf);
  43.  
  44. char * mallocate(unsigned n);
  45.  
  46. /****************
  47.  * MACROS
  48.  ****************
  49.  */
  50. #define UNDEFLENGTH -1L
  51.  
  52. #define NEW(t)          ((t *) mallocate((unsigned) sizeof(t)))
  53. #define NEW2(n, t)      ((t *) mallocate((unsigned) ((n) * sizeof(t))))
  54.  
  55.