--- a/as/link/hc08/Makefile.in +++ b/as/link/hc08/Makefile.in @@ -46,7 +46,7 @@ ASXXLIBSRC = strcmpi.c -LKLIBSRC = getline.c lkaomf51.c lkar.c lkdata.c lkeval.c \ +LKLIBSRC = lk_readnl.c lkaomf51.c lkar.c lkdata.c lkeval.c \ lkhead.c lklex.c lklib.c lklibr.c lklist.c \ lknoice.c lkrel.c lksdcclib.c lkstore.c lksym.c --- a/as/link/lklib.c +++ b/as/link/lklib.c @@ -31,7 +31,7 @@ #include -#include "getline.h" +#include "lk_readnl.h" #include "aslink.h" #include "lklibr.h" #include "lkrel.h" @@ -51,7 +51,7 @@ { char relfil[NINPUT]; - while (getline (relfil, sizeof (relfil), libfp) != NULL) + while (lk_readnl (relfil, sizeof (relfil), libfp) != NULL) { FILE *fp; char str[PATH_MAX]; @@ -126,7 +126,7 @@ D ("Searching symbol: %s\n", name); - while (getline (relfil, sizeof (relfil), libfp) != NULL) + while (lk_readnl (relfil, sizeof (relfil), libfp) != NULL) { char str[PATH_MAX]; FILE *fp; @@ -206,7 +206,7 @@ * * functions called: * int fclose() c_library - * char *getline() getline.c + * char *lk_readnl() lk_readnl.c * FILE * fopen() c_library * VOID link_main() lkmain.c * int strlen() c_library --- a/as/link/lksdcclib.c +++ b/as/link/lksdcclib.c @@ -32,13 +32,13 @@ #include #include -#include "getline.h" +#include "lk_readnl.h" #include "aslink.h" #include "lklibr.h" #include "lkrel.h" #define EQ(A,B) !strcmp((A),(B)) -#define MAXLINE 254 /*when using getline */ +#define MAXLINE 254 /*when using lk_readnl */ static int @@ -72,14 +72,14 @@ char str[NINPUT]; int state = 0; - while (getline (str, sizeof (str), libfp) != NULL) + while (lk_readnl (str, sizeof (str), libfp) != NULL) { switch (state) { case 0: if (EQ (str, "")) { - if (NULL != getline (str, sizeof (str), libfp) && EQ (str, ModName)) + if (NULL != lk_readnl (str, sizeof (str), libfp) && EQ (str, ModName)) state = 1; else return 0; @@ -105,7 +105,7 @@ long IndexOffset = 0; pmlibrarysymbol ThisSym = NULL; - while (getline (FLine, sizeof (FLine), libfp)) + while (lk_readnl (FLine, sizeof (FLine), libfp)) { switch (state) { @@ -113,7 +113,7 @@ if (EQ (FLine, "")) { /*The next line has the size of the index */ - getline (FLine, sizeof (FLine), libfp); + lk_readnl (FLine, sizeof (FLine), libfp); IndexOffset = atol (FLine); state = 1; } @@ -128,7 +128,7 @@ /* The next line has the name of the module and the offset of the corresponding embedded file in the library */ - getline (FLine, sizeof (FLine), libfp); + lk_readnl (FLine, sizeof (FLine), libfp); sscanf (FLine, "%s %ld", ModName, &FileOffset); state = 2; @@ -205,7 +205,7 @@ int state = 0; int ret = 0; - while (getline (str, sizeof (str), libfp) != NULL) + while (lk_readnl (str, sizeof (str), libfp) != NULL) { switch (state) { @@ -239,7 +239,7 @@ int state = 0; long IndexOffset = 0, FileOffset; - while (getline (FLine, sizeof (FLine), libfp)) + while (lk_readnl (FLine, sizeof (FLine), libfp)) { char filspc[PATH_MAX]; @@ -260,7 +260,7 @@ if (EQ (FLine, "")) { /* The next line has the size of the index */ - getline (FLine, sizeof (FLine), libfp); + lk_readnl (FLine, sizeof (FLine), libfp); IndexOffset = atol (FLine); state = 1; } @@ -271,7 +271,7 @@ { /* The next line has the name of the module and the offset of the corresponding embedded file in the library */ - getline (FLine, sizeof (FLine), libfp); + lk_readnl (FLine, sizeof (FLine), libfp); sscanf (FLine, "%s %ld", ModName, &FileOffset); state = 2; } --- a/sim/ucsim/cmd.src/newcmdposix.cc +++ b/sim/ucsim/cmd.src/newcmdposix.cc @@ -207,7 +207,7 @@ char *s= NULL; #ifdef HAVE_GETLINE - if (getline(&s, 0, in) < 0) + if (lk_readln(&s, 0, in) < 0) return(0); #elif defined HAVE_GETDELIM size_t n= 30; --- a/as/link/lkrel.c +++ b/as/link/lkrel.c @@ -32,7 +32,7 @@ #include #include -#include "getline.h" +#include "lk_readnl.h" #include "aslink.h" #include "lkrel.h" @@ -79,7 +79,7 @@ end = (size >= 0) ? ftell (libfp) + size : -1; - while ((end < 0 || ftell (libfp) < end) && getline (str, sizeof (str), libfp) != NULL) + while ((end < 0 || ftell (libfp) < end) && lk_readnl (str, sizeof (str), libfp) != NULL) { if (0 == strcmp (str, "")) return 1; @@ -110,7 +110,7 @@ * our object file and don't go into the next one. */ - while ((end < 0 || ftell (fp) < end) && getline (buf, sizeof (buf), fp) != NULL) + while ((end < 0 || ftell (fp) < end) && lk_readnl (buf, sizeof (buf), fp) != NULL) { char symname[NINPUT]; char c; --- a/as/link/mcs51/Makefile.in +++ b/as/link/mcs51/Makefile.in @@ -46,7 +46,7 @@ ASXXLIBSRC = strcmpi.c -LKLIBSRC = getline.c lkaomf51.c lkar.c lkdata.c lkeval.c \ +LKLIBSRC = lk_readnl.c lkaomf51.c lkar.c lkdata.c lkeval.c \ lkhead.c lklex.c lklib.c lklibr.c lklist.c \ lknoice.c lkrel.c lksdcclib.c lkstore.c lksym.c --- a/as/link/z80/Makefile.in +++ b/as/link/z80/Makefile.in @@ -13,7 +13,7 @@ LKLIB = $(srcdir)/.. -LKLIBSRC = getline.c lkaomf51.c lkar.c lkdata.c lkeval.c \ +LKLIBSRC = lk_readnl.c lkaomf51.c lkar.c lkdata.c lkeval.c \ lkhead.c lklex.c lklib.c lklibr.c lklist.c \ lknoice.c lkrel.c lksdcclib.c lkstore.c lksym.c