* link/z80/lkmain.c,
[fw/sdcc] / link / z80 / aslink.h
index 47a03a482f4b3dce6c856f173c672a4ed139695d..fabdb1c3631894744ed20b44cc336346a2c4ba01 100644 (file)
 /*
  * Extensions: P. Felber
  */
+#include <limits.h>
+
+#ifndef PATH_MAX
+ #if defined(__BORLANDC__) || defined(_MSC_VER)
+  #include <stdlib.h>
+  #define PATH_MAX     _MAX_PATH
+ #else
+  #define PATH_MAX     255     /* define a reasonable value */
+ #endif
+#endif
 
 #define        VERSION "V01.75"
 
  */
 
 #ifdef SDK
-#define        NCPS    32              /* characters per symbol */
+#define        NCPS    80              /* characters per symbol.  Used to be 32... */
 #else /* SDK */
 #define        NCPS    8               /* characters per symbol */
 #endif /* SDK */
 /* #define     NCPS    32 */   /* characters per symbol */
 #define        NDATA   16              /* actual data */
-#define        NINPUT  128             /* Input buffer size */
+#define        NINPUT  PATH_MAX        /* Input buffer size */
 #define        NHASH   64              /* Buckets in hash table */
 #define        HMASK   077             /* Hash mask */
 #define        NLPP    60              /* Lines per page */
 #define        NTXT    16              /* T values */
-/** PENDING: Taking this to 256 causes a segfault. */
-#define        FILSPC  100             /* File spec length */
+#define        FILSPC  PATH_MAX        /* File spec length */
 
 /*
  *     The "R_" relocation constants define values used in
 /*
  * File types
  */
+#define F_INV  0               /* invalid */
 #define        F_STD   1               /* stdin */
 #define        F_LNK   2               /* File.lnk */
 #define        F_REL   3               /* File.rel */
@@ -416,6 +426,7 @@ struct lbfile {
        char            *libspc;
        char            *relfil;
        char            *filspc;
+    long               offset; /*>=0 if rel file is embedded in a lib file at this offset*/
 };
 
 /*
@@ -437,10 +448,14 @@ extern    char    *rp;            /*      pointer into the LST file
 extern char    rb[NINPUT];     /*      LST file text line being
                                 *      address relocated
                                 */
-extern char    ctype[];        /*      array of character types, one per
+extern unsigned char   ctype[];        /*      array of character types, one per
                                 *      ASCII character
                                 */
 
+extern char sdccopt[NINPUT];
+extern char sdccopt_module[NINPUT];
+extern char curr_module[NINPUT];
+
 /*
  *     Character Type Definitions
  */
@@ -470,7 +485,7 @@ extern      char    ccase[];        /*      an array of characters which
 extern struct  lfile   *filep; /*      The pointers (lfile *) filep,
                                 *      (lfile *) cfp, and (FILE *) sfp
                                 *      are used in conjunction with
-                                *      the routine getline() to read
+                                *      the routine lk_getline() to read
                                 *      asmlnk commands from
                                 *      (1) the standard input or
                                 *      (2) or a command file
@@ -634,12 +649,13 @@ extern    char            endline();
 extern char            get();
 extern VOID            getfid();
 extern VOID            getid();
-extern int             getline();
+extern int             lk_getline();
 extern int             getmap();
 extern char            getnb();
 extern int             more();
 extern VOID            skip();
 extern VOID            unget();
+extern VOID            chop_crlf();
 
 /* lkarea.c */
 extern VOID            lkparea();
@@ -699,7 +715,7 @@ extern      VOID            erpdmp();
 extern VOID            prntval();
 
 /* lklibr.c */
-extern VOID            addfile();
+extern int             addfile();
 extern VOID            addlib();
 extern VOID            addpath();
 extern int             fndsym();
@@ -712,3 +728,8 @@ extern      VOID            s19();
 
 /* lkihx.c */
 extern VOID            ihx();
+
+/* lkgb.h */
+VOID gb(int in);
+VOID gg(int in);
+