Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3436 → Rev 3437

/branches/tracing/uspace/app/bdsh/config.h
1,7 → 1,5
/* Various things that are used in many files
* Various temporary port work-arounds are addressed in __HELENOS__ , this
* serves as a convenience and later as a guide to make "phony.h" for future
* ports */
/* Various things that are used in many places including a few
* tidbits left over from autoconf prior to the HelenOS port */
 
/* Specific port work-arounds : */
#ifndef PATH_MAX
/branches/tracing/uspace/lib/libc/include/string.h
64,6 → 64,9
extern long int strtol(const char *, char **, int);
extern unsigned long strtoul(const char *, char **, int);
 
extern char * strtok_r(char *, const char *, char **);
extern char * strtok(char *, const char *);
 
#endif
 
/** @}
/branches/tracing/uspace/lib/libc/generic/string.c
1,5 → 1,7
/*
* Copyright (c) 2005 Martin Decky
* Copyright (C) 1998 by Wes Peters <wes@softweyr.com>
* Copyright (c) 1988, 1993 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
396,5 → 398,52
return (char *) memcpy(ret, s1, len);
}
 
/* Ported from FBSD strtok.c 8.1 (Berkeley) 6/4/93 */
char * strtok_r(char *s, const char *delim, char **last)
{
char *spanp, *tok;
int c, sc;
 
if (s == NULL && (s = *last) == NULL)
return (NULL);
 
cont:
c = *s++;
for (spanp = (char *)delim; (sc = *spanp++) != 0;) {
if (c == sc)
goto cont;
}
 
if (c == 0) { /* no non-delimiter characters */
*last = NULL;
return (NULL);
}
 
tok = s - 1;
 
for (;;) {
c = *s++;
spanp = (char *)delim;
do {
if ((sc = *spanp++) == c) {
if (c == 0)
s = NULL;
else
s[-1] = '\0';
*last = s;
return (tok);
}
} while (sc != 0);
}
}
 
/* Ported from FBSD strtok.c 8.1 (Berkeley) 6/4/93 */
char * strtok(char *s, const char *delim)
{
static char *last;
 
return (strtok_r(s, delim, &last));
}
 
/** @}
*/