home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff227.lzh / PickPacket / src / PickPack.h < prev    next >
C/C++ Source or Header  |  1989-06-25  |  7KB  |  200 lines

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
  2. * |_o_o|\\ Copyright (c) 1989 The Software Distillery.                    *
  3. * |. o.| ||          All Rights Reserved                                  *
  4. * | .  | ||          Written by John Toebes and Doug Walker               *
  5. * | o  | ||          The Software Distillery                              *
  6. * |  . |//           235 Trillingham Lane                                 *
  7. * ======             Cary, NC 27513                                       *
  8. *                    BBS:(919)-471-6436                                   *
  9. \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  10. #include <exec/types.h>
  11. #include <exec/memory.h>
  12. #include <intuition/intuition.h>
  13. #include <graphics/gfxmacros.h>
  14. #include <graphics/rastport.h>
  15. #include <libraries/dos.h>
  16. #include <workbench/startup.h>
  17. #include <proto/intuition.h>
  18. #include <proto/dos.h>
  19. #include <proto/exec.h>
  20. #include <proto/graphics.h>
  21. #include <string.h>
  22. #include <stdlib.h>
  23. #include <stdio.h>
  24.  
  25. #ifdef DEBUG
  26. #undef DEBUG
  27. #endif
  28.  
  29. #if 0
  30. #define DEBUG 1
  31. extern int debug;
  32. #define BUG(n,a) if(debug>=(n)){printf a ; fflush(stdout);}
  33. #else
  34. #define BUG(n,a) ;
  35. #endif
  36.  
  37. /* my version of BADDR() has no problems with casting */
  38. #undef  BADDR
  39. #define BADDR(x)        ((APTR)((long)x << 2))
  40. #define MKBADDR(x)      ((BPTR)((long)x >> 2))
  41.  
  42. #define GAD_UNKNOWN        1   /* The PW default */
  43. #define GAD_ARG1           2
  44. #define GAD_ARG2           3
  45. #define GAD_ARG3           4
  46. #define GAD_ARG4           5
  47. #define GAD_STR1           6
  48. #define GAD_STR2           7
  49. #define GAD_STR3           8
  50. #define GAD_STR4           9
  51. #define GAD_DEVICE        10
  52. #define GAD_SEND          11
  53. #define GAD_PREV          12
  54. #define GAD_NEXT          13
  55. #define GAD_HANDLE        14
  56. #define GAD_FILEINFO      15
  57. #define GAD_INFODATA      16
  58. #define GAD_BUFFER        17
  59. #define GAD_DEBUG         18
  60. #define GAD_BUFLEN        19
  61. #define GAD_BLOK          20
  62. #define GAD_BLCAN         21
  63. #define GAD_DOWN          22  
  64. #define GAD_SLIDER        23  /* THis must be the middle of GAD_DOWN/GAD_UP */
  65. #define GAD_UP            24  /* To do a subtraction to get the direction   */
  66.  
  67. #define SEL_OPENINPUT      1
  68. #define SEL_OPENOUTPUT     2
  69. #define SEL_OPENUPDATE     3
  70. #define SEL_READ           4
  71. #define SEL_WRITE          5
  72. #define SEL_SEEK           6
  73. #define SEL_CLOSE          7
  74. #define SEL_TRUNCATE       8
  75. #define SEL_LOCK           9
  76. #define SEL_DUPLOCK       10
  77. #define SEL_UNLOCK        11
  78. #define SEL_EXAMINE       12
  79. #define SEL_EXNEXT        13
  80. #define SEL_CREATEDIR     14
  81. #define SEL_DELETE        15
  82. #define SEL_RENAME        16
  83. #define SEL_PARENT        17
  84. #define SEL_SETPROTECT    18
  85. #define SEL_SETCOMMENT    19
  86. #define SEL_SETDATE       20
  87. #define SEL_CURRENTVOL    21
  88. #define SEL_INFO          22
  89. #define SEL_DISKINFO      23
  90. #define SEL_RENAMEDISK    24
  91. #define SEL_DIE           25
  92. #define SEL_FLUSH         26
  93. #define SEL_MORECACHE     27
  94. #define SEL_INHIBIT       28
  95. #define SEL_WRITE_PROTECT 29
  96. #define SEL_NETWORKHELLO  30
  97. #define SEL_DEBUG         31
  98. #define SEL_SETTRANS      32
  99.  
  100. #define SEL_LASTPACKET    32
  101. #define SEL_HANDLE        (SEL_LASTPACKET+1)
  102. #define SEL_FILEINFO      (SEL_LASTPACKET+2)
  103. #define SEL_INFODATA      (SEL_LASTPACKET+3)
  104. #define SEL_BUFFER        (SEL_LASTPACKET+4)
  105. #define SEL_PURGE         (SEL_LASTPACKET+5)
  106. #define SEL_QUIT          (SEL_LASTPACKET+6)
  107. #define SEL_HELP          (SEL_LASTPACKET+7)
  108. #define SEL_SEND          (SEL_LASTPACKET+8)
  109. #define SEL_MIN2          (SEL_LASTPACKET+9)
  110. #define SEL_MIN1          (SEL_LASTPACKET+10)
  111. #define SEL_ZERO          (SEL_LASTPACKET+11)
  112. #define SEL_ONE           (SEL_LASTPACKET+12)
  113.  
  114. #ifndef ACTION_NETWORK_HELLO
  115. #define ACTION_NETWORK_HELLO 2012
  116. #endif
  117.  
  118. #ifndef ACTION_HANDLER_DEBUG
  119. #define ACTION_HANDLER_DEBUG 2010
  120. #endif
  121.  
  122. #ifndef ACTION_SET_TRANS
  123. #define ACTION_SET_TRANS 2011
  124. #endif
  125.  
  126. extern struct Menu Menu1;
  127. extern struct TextAttr TOPAZ80;
  128.  
  129. /* Types for the Arg1-4 and Res1-2 fields */
  130. #define STR 1      /* Text string                                        */
  131. #define FLG 2      /* Boolean flag                                       */
  132. #define LCK 3      /* BPTR to a struct FileLock                          */
  133. #define HAN 4      /* BPTR to a struct FileHandle                        */
  134. #define FIB 5      /* BPTR to a struct FileInfoBlock                     */
  135. #define AG1 6      /* Arg1 from a struct FileHandle                      */
  136. #define INF 7      /* BPTR to a struct InfoData                          */
  137. #define NUM 8      /* Integer                                            */
  138. #define VOL 9      /* BPTR to a volume node                              */
  139. #define RCNUM 10   /* Return code value                                  */
  140. #define BUF 11     /* BPTR to a data buffer                              */
  141.  
  142. /* return codes */
  143. #define RC_OK             0  /* Normal completion                        */
  144. #define RC_ERRNOMEM      -1  /* Out of memory                            */
  145. #define RC_ERRNOWIND     -2  /* Couldn't open window                     */
  146. #define RC_ERRBADTYPE    -3  /* Bad struct TYPE code specified           */
  147. #define RC_ERRNOTINLIST  -4  /* Supplied struct is not in struct list    */
  148. #define RC_UNLINKED      -5  /* Tried to act on an unlinked window       */
  149. #define RC_ERRBADPACKET  -6  /* Bad packet type specified                */
  150. #define RC_ERRNODEVICE   -7  /* DeviceProc returned NULL                 */
  151. #define RC_ERRBADDATA    -8  /* Bad data value in Argn field             */
  152.  
  153. /* The following are struct types to be passed to the struct routines    */
  154. #define ST_UNLINKED -1   /* Struct has been unlinked, don't use it       */
  155.  
  156. #define ST_DATA      0   /* Data buffer                                  */
  157. #define ST_VIEW      1   /* File viewer                                  */
  158. #define ST_INTER     2   /* One bigger than the last interactive one     */
  159.  
  160. #define ST_FIB       2   /* struct FileInfoBlock                         */
  161. #define ST_HANDLE    3   /* struct FileHandle                            */
  162. #define ST_LOCK      4   /* struct FileLock                              */
  163. #define ST_INFO      5   /* struct InfoData                              */
  164. #define ST_NUM       6   /* One bigger than last one defined above       */
  165.  
  166. #define HELPFILE "PickPack.Doc"
  167.  
  168. extern struct Window *Window;
  169.  
  170. /* The following are defined in struct.c */
  171. int InitST(struct MsgPort *);
  172. int TermST(void);
  173. struct Window *AllocST(int, APTR, int);
  174. int DisplayST(struct Window *);
  175. void MoveWind(struct Window *, int);
  176. int UnlinkST(struct Window *);
  177. int PurgeST(void);
  178. int NameST(struct Window *, char *, struct MsgPort *);
  179. int WindSize(struct Window *);
  180. APTR WindToST(struct Window *);
  181. struct Window *STToWind(APTR);
  182. APTR FindST(char *, int);
  183.  
  184. /* The following is from sendpkt.c */
  185. LONG sendpkt(struct MsgPort *, long, long*, long, long*);
  186.  
  187. /* The following is from pickpack.c */
  188. void status(char *);
  189.  
  190. /* The following is from request.c */
  191. int reqinit(void);
  192. int reqkill(void);
  193.  
  194. /* The following is from help.c */
  195. int GetHelp(char **, int *);
  196. int CountLines(char *, int);
  197.  
  198. /* The following is from date.c */
  199. void FormatDate(struct DateStamp *, char *);
  200.