Avoid name clashes with stdlib functions - abc2ps - A powerful sheet setting to… | |
git clone git://vernunftzentrum.de/abc2ps.git | |
Log | |
Files | |
Refs | |
--- | |
commit 361a200da0043f2d117e1a9ef92b85e853e38bc7 | |
parent 3a06ea49c1f1fb94fb58a82709906dbe620186f3 | |
Author: Christian Kellermann <[email protected]> | |
Date: Tue, 17 Apr 2018 21:03:22 +0200 | |
Avoid name clashes with stdlib functions | |
Diffstat: | |
abc2ps.c | 7 ++++--- | |
buffer.h | 4 ++-- | |
format.h | 4 ++-- | |
music.h | 6 +++--- | |
parse.h | 12 ++++++------ | |
util.h | 6 +++--- | |
6 files changed, 20 insertions(+), 19 deletions(-) | |
--- | |
diff --git a/abc2ps.c b/abc2ps.c | |
@@ -25,11 +25,12 @@ | |
*/ | |
/* Main program abc2ps.c */ | |
- | |
+#include <ctype.h> | |
#include <stdio.h> | |
#include <math.h> | |
#include <time.h> | |
#include <string.h> | |
+#include <stdlib.h> | |
/* -------------- general macros ------------- */ | |
@@ -649,8 +650,8 @@ char *argv[]; | |
printf ("\nSelect tunes: "); | |
/*| gets (aaa); |*/ | |
/*| fgets (aaa, sizeof(aaa), stdin); |*/ | |
- getline(aaa,500,stdin); | |
- if (isblank(aaa)) break; | |
+ abc2ps_getline(aaa,500,stdin); | |
+ if (str_isblank(aaa)) break; | |
sscanf(aaa,"%s",ccc); | |
if (ccc[0]=='?') { | |
printf ("%s\n", bbb); | |
diff --git a/buffer.h b/buffer.h | |
@@ -20,7 +20,7 @@ | |
void a2b (t) | |
char *t; | |
{ | |
- int l,i; | |
+ size_t l,i; | |
l=strlen(t); | |
/* printf ("Append %d <%s>\n", l, t); */ | |
@@ -103,7 +103,7 @@ void write_index_entry () | |
} | |
- if (strlen(info.comp)) fprintf (findex, "( - %s) S\n", info.comp); | |
+ if (strlen(info.comp[0])) fprintf (findex, "( - %s) S\n", info.comp); | |
if (cfmt.withxrefs) fprintf (findex, "( [%s]) S\n", info.xref); | |
diff --git a/format.h b/format.h | |
@@ -474,13 +474,13 @@ struct FORMAT *f; | |
if (vb>=4) printf ("Reading format file %s:\n", fname); | |
printf ("%s .. ", fname); | |
strcpy (line, ""); | |
- getline(line, BSIZE, fp); | |
+ abc2ps_getline(line, BSIZE, fp); | |
for (i=0;i<200;i++) { | |
end=interpret_format_line (line,f); | |
if (end==1) return 1; | |
strcpy (line, ""); | |
if (feof(fp)) return 1; | |
- if (!getline(line, BSIZE, fp)) return 1 ; | |
+ if (!abc2ps_getline(line, BSIZE, fp)) return 1 ; | |
} | |
fclose (fp); | |
return 1; | |
diff --git a/music.h b/music.h | |
@@ -4126,7 +4126,7 @@ int job; | |
for (i=0;i<100;i++) { | |
if (feof(fpin)) rx("EOF reached scanning text block",""); | |
strcpy (ln, ""); | |
- getline(ln, BSIZE, fpin); | |
+ abc2ps_getline(ln, BSIZE, fpin); | |
ll=strlen(ln); | |
linenum++; | |
if ((verbose>=5) || (vb>=10) ) printf ("%3d %s \n", linenum, ln); | |
@@ -4140,7 +4140,7 @@ int job; | |
if (!strcmp(w1,"endtext")) break; | |
if (job!=SKIP) { | |
- if (isblank(ln)) { | |
+ if (str_isblank(ln)) { | |
write_text_block (fp,job); | |
ntxt=0; | |
} | |
@@ -4173,7 +4173,7 @@ char line[]; | |
if (epsf && !within_block) return; | |
strcpy(fstr,""); | |
sscanf(line, "%*s %s", fstr); | |
- if (isblank(fstr)) strcpy(fstr,"obeylines"); | |
+ if (str_isblank(fstr)) strcpy(fstr,"obeylines"); | |
if (!strcmp(fstr,"obeylines")) job=OBEYLINES; | |
else if (!strcmp(fstr,"align")) job=ALIGN; | |
else if (!strcmp(fstr,"skip")) job=SKIP; | |
diff --git a/parse.h b/parse.h | |
@@ -2208,7 +2208,7 @@ char xref_str[],pat[][STRL1]; | |
/* true if select_all or if no selectors given */ | |
if (select_all) return 1; | |
- if (isblank(xref_str) && (npat==0)) return 1; | |
+ if (str_isblank(xref_str) && (npat==0)) return 1; | |
for (i=0;i<npat;i++) { /*patterns */ | |
if (search_field==S_COMPOSER) { | |
@@ -2273,7 +2273,7 @@ char pat[][STRL1]; | |
if ((*q==' ') || (*q=='\0')) { | |
arg[i]='\0'; | |
i=0; | |
- if (!isblank(arg)) { | |
+ if (!str_isblank(arg)) { | |
if (arg[0]=='-') /* skip any flags */ | |
; | |
else if (is_xrefstr(arg)) { | |
@@ -2325,7 +2325,7 @@ char ln[]; | |
strcpy (ln, ""); | |
if (feof(fp)) return 0; | |
- getline(ln, BSIZE, fp); | |
+ abc2ps_getline(ln, BSIZE, fp); | |
/*| fgets(ln, BSIZE, fp); |*/ | |
linenum++; | |
l=strlen(ln); | |
@@ -2355,7 +2355,7 @@ char line[BSIZE]; | |
if (!get_line(fp,line)) return E_O_F; | |
- if (isblank(line)) return BLANK; | |
+ if (str_isblank(line)) return BLANK; | |
if (is_pseudocomment(line)) return PSCOMMENT; | |
if (is_comment(line)) return COMMENT; | |
decomment_line (line); | |
@@ -2367,7 +2367,7 @@ char line[BSIZE]; | |
else { | |
for (;;) { | |
if (! get_line(fp,line)) return E_O_F; | |
- if (isblank(line)) return BLANK; | |
+ if (str_isblank(line)) return BLANK; | |
if (is_info_field(line)) break; | |
add_text (line, TEXT_H); | |
} | |
@@ -2441,7 +2441,7 @@ char xref_str[],pat[][STRL1]; | |
} | |
- if (isblank(line)) { | |
+ if (str_isblank(line)) { | |
if (within_block && !within_tune) | |
printf ("+++ Header not closed in tune %d\n", xrefnum); | |
within_tune=0; | |
diff --git a/util.h b/util.h | |
@@ -78,7 +78,7 @@ float x1,x2; | |
* returns true for CR, so this routine should work even if the input | |
* came from a DOS system. | |
*/ | |
-char * getline(buf,len,fp) | |
+char * abc2ps_getline(buf,len,fp) | |
char* buf; | |
int len; | |
FILE* fp; | |
@@ -296,8 +296,8 @@ char str[], pat[]; | |
return 1; | |
} | |
-/* ----- isblank: check for blank string ---- */ | |
-int isblank (str) | |
+/* ----- str_isblank: check for blank string ---- */ | |
+int str_isblank (str) | |
char str[]; | |
{ | |
int i; |