mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-10-06 09:53:00 +02:00
utils/strdup.c: StrDup() and mode constifiy impl
This commit is contained in:
committed by
Tim Edwards
parent
77f04b4e80
commit
91da638579
+4
-4
@@ -53,7 +53,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
|
||||
char *
|
||||
StrDup(oldstr, str)
|
||||
char **oldstr;
|
||||
char *str;
|
||||
const char *str;
|
||||
{
|
||||
char *newstr;
|
||||
|
||||
@@ -90,7 +90,7 @@ StrDup(oldstr, str)
|
||||
|
||||
bool
|
||||
StrIsWhite(line, commentok)
|
||||
char *line;
|
||||
const char *line;
|
||||
bool commentok; /* TRUE means # comments are considered all-white */
|
||||
{
|
||||
if ( (*line == '#') && commentok)
|
||||
@@ -123,7 +123,7 @@ StrIsWhite(line, commentok)
|
||||
|
||||
bool
|
||||
StrIsInt(s)
|
||||
char *s;
|
||||
const char *s;
|
||||
{
|
||||
if (*s == '-' || *s == '+') s++;
|
||||
while (*s)
|
||||
@@ -152,7 +152,7 @@ StrIsInt(s)
|
||||
|
||||
bool
|
||||
StrIsNumeric(s)
|
||||
char *s;
|
||||
const char *s;
|
||||
{
|
||||
double result;
|
||||
char *endptr;
|
||||
|
||||
+4
-4
@@ -50,12 +50,12 @@ extern int PaExpand(char **, char **, int);
|
||||
extern char *nextName();
|
||||
extern FILE *PaOpen(char *, char *, char *, char *, char *, char **);
|
||||
extern FILE *PaLockOpen(char *, char *, char *, char *, char *, char **, bool *, int *);
|
||||
extern char *StrDup(char **, char *);
|
||||
extern char *StrDup(char **, const char *);
|
||||
extern int Match();
|
||||
extern char *ArgStr();
|
||||
extern bool StrIsWhite(char *, bool);
|
||||
extern bool StrIsInt(char *);
|
||||
extern bool StrIsNumeric(char *);
|
||||
extern bool StrIsWhite(const char *, bool);
|
||||
extern bool StrIsInt(const char *);
|
||||
extern bool StrIsNumeric(const char *);
|
||||
|
||||
/* C99 compat */
|
||||
extern void PaAppend(char **, char *);
|
||||
|
||||
Reference in New Issue
Block a user