home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Micro R&D 1
/
MicroRD-CD-ROM-Vol1-1994.iso
/
os20
/
util
/
trumultiassigns.lha
/
clib.h
next >
Wrap
C/C++ Source or Header
|
1992-08-12
|
804b
|
49 lines
#ifndef _CLIB_H
#define _CLIB_H
// varargs functions better be done with macros, because they're not
// inline'able
#define printf(_fmt, _args...) \
({ void *_argv[] = { _args }; VPrintf (_fmt, _argv); })
extern inline const char *
index (const char *s, char ch)
{
char *sp = (char *) s;
do
if (*sp == ch)
return (const char *) sp;
while (*++sp);
return 0;
}
extern inline const char *
rindex (const char *s, char ch)
{
char *last = 0;
do
if (*s == ch)
last = (char *) s;
while (*++s);
return (const char *) last;
}
extern inline u_long
strlen (const char *s)
{
const char *start = s;
while (*s++) ;
return s - start;
}
extern inline char *
strcpy (char *d, const char *s)
{
char *tgt = d;
while (*d++ = *s++) ;
return tgt;
}
#endif /* _CLIB_H */