home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff284.lzh / Dme / src / defs.h < prev    next >
C/C++ Source or Header  |  1989-11-27  |  10KB  |  391 lines

  1.  
  2. /*
  3.  * DEFS.H
  4.  *
  5.  *    (C)Copyright 1987 by Matthew Dillon, All Rights Reserved
  6.  *
  7.  *    ARexx support added 03/19/88  -  Kim DeVaughn
  8.  *
  9.  */
  10.  
  11. #define AREXX 1
  12.  
  13. #include <exec/types.h>
  14. #include <exec/memory.h>
  15. #include <exec/ports.h>
  16. #include <libraries/dos.h>
  17. #include <libraries/dosextens.h>
  18. #include <intuition/intuition.h>
  19. #include <intuition/intuitionbase.h>
  20. #include <devices/keymap.h>
  21. #include <devices/console.h>
  22.  
  23. /*
  24.  *  Need the prototypes for inline library call pragmas so we don't
  25.  *  need to reference amiga.lib which has absolute references to
  26.  *  various variables (can't have absolutes for a residentable program)
  27.  */
  28.  
  29. #include <proto/all.h>
  30.  
  31. #ifdef LATTICE
  32. #include <string.h>
  33. #include <stdlib.h>
  34. #endif
  35.  
  36. /*#include <workbench/icon.h>*/
  37. #include <workbench/startup.h>
  38. #include <workbench/workbench.h>
  39.  
  40. #if AREXX
  41. #include "rexx/storage.h"
  42. #include "rexx/rxslib.h"
  43. #include "rexx/rexxio.h"
  44. #include "rexx/errors.h"
  45. #endif
  46.  
  47. #define MAXTOGGLE   256
  48. #define QMOVE        (0x6B|0x80)
  49.  
  50. #define COLT(n)  (XTbase + (n) * Xsize)
  51. #define ROWT(n)  (YTbase + (n) * Ysize)
  52. #define COL(n)   (Xbase  + (n) * Xsize)
  53. #define ROW(n)   (Ybase  + (n) * Ysize)
  54.  
  55. #ifdef LATTICE
  56. #define ARGS(args)  args        /*  ANSI-C                  */
  57. #define reg            /*  let lattice pick regs   */
  58. #else
  59. #define ARGS(args)  ()          /*  no prototypes           */
  60. #define __stdargs        /*  no lattice keywords     */
  61. #define __saveds
  62. #define reg register        /*  req program pick regs   */
  63. #endif
  64.  
  65. typedef unsigned char    ubyte;
  66. typedef unsigned short    uword;
  67. typedef unsigned long    ulong;
  68. typedef struct MinNode    MNODE;
  69. typedef struct Node    NODE;
  70. typedef struct MinList    MLIST;
  71. typedef struct List    LIST;
  72. typedef struct MsgPort    PORT;
  73. typedef struct Window    WIN;
  74. typedef struct Message    MSG;
  75. typedef struct TextAttr     TA;
  76. typedef struct TextFont     FONT;
  77. typedef struct RastPort RP;
  78. typedef struct FileInfoBlock FIB;
  79. typedef struct Process PROC;
  80. typedef struct IntuiMessage IMESS;
  81. typedef struct IntuitionBase    IBASE;
  82. typedef struct Menu    MENU;
  83. typedef struct MenuItem ITEM;
  84. typedef struct IntuiText    ITEXT;
  85.  
  86.  
  87. typedef struct WBStartup  WBS;
  88. typedef struct DiskObject DISKOBJ;
  89.  
  90.  
  91. extern WBS    *Wbs;
  92.  
  93. extern short Xsize, Ysize;
  94. extern short XTbase, YTbase;
  95. extern short Rows, Columns;
  96. extern short Xbase, Ybase;
  97. extern short Xpixs, Ypixs;
  98. extern ubyte *av[];
  99. extern char Wdisable;
  100.  
  101. typedef struct _ED {
  102.     MNODE Node;
  103.     WIN *Win;
  104.     FONT *Font;         /*    da font, da font!            */
  105.     long Topline, Topcolumn;
  106.     long Line, Column;
  107.     long Lines, Maxlines;
  108.     ubyte **List;
  109.     ubyte Name[64];
  110.     ubyte Wtitle[130];
  111.     char Modified;
  112.     ubyte Tabstop;
  113.     ubyte Margin;
  114.     char Insertmode;
  115.     char IgnoreCase;
  116.     char Wordwrap;
  117.     char iconmode;        /*    window in icon mode            */
  118.     short Winx;         /*    save state of non-icon window        */
  119.     short Winy;
  120.     short Winwidth;
  121.     short Winheight;
  122.     short IWinx, IWiny;     /*    save state of icon window        */
  123.     long  dirlock;        /* directory lock                */
  124. } ED;
  125.  
  126. extern long  BSline, BEline;
  127. extern short BSchar, BEchar;
  128. extern ED    *BEp;
  129.  
  130.  
  131. #ifndef NULL
  132. #define NULL 0
  133. #endif
  134. #ifdef E
  135. #undef E
  136. #endif
  137.  
  138. extern MLIST DBase;
  139. extern MLIST PBase;
  140. extern ED    *Ep;
  141.  
  142. extern char    Overide;
  143. extern char    Savetabs;
  144. extern char    memoryfail, Nsu, Msgchk;
  145. extern ubyte    CtlC;
  146. extern ubyte    Current[256];
  147. extern ubyte    Space[32];
  148. extern short    Clen;
  149. extern char    Abortcommand, MShowTitle;
  150. extern char    Comlinemode;
  151. extern RP    *Rp;
  152. extern WIN    *Win;
  153. extern char    *Partial;
  154. extern char    *String;
  155.  
  156. extern long    Dirlock;
  157.  
  158. extern PORT    *IPCPort;
  159. extern long    DResBase;
  160.  
  161. /*
  162.  *  PROTOTYPES
  163.  */
  164.  
  165. /* external protos  */
  166.  
  167. extern void    *xfopen ARGS((char *, char *, long));
  168.  
  169. /* Prototypes for functions defined in cmd1.c */
  170.  
  171. void escapecomlinemode ARGS((void));
  172. void setpen ARGS((int));
  173. void text_cursor ARGS((int));
  174. int text_init ARGS((void));
  175. int text_switch ARGS((struct Window *));
  176. int text_sync ARGS((void));
  177. int text_load ARGS((void));
  178. int text_colno ARGS((void));
  179. int text_lineno ARGS((void));
  180. int text_lines ARGS((void));
  181. int text_cols ARGS((void));
  182. int text_imode ARGS((void));
  183. int text_tabsize ARGS((void));
  184. unsigned char *text_name ARGS((void));
  185. void text_uninit ARGS((void));
  186. void inversemode ARGS((int));
  187. void text_position ARGS((int, int));
  188. void displayblock ARGS((int));
  189. void text_redrawblock ARGS((int));
  190. void text_redisplaycurrline ARGS((void));
  191. void text_redisplay ARGS((void));
  192. void text_write ARGS((unsigned char *));
  193. void text_displayseg ARGS((int, int));
  194. void movetocursor ARGS((void));
  195. void do_up ARGS((void));
  196. void do_scrolldown ARGS((void));
  197. void do_scrollup ARGS((void));
  198. void do_down ARGS((void));
  199. void do_page ARGS((void));
  200. void do_downadd ARGS((void));
  201. void do_left ARGS((void));
  202. void do_right ARGS((void));
  203. void do_col ARGS((void));
  204. void do_tab ARGS((void));
  205. void do_backtab ARGS((void));
  206. void do_return ARGS((void));
  207. void do_bs ARGS((void));
  208. void do_recall ARGS((void));
  209. void do_esc ARGS((void));
  210. void do_del ARGS((void));
  211. void do_top ARGS((void));
  212. void do_bottom ARGS((void));
  213. void do_firstcolumn ARGS((void));
  214. void do_firstnb ARGS((void));
  215. void do_lastcolumn ARGS((void));
  216. void do_goto ARGS((void));
  217. void do_screentop ARGS((void));
  218. void do_screenbottom ARGS((void));
  219. void do_findstr ARGS((void));
  220. void do_findr ARGS((void));
  221. void do_find ARGS((void));
  222. void search_operation ARGS((void));
  223. int case_strncmp ARGS((char *, char *, int));
  224.  
  225. /* Prototypes for functions defined in cmd2.c */
  226.  
  227. struct _ED *uninit_init ARGS((struct _ED *));
  228. void do_remeol ARGS((void));
  229. void do_wleft ARGS((void));
  230. void do_wright ARGS((void));
  231. void do_split ARGS((void));
  232. int do_join ARGS((void));
  233. void do_margin ARGS((void));
  234. void do_wordwrap ARGS((void));
  235. void do_reformat ARGS((int));
  236. void do_tabstop ARGS((void));
  237. void do_insertmode ARGS((void));
  238. void do_insline ARGS((void));
  239. void do_deline ARGS((void));
  240. void do_chfilename ARGS((void));
  241. void do_edit ARGS((void));
  242. void do_bsave ARGS((void));
  243. void do_save ARGS((void));
  244. void do_saveas ARGS((void));
  245. void do_savetabs ARGS((void));
  246. void do_block ARGS((void));
  247. int blockok ARGS((void));
  248. void do_bdelete ARGS((void));
  249. void do_bcopy ARGS((void));
  250. void do_bmove ARGS((void));
  251. void do_if ARGS((void));
  252. int do_toggle ARGS((int));
  253. void do_tlate ARGS((void));
  254. void do_bsource ARGS((void));
  255. void do_scanf ARGS((void));
  256. int extend ARGS((struct _ED *, int));
  257. int makeroom ARGS((int));
  258. void freelist ARGS((char **, int));
  259.  
  260. /* Prototypes for functions defined in cmd3.c */
  261.  
  262. void do_setfont ARGS((void));
  263. void do_ignorecase ARGS((void));
  264. void do_cd ARGS((void));
  265. void do_set ARGS((void));
  266. void do_setenv ARGS((void));
  267. void do_unset ARGS((void));
  268. void do_unsetenv ARGS((void));
  269. char *getvar ARGS((char *));
  270.  
  271. /* Prototypes for functions defined in command.c */
  272. void init_command ARGS((void));
  273. int do_command ARGS((char *));
  274. void do_null ARGS((void));
  275. void do_source ARGS((void));
  276. void do_quit ARGS((void));
  277. void do_execute ARGS((void));
  278. void do_repeat ARGS((void));
  279. char *breakout ARGS((char **, char *, char **));
  280.  
  281. /* Prototypes for functions defined in filereq.c */
  282.  
  283. void do_arpinsfile ARGS((void));
  284. void do_arpload ARGS((void));
  285. void do_arpsave ARGS((void));
  286. void fixfile ARGS((char *, char *));
  287. void splitpath ARGS((char *, char *, char *));
  288.  
  289. /* Prototypes for functions defined in globals.c */
  290.  
  291. /* Prototypes for functions defined in keyboard.c */
  292. void keyctl ARGS((struct IntuiMessage *, int, unsigned short));
  293. void dealloc_hash ARGS((void));
  294. void resethash ARGS((void));
  295. int returnoveride ARGS((int));
  296. void addhash ARGS((ubyte, ubyte, ubyte, ubyte, ubyte *));
  297. int remhash ARGS((ubyte, ubyte, ubyte));
  298. char *keyspectomacro ARGS((char *));
  299. void do_map ARGS((void));
  300. void do_unmap ARGS((void));
  301. void do_clearmap ARGS((void));
  302. void do_savemap ARGS((void));
  303. void keyboard_init ARGS((void));
  304. unsigned char *cqtoa ARGS((int, int));
  305. int get_codequal ARGS((ubyte *, ubyte *, ubyte *));
  306.  
  307. /* Prototypes for functions defined in main.c */
  308.  
  309. void ipchandler ARGS((void));
  310. void initipc ARGS((void));
  311. void do_ipc ARGS((void));
  312. void do_iconify ARGS((void));
  313. void do_tomouse ARGS((void));
  314. void iconify ARGS((void));
  315. void uniconify ARGS((void));
  316. void do_newwindow ARGS((int, int));
  317. struct Window *TOpenWindow ARGS((struct NewWindow *));
  318. struct Window *opensharedwindow ARGS((struct NewWindow *));
  319. void closesharedwindow ARGS((struct Window *));
  320. int getyn ARGS((char *));
  321. void title ARGS((char *));
  322. void window_title ARGS((void));
  323. void set_window_params ARGS((void));
  324. void exiterr ARGS((char *));
  325. int breakcheck ARGS((void));
  326. void breakreset ARGS((void));
  327. void do_windowparm ARGS((void));
  328. void do_resize ARGS((void));
  329. int ops ARGS((char **, int));
  330.  
  331. /* Prototypes for functions defined in menu.c */
  332.  
  333. void menu_strip ARGS((struct Window *));
  334. void menu_off ARGS((void));
  335. void menu_on ARGS((void));
  336. void do_menuoff ARGS((void));
  337. void do_menuon ARGS((void));
  338. char *menutomacro ARGS((char *));
  339. char *menu_cmd ARGS((struct IntuiMessage *));
  340. void fixmenu ARGS((void));
  341. void do_menuclear ARGS((void));
  342. void do_menuadd ARGS((void));
  343. void do_menudelhdr ARGS((void));
  344. int do_menudel ARGS((void));
  345.  
  346. /* Prototypes for functions defined in mods.c */
  347. void PMAdd ARGS((void));
  348. void PMRem ARGS((void));
  349. void PMKill ARGS((struct _ED *));
  350. int do_pushmark ARGS((void));
  351. void do_popmark ARGS((void));
  352. void do_swapmark ARGS((void));
  353. void do_purgemark ARGS((void));
  354. void do_ping ARGS((void));
  355. void do_pong ARGS((void));
  356. void do_undo ARGS((void));
  357.  
  358. /* Prototypes for functions defined in refs.c */
  359. void do_addpath ARGS((void));
  360. void do_rempath ARGS((void));
  361. void do_ctags ARGS((void));
  362. void do_refs ARGS((void));
  363. int searchref ARGS((char *, char *, char **, char **, int *, char **));
  364. int dirpart ARGS((char *));
  365.  
  366. /* Prototypes for functions defined in rexx.c */
  367. void openrexx ARGS((void));
  368. void closerexx ARGS((void));
  369. void do_rx ARGS((void));
  370. void do_rx1 ARGS((void));
  371. void do_rx2 ARGS((void));
  372. void do_rxImplied ARGS((char *, char *));
  373. int do_rexx ARGS((char *));
  374.  
  375. /* Prototypes for functions defined in subs.c */
  376. void makemygadget ARGS((struct Gadget *));
  377. int firstns ARGS((char *));
  378. int lastns ARGS((char *));
  379. int wordlen ARGS((char *));
  380. int getpathto ARGS((char *, char *));
  381. void *allocb ARGS((int));
  382. void *allocl ARGS((int));
  383. void bmovl ARGS((void *, void *, long));
  384. int detab ARGS((char *, char *, int));
  385. int xefgets ARGS((void *, char *, int));
  386. int ncstrcmp ARGS((unsigned char *, unsigned char *));
  387. struct _ED *finded ARGS((char *, int));
  388.  
  389. extern __stdargs int arpreq ARGS((char *, char *, char *, WIN *));
  390.  
  391.