source: trunk/emx/include/sys/omflib.h@ 3809

Last change on this file since 3809 was 3659, checked in by bird, 15 years ago

emx: Added elf headers and fixed some properties.

  • Property cvs2svn:cvs-rev set to 1.7
  • Property svn:eol-style set to native
File size: 5.2 KB
Line 
1/* sys/omflib.h (emx+gcc) */
2
3/* Public header file for the emx OMFLIB library. */
4
5#ifndef _SYS_OMFLIB_H
6#define _SYS_OMFLIB_H
7
8#if defined (__cplusplus)
9extern "C" {
10#endif
11
12#ifndef _BYTE_WORD_DWORD
13#define _BYTE_WORD_DWORD
14typedef unsigned char byte;
15typedef unsigned short word;
16typedef unsigned long dword;
17#endif /* _BYTE_WORD_DWORD */
18
19#if !defined (THEADR)
20
21/* OMF record types. To get the 32-bit variant of a record type, add
22 REC32. */
23#define THEADR 0x80 /* Translator module header record */
24#define COMENT 0x88 /* Comment record */
25#define MODEND 0x8a /* Module end record */
26#define EXTDEF 0x8c /* External names definition record */
27#define TYPDEF 0x8e /* Type definition record */
28#define PUBDEF 0x90 /* Public names definition record */
29#define LINNUM 0x94 /* Line numbers record */
30#define LNAMES 0x96 /* List of names record */
31#define SEGDEF 0x98 /* Segment definition record */
32#define GRPDEF 0x9a /* Group definition record */
33#define FIXUPP 0x9c /* Fixup record */
34#define LEDATA 0xa0 /* Logical enumerated data record */
35#define LIDATA 0xa2 /* Logical iterated data record */
36#define COMDEF 0xb0 /* Communal names definition record */
37#define COMDEF_TYPEFAR 0x61 /* Commnual name type: far */
38#define COMDEF_TYPENEAR 0x62 /* Commnual name type: near */
39#define LPUBDEF 0xb6 /* Local public names defintion record. */
40#define COMDAT 0xc2 /* Common block */
41#define ALIAS 0xc6 /* Alias definition record */
42#define LIBHDR 0xf0 /* Library header */
43#define LIBEND 0xf1 /* Library end */
44
45/* Add this constant (using the | operator) to get the 32-bit variant
46 of a record type. Some fields will contain 32-bit values instead
47 of 16-bit values. */
48#define REC32 0x01
49
50#endif
51
52/* Comment classes */
53#define CLASS_TRANS 0x00 /* Translators - MSC v6. */
54#define CLASS_INTELC 0x01 /* Intel Copryight */
55#define CLASS_MSDOSVER 0x9c /* MS-DOS version - obsolete */
56#define CLASS_MODEL 0x9d /* Memory model - for the Xenix linker. */
57#define CLASS_DOSSEG 0x9e /* Linker DOSSEG switch. */
58#define CLASS_DEFLIB 0x9f /* Default library. */
59#define CLASS_OMFEXT 0xa0 /* OMF extenstions */
60#define OMFEXT_IMPDEF 0x01
61#define OMFEXT_EXPDEF 0x02
62#define OMFEXT_INCDEF 0x03
63#define OMFEXT_PROTLIB 0x04
64#define OMFEXT_LNKDIR 0x05
65#define CLASS_DBGTYPE 0xa1 /* Debug type */
66#define CLASS_PASS 0xa2 /* End of linker pass 1. */
67#define CLASS_LIBMOD 0xa3 /* Library module comment. */
68#define CLASS_EXESTR 0xa4 /* Executable Module Identification String. */
69#define CLASS_INCERR 0xa6 /* Incremental compilation error. */
70#define CLASS_NOPAD 0xa7 /* No segment padding. */
71#define CLASS_WKEXT 0xa8 /* Weak external. */
72#define CLASS_LZEXT 0xa9 /* Lazy external. */
73#define CLASS_PHARLAP 0xaa /* PharLap Format record. */
74#define CLASS_IPADATA 0xae /* Interprocedural Analysis Data record. */
75#define CLASS_TIS 0xac /* TIS standard level? 'TIS' + version word. */
76#define CLASS_DBGPACK 0xad /* /DBGPACK DLL name for ilink. */
77#define CLASS_IDMDLL 0xaf /* Identifier Manipulator Dynamic Link Library. */
78#define CLASS_DEP_FILE 0xe9 /* Borland/Watcom file dependency record. */
79
80
81#if !defined (IMPDEF_CLASS)
82#define IMPDEF_CLASS CLASS_OMFEXT
83#define LIBMOD_CLASS 0xa3
84#define IMPDEF_SUBTYPE OMFEXT_IMPDEF
85#endif
86
87struct omflib;
88
89struct omflib *omflib_open (const char *fname, char *error);
90struct omflib *omflib_create (const char *fname, int page_size, char *error);
91int omflib_close (struct omflib *p, char *error);
92int omflib_module_name (char *dst, const char *src);
93int omflib_find_module (struct omflib *p, const char *name, char *error);
94int omflib_mark_deleted (struct omflib *p, const char *name, char *error);
95int omflib_pubdef_walk (struct omflib *p, word page,
96 int (*walker)(const char *name, char *error), char *error);
97int omflib_extract (struct omflib *p, const char *name, char *error);
98int omflib_add_module (struct omflib *p, const char *fname, char *error);
99int omflib_module_count (struct omflib *p, char *error);
100int omflib_module_info (struct omflib *p, int n, char *name, int *page,
101 char *error);
102int omflib_copy_lib (struct omflib *dst, struct omflib *src, char *error);
103int omflib_finish (struct omflib *p, char *error);
104int omflib_write_record (struct omflib *p, byte rec_type, word rec_len,
105 const byte *buffer, int chksum, char *error);
106int omflib_write_module (struct omflib *p, const char *name, word *pagep,
107 char *error);
108int omflib_add_pub (struct omflib *p, const char *name, word page,
109 char *error);
110int omflib_header (struct omflib *p, char *error);
111int omflib_find_symbol (struct omflib *p, const char *name, char *error);
112long omflib_page_pos (struct omflib *p, int page);
113
114#if defined (__cplusplus)
115}
116#endif
117
118#endif /* not _SYS_OMFLIB_H */
Note: See TracBrowser for help on using the repository browser.