Commit 0f7dd896 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

rename scopy to fix macosx issue

parent 81adef86
......@@ -64,7 +64,7 @@ string root(string filename)
if (dotpos != NULL && strchr(dotpos, DIR_SEP) != NULL)
dotpos = NULL;
if (dotpos == NULL)
return (scopy(filename));
return (__nemo_scopy(filename));
else
return (substr(filename, 0, (dotpos - filename) - 1));
}
......@@ -79,7 +79,7 @@ string extension(string filename)
if (dotpos == NULL)
return ("");
else
return (scopy(dotpos + 1));
return (__nemo_scopy(dotpos + 1));
}
string head(string filename)
......@@ -99,9 +99,9 @@ string tail(string filename)
slashpos = strrchr(filename, DIR_SEP);
if (slashpos == NULL)
return (scopy(filename));
return (__nemo_scopy(filename));
else
return (scopy(slashpos + 1));
return (__nemo_scopy(slashpos + 1));
}
......@@ -121,7 +121,7 @@ string fullname(string filename)
char *outname;
if (*filename == DIR_SEP)
return scopy(filename);
return __nemo_scopy(filename);
if (getcwd(pathname,MAXPATHLEN) == 0)
error("Directory name too long (MAXPATHLEN=%d)",MAXPATHLEN);
n1 = strlen(pathname) + 1;
......@@ -130,7 +130,7 @@ string fullname(string filename)
if (n1+n2 < MAXPATHLEN) {
strcat(pathname,pathsep);
strcat(pathname,filename);
return scopy(pathname);
return __nemo_scopy(pathname);
} else {
outname = (char *) allocate(n1+n2+1);
sprintf(outname,"%s%c%s",pathname,DIR_SEP,filename);
......@@ -180,7 +180,7 @@ string defext(string filename, string ext)
if (forceext)
return (sconc(substr(filename, 0, xp-filename-1), ext));
else
return (scopy(filename));
return (__nemo_scopy(filename));
}
......
......@@ -1035,7 +1035,7 @@ local itemptr readitem(stream str, itemptr first)
*bufp++ = readitem(str, np); /* read next component */
}
*bufp = NULL; /* terminate item vector */
res = makeitem(scopy(SetType), scopy(ItemTag(ip)),
res = makeitem(__nemo_scopy(SetType), __nemo_scopy(ItemTag(ip)),
copxstr(ibuf, sizeof(itemptr)), NULL);
/* construct compound item */
freeitem(ip, TRUE); /* reclaim orig. header */
......
......@@ -454,9 +454,9 @@ void initparam(string argv[], string defv[])
maxkeys = nkeys - 1;
keys[0].keyval = argv[0];
keys[0].key = scopy("argv0");
keys[0].key = __nemo_scopy("argv0");
keys[0].val = progname = tail(argv[0]);
keys[0].help = scopy("Program name");
keys[0].help = __nemo_scopy("Program name");
keys[0].count = 0;
keys[0].upd = 0;
nzeno = (*defv[0] == ';');
......@@ -480,12 +480,12 @@ void initparam(string argv[], string defv[])
}
keys[i].keyval = defv[j];
keys[i].key = scopy(parname(defv[j]));
keys[i].val = scopy(parvalue(defv[j]));
keys[i].key = __nemo_scopy(parname(defv[j]));
keys[i].val = __nemo_scopy(parvalue(defv[j]));
if (nzeno)
keys[i].help = scopy(defv[j+1] + 1);
keys[i].help = __nemo_scopy(defv[j+1] + 1);
else
keys[i].help = scopy(parhelp(defv[j]));
keys[i].help = __nemo_scopy(parhelp(defv[j]));
keys[i].count = 0;
keys[i].upd = 1;
if (keys[i].key[strlen(keys[i].key)-1] == '#')
......@@ -494,7 +494,7 @@ void initparam(string argv[], string defv[])
keys[i].indexed = -2; /* not indexed */
keys[i].next = NULL;
if (streq(keys[i].key,"VERSION")) { /* special (last?) keyword */
version_i = scopy(keys[i].val);
version_i = __nemo_scopy(keys[i].val);
keys[i].upd = 0;
maxkeys--;
}
......@@ -532,7 +532,7 @@ void initparam(string argv[], string defv[])
if (keys[i].indexed >= -1)
error("Cannot match indexed keywords by position");
free(keys[i].val);
keys[i].val = scopy(argv[i]);
keys[i].val = __nemo_scopy(argv[i]);
keys[i].count++;
}
} else { /* match by name? */
......@@ -544,7 +544,7 @@ void initparam(string argv[], string defv[])
if (keys[j].count)
error("Parameter \"%s\" duplicated", name);
free(keys[j].val);
keys[j].val = scopy(parvalue(argv[i])); /* get value */
keys[j].val = __nemo_scopy(parvalue(argv[i])); /* get value */
keys[j].count++;
} else if (j=set_indexed(name,&idx)) { /* enter indexed keywords */
// process this indexed keyword
......@@ -561,9 +561,9 @@ void initparam(string argv[], string defv[])
}
kw->next = (keyword *) allocate(sizeof(keyword));
kw = kw->next;
kw->keyval = scopy(argv[i]);
kw->key = scopy(parname(argv[i]));
kw->val = scopy(parvalue(argv[i]));
kw->keyval = __nemo_scopy(argv[i]);
kw->key = __nemo_scopy(parname(argv[i]));
kw->val = __nemo_scopy(parvalue(argv[i]));
kw->help = 0;
kw->count = 1; // indexed keywords are never 'original'
kw->upd = 0;
......@@ -647,7 +647,7 @@ void initparam(string argv[], string defv[])
((val == NULL || streq(val, "")) && defflag) );
if (!streq(keys[i].val,val)) {
free(keys[i].val);
keys[i].val = scopy(val);
keys[i].val = __nemo_scopy(val);
keys[i].count++;
}
if (go) break;
......@@ -1397,7 +1397,7 @@ local void eval_keys(void)
*c2 = 0;
dprintf(3,"eval_keys: Modifying %s\n",keys[i].val);
free(keys[i].val);
keys[i].val = scopy(newval);
keys[i].val = __nemo_scopy(newval);
/* keys[i].count++; */
}
}
......@@ -1828,7 +1828,7 @@ local void setparam (string par, string val, string prompt)
#endif
val = line;
}
kw->val = scopy(val);
kw->val = __nemo_scopy(val);
kw->upd = 2; /* mark it as being updated */
#else
error("setparam: not compiled into getparam.c");
......@@ -2254,9 +2254,9 @@ local int addindexed(int i, string keyval, int idx)
}
kw->next = (keyword *) allocate(sizeof(keyword));
kw = kw->next;
kw->keyval = scopy(keyval);
kw->key = scopy(parname(keyval));
kw->val = scopy(parvalue(keyval));
kw->keyval = __nemo_scopy(keyval);
kw->key = __nemo_scopy(parname(keyval));
kw->val = __nemo_scopy(parvalue(keyval));
kw->help = 0;
kw->count = 1;
kw->upd = 0;
......@@ -2363,7 +2363,7 @@ local void readkeys(string mesg, bool first)
} else {
if (!streq(keys[i].val,parvalue(keybuf))) { /* if different */
free(keys[i].val); /* free old */
keys[i].val = scopy(parvalue(keybuf)); /* and patch in */
keys[i].val = __nemo_scopy(parvalue(keybuf)); /* and patch in */
}
}
}
......@@ -2863,7 +2863,7 @@ local void set_help(string arg)
{
char *cp;
help_string = scopy(arg);
help_string = __nemo_scopy(arg);
if ((cp = strpbrk(help_string,"0123456789"))!=NULL) /* isnum? */
help_level = atoi(cp); /* if so, change help_level */
}
......@@ -2909,7 +2909,7 @@ local void set_debug(string arg)
local void set_yapp(string arg)
{
yapp_string = scopy(arg);
yapp_string = __nemo_scopy(arg);
yapp_dev = atoi(yapp_string);
}
......
......@@ -133,7 +133,7 @@ int app_history(string s)
dprintf(1, "app_history: null history string\n");
return nhist;
}
histbuf[nhist] = scopy(s);
histbuf[nhist] = __nemo_scopy(s);
freeup[nhist] = TRUE;
dprintf(9,"app_history: histbuf[%d] = %s\n", nhist, s);
nhist++;
......@@ -162,7 +162,7 @@ void reset_history()
void set_headline(string s)
{
headline = scopy(s);
headline = __nemo_scopy(s);
}
/*
......
......@@ -12,7 +12,7 @@
/* Contents: */
/* */
/* getmem(nbytes) malloc with error checking */
/* scopy(source) returns a copy of source */
/* __nemo_scopy(source) returns a copy of source */
/* sconc(s1,s2) concatenates its arguments */
/* substr(s, p1, p2) returns substring from p1-p2 */
/* findstr(text, pat) finds index of pat in text */
......@@ -22,7 +22,7 @@
#define _strlib_h
extern char *getmem ( int nbytes );
extern string scopy ( const char *s );
extern string __nemo_scopy ( const char *s );
extern string sconc ( char *s1, char *s2 );
extern string substr ( char *s, int p1, int p2 );
extern int findstr ( char *text, char *pat );
......
......@@ -20,7 +20,7 @@
/* The following routines are defined by strlib: */
/* */
/* getmem(nbytes) malloc with error checking */
/* scopy(source) returns a copy of source */
/* __nemo_scopy(source) returns a copy of source */
/* sconc(s1,s2) concatenates its arguments */
/* substr(s, p1, p2) returns substring from p1-p2 */
/* findstr(text, pat) finds index of pat in text */
......@@ -47,13 +47,13 @@ char *getmem(int nbytes)
/***************************************************************/
/* s = scopy(t); */
/* s = __nemo_scopy(t); */
/* */
/* Copies the string t into dynamically-allocated storage. */
/* see also: strdup() */
/***************************************************************/
string scopy(const_string s)
string __nemo_scopy(const_string s)
{
string result;
......
......@@ -137,7 +137,7 @@ stream stropen(const_string name, string mode)
fe = (fentry*) allocate(sizeof(fentry));
fe->next = flist;
flist = fe; /* hook into the list */
fe->name = scopy(name);
fe->name = __nemo_scopy(name);
fe->str = res;
fe->scratch = FALSE;
fe->seek = FALSE;
......@@ -203,7 +203,7 @@ stream stropen(const_string name, string mode)
fe = (fentry*) allocate(sizeof(fentry));
fe->next = flist;
flist = fe; /* hook into the list */
fe->name = scopy(tempname);
fe->name = __nemo_scopy(tempname);
fe->str = res;
fe->scratch = streq(mode,"s");
fe->seek = canSeek;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment