home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Tools / Preditor 2.0 / Preditor Folder / PCMD Source / MPW / PCMD.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-12  |  1.5 KB  |  73 lines  |  [TEXT/TCEd]

  1. /************************************************************
  2.  
  3.     PCMD.h
  4.     Last Modified: Tuesday, January 22, 1990 at 9:46 PM
  5.     Interface to Preditor PCMD modules
  6.  
  7.     PCMD's must take the following form:
  8.         
  9.         long MyPCMD(
  10.             unsigned char        *sourceText,
  11.             long                sourceLength,
  12.             unsigned char        *destText,
  13.             long                *destSpace,
  14.             PCMDInfo            *info
  15.             )
  16.         {
  17.             return(kPCMDSuccess);
  18.         }
  19.     
  20.     And are compiled as CODE resources, with id = 100 (PCMD 
  21.     changes the text) or id = 101 (PCMD only reads the text)
  22.  
  23.     © Copyright Evatac Software  1988-1991
  24.     All rights reserved
  25.  
  26. ************************************************************/
  27.  
  28. #ifndef __PCMD__
  29. #define __PCMD__
  30.  
  31. /*
  32.  * Valid return values for PCMD module
  33.  */
  34.  
  35. #define kPCMDError                    (-1)
  36. #define kPCMDSuccess                0
  37. #define kPCMDMoreSpace                1
  38. #define kPCMDStop                    2
  39.  
  40. #define FirstLine(info)        ((info)->currentLineNum == (info)->startLineNum)
  41. /*
  42.  * Typedef for the structure space passed in
  43.  * to the PCMD module
  44.  */
  45.  
  46. typedef struct PCMDInfo {
  47.     long            currentLineNum;
  48.     long            startLineNum;
  49.     long            linesAffected;
  50.     long            linesAdded;
  51.     long            textGrowth;
  52.     long            startPosThisLine;
  53.     short            startColThisLine;
  54.     short            endColThisLine;
  55.     short            startCol;
  56.     short            endCol;
  57.     char            *globals;        /* 20 bytes of global data */
  58. } PCMDInfo;
  59.  
  60. /*
  61.  * Typedef for a pointer to a PCMD function
  62.  */
  63.  
  64. typedef long    (*PCMDProcPtr)(
  65.     unsigned char        *sourceText,
  66.     long                sourceLength,
  67.     unsigned char        *destText,
  68.     long                *destSpace,
  69.     PCMDInfo            *info
  70.     );
  71.  
  72. #endif
  73.