home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 5 / CD_Magazyn_EXEC_nr_5.iso / Programy / Programowanie / FetchRefs2.1.lha / FetchRefs2.1 / Source / GenerateIndex / GenerateIndex.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-28  |  3.8 KB  |  205 lines

  1. /* Official Amiga libraries */
  2. #define __USE_SYSBASE
  3. #include <proto/amigaguide.h>
  4. #include <proto/dos.h>
  5. #include <proto/exec.h>
  6. #include <proto/gadtools.h>
  7. #include <proto/graphics.h>
  8. #include <proto/icon.h>
  9. #include <proto/intuition.h>
  10. #include <proto/reqtools.h>
  11. #include <proto/utility.h>
  12. #include <clib/alib_protos.h>
  13.  
  14. #include <proto/reqtools.h>
  15. #include <proto/sortlist.h>
  16. #include <pragmas/locale_pragmas.h>
  17. #include <proto/gtlayout_protos.h>
  18. #include <pragmas/gtlayout_pragmas.h>
  19. #include <libraries/gtlayout.h>
  20. #include <libraries/reqtools.h>
  21.  
  22. /* Misc stuff */
  23. #include <exec/memory.h>
  24. #include <workbench/startup.h>
  25.  
  26. #include <ctype.h>
  27. #include <stdarg.h>
  28. #include <stdio.h>
  29. #include <stdlib.h>
  30. #include <string.h>
  31.  
  32. #include "protos.h"
  33.  
  34. #define VERSION "2.0"
  35. #define DATE __AMIGADATE__
  36.  
  37. /* Error value passed to CloseAll() when a custom text is passed */
  38. #define ERROR_CUSTOM 1
  39.  
  40. extern struct List FileList, EmptyList;
  41. extern struct rtFileRequester *DataFileReq;
  42.  
  43. extern UBYTE DataName[256];
  44. extern BOOL FileChanged;
  45.  
  46. enum FileTypes { FILE_UNKNOWN, FILE_AUTODOC, FILE_C, FILE_E, FILE_ASM,
  47.     FILE_EMODULE, FILE_AMIGAGUIDE };
  48.  
  49. /* This is just a number; structs are allocated depending on actual length */
  50. #define MAX_STRING_LENGTH 50000
  51.  
  52. struct FileEntry {
  53.     union {
  54.  
  55.     /* This structure contains special data only needed when saved.
  56.      * Upon loading it is replaced by the linking Node structure.
  57.      */
  58.     struct {
  59.         LONG NodeSize;
  60.     } savedata;
  61.  
  62.     struct Node node;
  63.     };
  64.  
  65.     union {
  66.     char FileData[1];      /* Just for referencing - never used */
  67.  
  68.     /* The real data, pointed to by FileData */
  69.     struct {
  70.         struct List RefsList;
  71.         UBYTE Name[MAX_STRING_LENGTH];
  72.     } data;
  73.     };
  74.  
  75. };
  76.  
  77. /* This structure is used to read files in memory (FileEntry headers) */
  78. struct File_Entry {
  79.     union {
  80.     long NodeSize;
  81.     struct Node node;
  82.     };
  83. };
  84.  
  85. #define sizeofFileEntry (sizeof(struct FileEntry) - MAX_STRING_LENGTH)
  86.  
  87. struct RefsEntry {
  88.    union {
  89.        struct {
  90.        LONG NodeSize;
  91.        } savedata;
  92.  
  93.        struct Node node;
  94.    };
  95.  
  96.    union {
  97.        char RefsData[1];    /* Just for referencing the real data */
  98.  
  99.        /* This is the real data */
  100.        struct {
  101.         LONG Offset;
  102.         LONG Length;
  103.         WORD Goto;
  104.         UBYTE Name[MAX_STRING_LENGTH];
  105.     } data;
  106.     };
  107. };
  108. #define sizeofRefsEntry (sizeof(struct RefsEntry) - MAX_STRING_LENGTH)
  109.  
  110. /// Settings struct
  111. struct Prefs {
  112.     struct {
  113.     BYTE Active;
  114.     } AutoDocPrf;
  115.  
  116.     struct {
  117.     BYTE Active;
  118.     BYTE Define;
  119.     BYTE Struct;
  120.     BYTE Typedef;
  121.     } CPrf;
  122.  
  123.     struct {
  124.     BYTE Active;
  125.     BYTE Const;
  126.     BYTE Object;
  127.     BYTE Proc;
  128.     } EPrf;
  129.  
  130.     struct {
  131.     BYTE Active;
  132.     BYTE Equ;
  133.     BYTE Structure;
  134.     BYTE Macro;
  135.     } AsmPrf;
  136.  
  137.     BYTE Recursively;
  138.     BYTE KeepEmpty;
  139.     BYTE UnknownAsAutoDoc;
  140. };
  141. extern struct Prefs Settings;
  142. ///
  143.  
  144. /// Triton IDs
  145. enum {
  146.     WINDOW_MAIN_ID = 1,
  147.     WINDOW_REF_ID,
  148.     WINDOW_OPTIONS_ID,
  149.     WINDOW_SCANSTAT_ID,
  150.  
  151.     MAIN_MENU_PROJECT_CLEAR,
  152.     MAIN_MENU_PROJECT_LOAD,
  153.     MAIN_MENU_PROJECT_SAVE,
  154.     MAIN_MENU_PROJECT_ABOUT,
  155.     MAIN_MENU_PROJECT_QUIT,
  156.  
  157.     MAIN_LIST_ID,
  158.     MAIN_REFERENCES_ID,
  159.     MAIN_OPENREFWINDOW_ID,
  160.     MAIN_SCAN_ID,
  161.     MAIN_DELETE_ID,
  162.     MAIN_OPTIONS_ID,
  163.     MAIN_RESCAN_ID,
  164.     MAIN_RESCANALL_ID,
  165.  
  166.     REF_LIST_ID,
  167.     REF_FILE_ID,
  168.     REF_OFFSET_ID,
  169.     REF_LENGTH_ID,
  170.     REF_GOTO_ID,
  171.     REF_DELETE_ID,
  172.  
  173.     OPTIONS_MENU_PROJECT_OPEN_ID,
  174.     OPTIONS_MENU_PROJECT_SAVEAS_ID,
  175.     OPTIONS_MENU_PROJECT_LASTSAVED_ID,
  176.  
  177.     OPTIONS_AUTODOC_ID,
  178.  
  179.     OPTIONS_C_ID,
  180.     OPTIONS_C_DEFINE_ID,
  181.     OPTIONS_C_STRUCT_ID,
  182.     OPTIONS_C_TYPEDEF_ID,
  183.  
  184.     OPTIONS_E_ID,
  185.     OPTIONS_E_CONST_ID,
  186.     OPTIONS_E_OBJECT_ID,
  187.     OPTIONS_E_PROC_ID,
  188.  
  189.     OPTIONS_ASM_ID,
  190.     OPTIONS_ASM_EQU_ID,
  191.     OPTIONS_ASM_STRUCTURE_ID,
  192.     OPTIONS_ASM_MACRO_ID,
  193.  
  194.     OPTIONS_RECURSIVELY_ID,
  195.     OPTIONS_KEEPEMPTY_ID,
  196.     OPTIONS_UNKNOWNASAUTODOC_ID,
  197.  
  198.     OPTIONS_SAVE_ID,
  199.     OPTIONS_USE_ID,
  200.     OPTIONS_CANCEL_ID,
  201.  
  202.     SCANSTAT_STOP_ID,
  203. };
  204. ///
  205.