home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / misc / xref_v1.1.lha / XRef / Help / include / libraries / xref.h < prev   
Encoding:
C/C++ Source or Header  |  1995-01-30  |  16.4 KB  |  353 lines

  1. @database libraries/xref.h
  2. @master libraries/xref.h
  3. @node main "libraries/xref.h"
  4. @toc xref.library_xreffile@main
  5. #ifndef @{"LIBRARIES_XREF_H" link "main" 2}
  6. #define @{b}LIBRARIES_XREF_H@{ub}
  7. /* xref.library
  8. **
  9. ** $VER: xref.h 1.10 (22.09.94) 
  10. **
  11. ** by
  12. **
  13. ** Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  14. **
  15. ** (C) Copyright 1994
  16. ** All Rights Reserved !
  17. **
  18. */
  19.  
  20. #ifndef @{"UTILITY_TAGITEM_H" link "AG:SysInc/utility/tagitem.h/main" 2}
  21. #include <@{"utility/tagitem.h" link "AG:SysInc/utility/tagitem.h/main"}>
  22. #endif
  23.  
  24. struct @{b}XRefFileNode@{ub}
  25. {
  26.    /* node to link all xreffile into a list !
  27.     * Note ln_Name and ln_Pri are valid for now, but please use the
  28.     * appropriate set/get calls to read or manipulate it. But you can
  29.     * use this node to display the name in a gadtools listview.
  30.     */
  31.    struct @{"Node" link "AG:SysInc/exec/nodes.h/main" 22} xrfn_Node;
  32.  
  33.    /* data beyond this point are strictly private !!! */
  34. };
  35.  
  36. /* handle for xreffile creation functions !!! */
  37.  
  38. struct @{b}XRefFileHandle@{ub}
  39. {
  40.    void *xrfh_PRIVATE;
  41. };
  42.  
  43. /* ------------------------- type of a given @{"XRef" link "AG:SysInc/libraries/amigaguide.h/main" 146} ------------------------- */
  44.  
  45. /* Note : the following defines are compatible with the amigaguide xref 
  46.  *        defines. For future it is planed to make a tool , that converts
  47.  *        amigaguide xref files to xref.library xref files !
  48.  */
  49.  
  50. /* cross reference types */
  51.  
  52. #define @{b}XREFT_GENERIC@{ub}          0     /* a amigaguide node name */
  53. #define @{b}XREFT_FUNCTION@{ub}         1     /* a library function name */
  54. #define @{b}XREFT_COMMAND@{ub}          2     /* a device command name */
  55. #define @{b}XREFT_INCLUDE@{ub}          3     /* a include file name */
  56. #define @{b}XREFT_MACRO@{ub}            4     /* a macro defiiniton name */
  57. #define @{b}XREFT_STRUCT@{ub}           5     /* a structure definition name */
  58. #define @{b}XREFT_FIELD@{ub}            6     /* a structure field name */
  59. #define @{b}XREFT_TYPEDEF@{ub}          7     /* a type definition name */
  60. #define @{b}XREFT_DEFINE@{ub}           8     /* a simple define name */
  61.  
  62. #define @{b}XREFT_MAXTYPES@{ub}         9     /* max number of types internal use */
  63.  
  64. #define @{b}XREFT_USER@{ub}             63    /* indicate, that this is a user defined
  65.                                       * xrefentry ! This can only be parsed
  66.                                       * with a @{"XREFA_CustomHook" link "main" 95} !
  67.                                       */
  68.  
  69. /* ------------------- tags for all xref.library calls -------------------- */
  70.  
  71. /* the letters in the parenthesis have the following meaning :
  72.  *
  73.  * C - can be used by a call to @{"CreateXRefFileA()" link "xref/CreateXRefFileA()"}
  74.  * L - can be used by a call to @{"XR_LoadXRef()" link "xref/XR_LoadXRef()"}
  75.  * @{"E" link "AG:SysInc/libraries/mathffp.h/main" 20} - can be used by a call to @{"XR_ExpungeXRef()" link "xref/XR_ExpungeXRef()"}
  76.  * G - can be used by a call to @{"GetXRefFileAttrsA()" link "xref/GetXRefFileAttrsA()"}
  77.  * S - can be used by a call to @{"SetXRefFileAttrsA()" link "xref/SetXRefFileAttrsA()"}
  78.  * P - can be used by a call to @{"ParseXRef()" link "xref/ParseXRef()"}
  79.  * M - can be in the PM_XREF message attribute list
  80.  */
  81.  
  82. #define @{b}XREFA_Base@{ub}      (@{"TAG_USER" link "AG:SysInc/utility/tagitem.h/main" 48} + 0x11000)
  83.  
  84. #define @{b}XREFA_Lock@{ub}      (@{"XREFA_Base" link "main" 78} + 0x01)
  85.                         /* (LEGS) (ULONG)
  86.                          * one of two possible values
  87.                          * @{"XREF_LOCK" link "main" 234} : locks this xref this isn't free'd
  88.                          *     during a memory flush
  89.                          *
  90.                          * @{"XREF_UNLOCK" link "main" 229} : unlocks a locked xref file
  91.                          */
  92.  
  93. #define @{b}XREFA_Category@{ub}  (@{"XREFA_Base" link "main" 78} + 0x02)
  94.                         /* (CLEGP) (STRPTR) category for a xref file */
  95.  
  96. #define @{b}XREFA_Priority@{ub}  (@{"XREFA_Base" link "main" 78} + 0x03)
  97.                         /* (CLGS) (BYTE) priority of a xref memory node */
  98.  
  99. #define @{b}XREFA_CustomHook@{ub} (@{"XREFA_Base" link "main" 78} + 0x04)
  100.                         /* (LS) (struct @{"Hook" link "AG:SysInc/utility/hooks.h/main" 28} *) callback function to handle
  101.                          * @{"XREFT_USER" link "main" 60} xrefentries !
  102.                          * Not implemented yet !
  103.                          */
  104.  
  105. #define @{b}XREFA_XRefHook@{ub}  (@{"XREFA_Base" link "main" 78} + 0x05)
  106.                         /* (LEP) (struct @{"Hook" link "AG:SysInc/utility/hooks.h/main" 28} *) hook function, which is called,
  107.                          * for expunging or loading a xreffile. Or if a xrefentry
  108.                          * matches the given pattern in @{"ParseXRef()" link "xref/ParseXRef()"}.
  109.                          * This tag is @{fg highlight}REQUIRED@{fg text} for the @{"ParseXRef()" link "xref/ParseXRef()"} call.
  110.                          */
  111.  
  112. #define @{b}XREFA_Matching@{ub}  (@{"XREFA_Base" link "main" 78} + 0x06)
  113.                         /* (P) (ULONG) matching mode for @{"ParseXRef()" link "xref/ParseXRef()"} see
  114.                          * XREFMATCH_#? below
  115.                          */
  116.  
  117. #define @{b}XREFA_Limit@{ub}     (@{"XREFA_Base" link "main" 78} + 0x07)
  118.                         /* (P) (ULONG) maximale number of matching xref 
  119.                          * entries
  120.                          */
  121.  
  122. #define @{b}XREFA_File@{ub}      (@{"XREFA_Base" link "main" 78} + 0x08)
  123.                         /* (CLEP) (STRPTR) complete filename for the xref file
  124.                          * to load or change attributes (comparison with @{"Lock()" link "dos/Lock()"})
  125.                          */
  126.  
  127. #define @{b}XREFA_Name@{ub}      (@{"XREFA_Base" link "main" 78} + 0x09)
  128.                         /* (CLEGM) (STRPTR) name of the xref file, use this name
  129.                          * instead of the filename
  130.                          */
  131.  
  132. #define @{b}XREFA_VersTag@{ub}   (@{"XREFA_Base" link "main" 78} + 0x0A)
  133.                         /* (CG) (ULONG) AmigaDOS version string for the
  134.                          * xreffile
  135.                          */
  136.  
  137. #define @{b}XREFA_Author@{ub}    (@{"XREFA_Base" link "main" 78} + 0x0B)
  138.                         /* (CG) Author of xref file */
  139.  
  140. #define @{b}XREFA_Path@{ub}      (@{"XREFA_Base" link "main" 78} + 0x0C)
  141.                         /* (CGM) global path of xref file */
  142.  
  143. #define @{b}XREFA_Index@{ub}     (@{"XREFA_Base" link "main" 78} + 0x0D)
  144.                         /* (LGS) (BOOL) if @{"TRUE" link "AG:SysInc/exec/types.h/main" 73}, tries to create an index
  145.                          * array to get fast access to all entries. Otherwise
  146.                          * it removes all memory used by the array.
  147.                          * If the array is successfully allocated each
  148.                          * @{"ParseXRef()" link "xref/ParseXRef()"} uses a binary search algorithm !!!
  149.                          */
  150.  
  151. #define @{b}XREFA_Length@{ub}    (@{"XREFA_Base" link "main" 78} + 0x0E)
  152.                         /* (G) (ULONG) returns the number of bytes allocated
  153.                          * for this xreffile !
  154.                          */
  155.  
  156. #define @{b}XREFA_RejectTypes@{ub} (@{"XREFA_Base" link "main" 78} + 0x0F)
  157.                         /* (P) (ULONG *) ~0 terminated array of types, which
  158.                          * should not be used. Thus you can exclude some xref-
  159.                          * types (such as @{"XREFT_TYPEDEF" link "main" 55} perhaps).
  160.                          */
  161.  
  162. #define @{b}XREFA_AcceptTypes@{ub} (@{"XREFA_Base" link "main" 78} + 0x10)
  163.                         /* (P) (ULONG *) ~0 terminated array of types, which
  164.                          * should be used explicitly. If this tag isn't set
  165.                          * all types are used !
  166.                          */
  167.  
  168. #define @{b}XREFA_CategoryParsed@{ub} (@{"XREFA_Base" link "main" 78} + 0x11)
  169.                         /* (P) (STRPTR) pointer to an tokenized pattern
  170.                          * string after using @{"ParsePattern()" link "dos/ParsePattern()"}. If you call
  171.                          * the @{"ParseXRef()" link "xref/ParseXRef()"} function a lot with the same
  172.                          * pattern you can @{"ParsePattern()" link "dos/ParsePattern()"} before and call
  173.                          * with this tag. This will speed up the parsing !
  174.                          */
  175.  
  176. #define @{b}XREFA_AutoLoad@{ub}     (@{"XREFA_Base" link "main" 78} + 0x12)
  177.                         /* (P) (BOOL) enables (@{"TRUE" link "AG:SysInc/exec/types.h/main" 73}) , disables (@{"FALSE" link "AG:SysInc/exec/types.h/main" 76}) 
  178.                          * the autoload mechanism
  179.                          */
  180.  
  181. /* tags for the @{"WriteXRefFileEntry()" link "xref/WriteXRefFileEntryA()"} function and in the PM_XREF
  182.  * attribute list
  183.  */
  184.  
  185. #define @{b}ENTRYA_Base@{ub}     (@{"TAG_USER" link "AG:SysInc/utility/tagitem.h/main" 48} + 0x12000)
  186.  
  187. #define @{b}ENTRYA_Type@{ub}     (@{"ENTRYA_Base" link "main" 181} + 0x01)
  188.                         /* (ULONG) type of the entry */
  189.  
  190. #define @{b}ENTRYA_File@{ub}     (@{"ENTRYA_Base" link "main" 181} + 0x02)
  191.                         /* (STRPTR) file, in which the entry resides */
  192.  
  193. #define @{b}ENTRYA_Name@{ub}     (@{"ENTRYA_Base" link "main" 181} + 0x03)
  194.                         /* (STRPTR) name of the entry */
  195.  
  196. #define @{b}ENTRYA_Line@{ub}     (@{"ENTRYA_Base" link "main" 181} + 0x04)
  197.                         /* line of the entry */
  198.  
  199. #define @{b}ENTRYA_NodeName@{ub} (@{"ENTRYA_Base" link "main" 181} + 0x05)
  200.                         /* name of the amigaguide node in the @{"ENTRYA_File" link "main" 186} */
  201.  
  202. #define @{b}ENTRYA_CheckMode@{ub} (@{"ENTRYA_Base" link "main" 181} + 0x06)
  203.                         /* one of the ENTRYCHECK_#? modes
  204.                          * default is : @{"ENTRYCHECK_NAME" link "main" 204} 
  205.                          */
  206.  
  207. #define @{b}ENTRYCHECK_NONE@{ub} 0
  208. #define @{b}ENTRYCHECK_NAME@{ub} 1
  209. #define @{b}ENTRYCHECK_FILE@{ub} 2
  210.  
  211. /* --------- modes for the XRefParse function (@{"XREFA_Matching" link "main" 108} tag)--------- */
  212.  
  213. #define @{b}XREFMATCH_PATTERN_CASE@{ub}       0 
  214.                         /* matching done with
  215.                          * @{"ParsePattern()" link "dos/ParsePattern()"}/@{"MatchPattern()" link "dos/MatchPattern()"}
  216.                          */
  217. #define @{b}XREFMATCH_PATTERN_NOCASE@{ub}     1
  218.                         /* matching done with
  219.                          * @{"ParsePatternNoCase()" link "dos/ParsePatternNoCase()"}/@{"MatchPatternNoCase()" link "dos/MatchPatternNoCase()"}
  220.                          */
  221. #define @{b}XREFMATCH_COMPARE_CASE@{ub}       2
  222.                         /* compare with strcmp() */
  223. #define @{b}XREFMATCH_COMPARE_NOCASE@{ub}     3
  224.                         /* compare with @{"Stricmp()" link "utility/Stricmp()"} */
  225. #define @{b}XREFMATCH_COMPARE_NUM_CASE@{ub}   4
  226.                         /* compare with strncmp(string,xrefentry,strlen(string)) */
  227. #define @{b}XREFMATCH_COMPARE_NUM_NOCASE@{ub} 5
  228.                         /* compare with @{"Strnicmp" link "utility/Strnicmp()"}(string,xrefentry,strlen(string)) */
  229.  
  230.  
  231. /* ------------------------ values for @{"XREFA_Lock" link "main" 80} ------------------------- */
  232.  
  233. #define @{b}XREF_UNLOCK@{ub}                  0
  234.                         /* a xref is unlocked, if a memory flush occurs
  235.                          * all xref nodes with @{"XREF_UNLOCK" link "main" 229} set are flushed
  236.                          */
  237.  
  238. #define @{b}XREF_LOCK@{ub}                    1
  239.                         /* a xref is locked, can't be free'd during memory
  240.                          * flush or a normal XRefExpunge. It must be free'd
  241.                          * with XRefExpunge set the @{"XREFA_Lock" link "main" 80} attribute to
  242.                          * @{"XREF_UNLOCK" link "main" 229} !
  243.                          */
  244.  
  245. /* -------------------- global xref.library attributes -------------------- */
  246.  
  247. /* tags for the @{"GetXRefBaseAttrsA()" link "xref/GetXRefBaseAttrsA()"} and @{"SetXRefBaseAttrsA()" link "xref/SetXRefBaseAttrsA()"} call
  248.  * the letters in the parenthesis means :
  249.  * G - available for the @{"GetXRefBaseAttrsA()" link "xref/GetXRefBaseAttrsA()"} call
  250.  * S - availbale for the @{"SetXRefBaseAttrsA()" link "xref/SetXRefBaseAttrsA()"} call
  251.  *
  252.  */
  253.  
  254. #define @{b}XREFBA_Base@{ub}               (@{"TAG_USER" link "AG:SysInc/utility/tagitem.h/main" 48} + 0x12000)
  255.  
  256. #define @{b}XREFBA_List@{ub}               (@{"XREFBA_Base" link "main" 250} + 0x01)
  257.                         /* (G) (struct @{"List" link "AG:SysInc/exec/lists.h/main" 20} *)
  258.                          * returns a pointer of the global xreffiles list.
  259.                          * Ths list contains all xreffiles in memory with
  260.                          * (struct @{"XRefFileNode" link "main" 20} *) declared above.
  261.                          * Note you must lock the base if you step through
  262.                          * the list !! The entries in the list are private !!
  263.                          * You can get information about the Nodes with the
  264.                          * @{"GetXRefFileAttrsA()" link "xref/GetXRefFileAttrsA()"} call.
  265.                          * Only the name and pri field of the @{"Node" link "AG:SysInc/exec/nodes.h/main" 22} are valid.
  266.                          */
  267.  
  268. #define @{b}XREFBA_LineLength@{ub}         (@{"XREFBA_Base" link "main" 250} + 0x02)
  269.                         /* (GS) (UWORD)
  270.                          * number of characters for a line in the dynamic
  271.                          * node.
  272.                          */
  273.  
  274. #define @{b}XREFBA_Columns@{ub}            (@{"XREFBA_Base" link "main" 250} + 0x03)
  275.                         /* (GS) (UWORD)
  276.                          * number of columns for the dynamic node to use
  277.                          */
  278.  
  279. #define @{b}XREFBA_DefaultLimit@{ub}       (@{"XREFBA_Base" link "main" 250} + 0x04)
  280.                         /* (GS) (ULONG)
  281.                          * default maximal number of xref entries for the
  282.                          * @{"ParseXRef()" link "xref/ParseXRef()"} function. This value will be over-
  283.                          * written, if the tag @{"XREFA_Limit" link "main" 113} is specified
  284.                          * for the @{"ParseXRef()" link "xref/ParseXRef()"} call.
  285.                          */
  286.  
  287. #define @{b}XREFBA_XRefDir@{ub}            (@{"XREFBA_Base" link "main" 250} + 0x05)
  288.                         /* (GS) (STRPTR)
  289.                          * the dir to hold all xref files. This dir is used to
  290.                          * create or open a xref file.If a xref file should be
  291.                          * created via the @{"CreateXRefFileA()" link "xref/CreateXRefFileA()"} call,this call
  292.                          * tries to create the file in <@{"XREFBA_XRefDir" link "main" 283}> by
  293.                          * using this directory as the current directory. Thus
  294.                          * you have to specify only the filename!
  295.                          */
  296.  
  297. /* ------------------------------- ParseMsg ------------------------------- */
  298.  
  299. #define @{b}XRM_XREF@{ub}           1
  300. #define @{b}XRM_CUSTOMXREF@{ub}     2
  301. #define @{b}XRM_EXPUNGE@{ub}        3
  302. #define @{b}XRM_LOAD@{ub}           4
  303.  
  304. /* the hook is called in the standard AmigaOS 2.0 way.See utility/hook.h
  305.  * for more detail !
  306.  *
  307.  * For all Messages the object is a pointer to an @{"XRefFileNode" link "main" 20} structure :
  308.  * (struct @{"XRefFileNode" link "main" 20} *) !
  309.  */
  310.  
  311. /* @{"XRM_XREF" link "main" 295} */
  312. struct @{b}xrmXRef@{ub}
  313. {
  314.    ULONG Msg;                 /* message for the CallBack @{"Hook" link "AG:SysInc/utility/hooks.h/main" 28} , only XRM_#?
  315.                                * are defined at the moment
  316.                                */
  317.  
  318.    struct @{"TagItem" link "AG:SysInc/utility/tagitem.h/main" 32} *xref_Attrs; /* attributes of the xref entry */
  319. };
  320.  
  321. /* @{"XRM_CUSTOMXREF" link "main" 296} */
  322. struct @{b}xrmCustomXRef@{ub}
  323. {
  324.    ULONG Msg;
  325.    APTR  XRefEntry;           /* pointer to the custom xrefentry, if you return
  326.                                * from the hook with @{"TRUE" link "AG:SysInc/exec/types.h/main" 73}, you must provide here
  327.                                * the pointer to the next entry !
  328.                                * If you return with @{"FALSE" link "AG:SysInc/exec/types.h/main" 76}, the parsing is
  329.                                * aborted !
  330.                                */
  331. };
  332.  
  333. /* @{"XRM_EXPUNGE" link "main" 297} */
  334. struct @{b}xrmExpunge@{ub}
  335. {
  336.    ULONG Msg;
  337.  
  338.    struct @{"TagItem" link "AG:SysInc/utility/tagitem.h/main" 32} *exp_Attrs;
  339. };
  340.  
  341. /* @{"XRM_LOAD" link "main" 298} */
  342. struct @{b}xrmLoad@{ub}
  343. {
  344.    ULONG Msg;
  345.  
  346.    struct @{"TagItem" link "AG:SysInc/utility/tagitem.h/main" 32} *l_Attrs;
  347. };
  348.  
  349. #endif /* @{"LIBRARIES_XREF_H" link "main" 2} */
  350.  
  351.  
  352. @endnode
  353.