home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / include / dld.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-15  |  3.1 KB  |  101 lines

  1. /* Error codes */
  2.  
  3. #define DLD_ENOFILE    1        /* cannot open file */
  4. #define DLD_EBADMAGIC    2        /* bad magic number */
  5. #define DLD_EBADHEADER    3        /* failure reading header */
  6. #define DLD_ENOTEXT    4        /* premature eof in text section */
  7. #define DLD_ENOSYMBOLS    5        /* premature end of file in symbols */
  8. #define DLD_ENOSTRINGS    6        /* bad string table */
  9. #define DLD_ENOTXTRELOC    7        /* premature eof in text relocation */
  10. #define DLD_ENODATA    8        /* premature eof in data section */
  11. #define DLD_ENODATRELOC    9        /* premature eof in data relocation */
  12. #define DLD_EMULTDEFS    10        /* multiple definitions of symbol */
  13. #define DLD_EBADLIBRARY    11        /* malformed library archive */
  14. #define DLD_EBADCOMMON    12        /* common block not supported */
  15. #define DLD_EBADOBJECT    13        /* malformed input file (not rel or
  16.                        archive) */
  17. #define DLD_EBADRELOC    14        /* bad relocation info */
  18. #define DLD_ENOMEMORY    15        /* virtual memory exhausted */
  19. #define DLD_EUNDEFSYM    16        /* undefined symbol */
  20.  
  21. extern int dld_errno;            /* error code returned by dld */
  22. extern int dld_undefined_sym_count; /* # of undefined global symbols */
  23. extern char* dld_last_symbol;       /* valid only if EMULTDEFS */
  24.  
  25. #ifdef __STDC__
  26. # define P(s) s
  27. #else
  28. # define P(s) ()
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. extern int
  36. dld_init P((char* path));        /* initialize the dld routines */
  37. extern int
  38. dld_link P((char* filename));        /* dynamically link and load an
  39.                        object file */
  40. extern unsigned long
  41. dld_get_symbol P((char* id));        /* return the address of the named
  42.                        identifier */
  43. extern unsigned long
  44. dld_get_func P((char* func));        /* return the address of the named
  45.                        function */
  46. extern unsigned long
  47. dld_get_bare_symbol P((char *id));  /* same as dld_get_symbol except
  48.                        that no underscore (_) is
  49.                        prepended.  Use to locate
  50.                        symbols defined by assembly
  51.                        routines. */
  52.  
  53. extern int
  54. dld_unlink_by_file P((char* path, int hard)); /* unlink a file */
  55. extern int
  56. dld_unlink_by_symbol P((char* id, int hard)); /* unlink the module
  57.                          that define the given
  58.                          symbol */
  59.  
  60. extern int
  61. dld_function_executable_p P((char* func)); /* return true if the named
  62.                           C function is executable */
  63.  
  64. extern char **
  65. dld_list_undefined_sym P((void));   /* return an array of undefined
  66.                        symbols */
  67.  
  68. extern char *
  69. dld_find_executable P((char* command));    /* return the full path name
  70.                        of the given executable
  71.                        file. */
  72.  
  73. extern int
  74. dld_create_reference P((char* name)); /* explicitly create a reference
  75.                      to the given symbol. */
  76.  
  77. extern int
  78. dld_define_sym P((char* name, unsigned int siye)); /* explicitly
  79.                               define the value
  80.                               for the given
  81.                               symbol. */
  82.  
  83. extern void
  84. dld_remove_defined_symbol P((char* name)); /* remove an explicitly
  85.                           defined symbol */
  86.  
  87. extern void
  88. dld_perror P((char* user_mesg));    /* print error messages. */
  89.  
  90. extern char
  91. *dld_strerror P((int code));        /* returns the error message */
  92.  
  93. extern void
  94. dyn_load P((char * name));        /* from gxxload.cc (c++) */
  95. extern void
  96. dyn_unload P((char * name));
  97.  
  98. #ifdef __cplusplus
  99. }
  100. #endif
  101.