File source-getline.diff of Package texlive
--- texk/web2c/mpware/mpto.c.gl 2009-06-05 22:23:06.000000000 +0200
+++ texk/web2c/mpware/mpto.c 2009-06-05 22:23:21.000000000 +0200
@@ -97,7 +97,7 @@ usage(char *progn)
}
char *
-getline(void)
+texgetline(void)
{ /* returns NULL on EOF or error, otherwise buf */
int c;
unsigned loc = 0;
@@ -302,7 +302,7 @@ copytex(void)
char *res = NULL;
do {
if (*aa == 0)
- if ((aa = getline()) == NULL)
+ if ((aa = texgetline()) == NULL)
err("btex section does not end");
if (getbta(aa) && *tt == 'e') {
@@ -483,7 +483,7 @@ Current maintainer: Taco Hoekwater.\n");
postverb = troff_postverb;
}
printf("%s", predoc);
- while (getline() != NULL)
+ while (texgetline() != NULL)
do_line();
printf("%s", postdoc);
exit(0);
--- texk/afm2pl/afm2pl.c.gl 2009-06-05 22:23:54.000000000 +0200
+++ texk/afm2pl/afm2pl.c 2009-06-05 22:24:11.000000000 +0200
@@ -345,7 +345,7 @@ P2C (register int, x, register int, y)
/* read a line from infile into buffer and obuffer */
int
- getline
+ texgetline
P1H (void)
{
register char *p;
@@ -781,7 +781,7 @@ P1H (void)
afmencoding->vec[i] = ".notdef";
afmencoding->name = "Unspecified";
- while (getline ()) {
+ while (texgetline ()) {
switch (interest (paramstring ())) {
case FontName:
fontname = paramnewstring ();
@@ -963,7 +963,7 @@ gettoken ()
while (1) {
while (param == 0 || *param == 0) {
- if (getline () == 0)
+ if (texgetline () == 0)
error ("! premature end in encoding file");
}
if (param[0] == '%') {
@@ -1540,7 +1540,7 @@ extraligkerninfo ()
encfilename =
openin (encfilename, kpse_enc_format, ".enc");
for (lig_it = 0; lig_it < 2; lig_it++) {
- while (getline ()) {
+ while (texgetline ()) {
/* search for (ligkern) comment in line */
for (p = buffer; *p; p++)
if (*p == '%') {
@@ -1576,7 +1576,7 @@ extraligkerninfo ()
for (i = 0; i < ligfilenames->n; i++) {
ligfilename = openin (ligfilenames->names[i],
kpse_lig_format, ".lig");
- while (getline ())
+ while (texgetline ())
checkligkern (buffer, 0); /* 2nd param 0: lig file */
fclose (infile);
}
@@ -1607,7 +1607,7 @@ extraligkerninfo ()
for (i = 0; i < Ligfilenames->n; i++) {
ligfilename = openin (Ligfilenames->names[i],
kpse_lig_format, ".lig");
- while (getline ())
+ while (texgetline ())
checkligkern (buffer, 0); /* 2nd param 0: lig file */
fclose (infile);
}
--- texk/dvipsk/afm2tfm.c.gl 2009-06-05 22:25:21.000000000 +0200
+++ texk/dvipsk/afm2tfm.c 2009-06-05 22:25:26.000000000 +0200
@@ -260,7 +260,7 @@ transform P2C(register int, x, register
}
int
-getline P1H(void) {
+texgetline P1H(void) {
register char *p ;
register int c ;
@@ -615,7 +615,7 @@ readadobe P1H(void) {
ai = newchar() ;
ai->adobenum = -1 ;
ai->adobename = "||" ; /* boundary character name */
- while (getline()) {
+ while (texgetline()) {
switch(interest(paramstring())) {
case FontName:
fontname = paramnewstring() ;
@@ -1891,7 +1891,7 @@ char *gettoken() {
while (1) {
while (param == 0 || *param == 0) {
- if (getline() == 0)
+ if (texgetline() == 0)
error("! premature end in encoding file") ;
for (p=buffer; *p; p++)
if (*p == '%') {
@@ -1982,7 +1982,7 @@ struct encoding *readencoding P1C(char *
p = gettoken() ;
if (strcmp(p, "]"))
error("! token 258 in encoding must be make-array (])") ;
- while (getline()) {
+ while (texgetline()) {
for (p=buffer; *p; p++)
if (*p == '%') {
if (ignoreligkern == 0)
--- libs/lua51/ldebug.c.gl 2009-06-05 22:20:45.000000000 +0200
+++ libs/lua51/ldebug.c 2009-06-05 22:21:13.000000000 +0200
@@ -48,7 +48,7 @@ static int currentline (lua_State *L, Ca
if (pc < 0)
return -1; /* only active lua functions have current-line information */
else
- return getline(ci_func(ci)->l.p, pc);
+ return luagetline(ci_func(ci)->l.p, pc);
}
--- libs/lua51/lvm.c.gl 2009-06-05 22:21:41.000000000 +0200
+++ libs/lua51/lvm.c 2009-06-05 22:21:50.000000000 +0200
@@ -70,10 +70,10 @@ static void traceexec (lua_State *L, con
if (mask & LUA_MASKLINE) {
Proto *p = ci_func(L->ci)->l.p;
int npc = pcRel(pc, p);
- int newline = getline(p, npc);
+ int newline = luagetline(p, npc);
/* call linehook when enter a new function, when jump back (loop),
or when enter a new line */
- if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p)))
+ if (npc == 0 || pc <= oldpc || newline != luagetline(p, pcRel(oldpc, p)))
luaD_callhook(L, LUA_HOOKLINE, newline);
}
}
--- libs/lua51/ldebug.h.gl 2009-06-05 22:20:50.000000000 +0200
+++ libs/lua51/ldebug.h 2009-06-05 22:21:01.000000000 +0200
@@ -13,7 +13,7 @@
#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
-#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
+#define luagetline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
#define resethookcount(L) (L->hookcount = L->basehookcount)
--- texk/web2c/tangleboot.p.gl 2009-06-05 22:46:54.000000000 +0200
+++ texk/web2c/tangleboot.p 2009-06-05 22:46:26.000000000 +0200
@@ -577,7 +577,7 @@ line:=templine;line:=line+1;
if not inputln(webfile)then begin begin writeln(stdout);
write(stdout,'! WEB file ended during a change');error;end;
inputhasended:=true;goto 10;end;if linesdontmatch then n:=n+1;end;
-10:end;{:132}{135:}procedure getline;label 20;
+10:end;{:132}{135:}procedure texgetline;label 20;
begin 20:if changing then{137:}begin line:=line+1;
if not inputln(changefile)then begin begin writeln(stdout);
write(stdout,'! Change file ended without @z');error;end;buffer[0]:=64;
@@ -604,13 +604,13 @@ controlcode:=136;end;68,100:controlcode:
60:controlcode:=135;61:controlcode:=2;92:controlcode:=3;
others:controlcode:=0 end;end;{:139}{140:}function skipahead:eightbits;
label 30;var c:eightbits;
-begin while true do begin if loc>limit then begin getline;
+begin while true do begin if loc>limit then begin texgetline;
if inputhasended then begin c:=136;goto 30;end;end;buffer[limit+1]:=64;
while buffer[loc]<>64 do loc:=loc+1;if loc<=limit then begin loc:=loc+2;
c:=controlcode(buffer[loc-1]);if(c<>0)or(buffer[loc-1]=62)then goto 30;
end;end;30:skipahead:=c;end;{:140}{141:}procedure skipcomment;label 10;
var bal:eightbits;c:ASCIIcode;begin bal:=0;
-while true do begin if loc>limit then begin getline;
+while true do begin if loc>limit then begin texgetline;
if inputhasended then begin begin writeln(stdout);
write(stdout,'! Input ended in mid-comment');error;end;goto 10;end;end;
c:=buffer[loc];loc:=loc+1;{142:}if c=64 then begin c:=buffer[loc];
@@ -622,7 +622,7 @@ end end else if(c=92)and(buffer[loc]<>64
then bal:=bal+1 else if c=125 then begin if bal=0 then goto 10;
bal:=bal-1;end{:142};end;10:end;{:141}{145:}function getnext:eightbits;
label 20,30,31;var c:eightbits;d:eightbits;j,k:0..longestname;
-begin 20:if loc>limit then begin getline;
+begin 20:if loc>limit then begin texgetline;
if inputhasended then begin c:=136;goto 31;end;end;c:=buffer[loc];
loc:=loc+1;
if scanninghex then{146:}if((c>=48)and(c<=57))or((c>=65)and(c<=70))then
@@ -647,7 +647,7 @@ until d=34;idloc:=loc-1;c:=130;end{:149}
64:{150:}begin c:=controlcode(buffer[loc]);loc:=loc+1;
if c=0 then goto 20 else if c=13 then scanninghex:=true else if c=135
then{151:}begin{153:}k:=0;
-while true do begin if loc>limit then begin getline;
+while true do begin if loc>limit then begin texgetline;
if inputhasended then begin begin writeln(stdout);
write(stdout,'! Input ended in section name');error;end;goto 30;end;end;
d:=buffer[loc];{154:}if d=64 then begin d:=buffer[loc+1];
--- texk/web2c/Makefile.in.orig 2009-06-08 11:26:41.000000000 +0200
+++ texk/web2c/Makefile.in 2009-06-08 11:31:42.000000000 +0200
@@ -39,6 +39,7 @@ kpse_include ../make/programs.mk
XCPPFLAGS = $(PDFXCPPFLAGS)
+CFLAGS += -D_POSIX_C_SOURCE=200803L -D_XOPEN_SOURCE=600
CXX = @CXX@
CXXLD = $(CXX)
cxx_link_command = $(CXXLD) -o $@ $(LDFLAGS)