2003-06-06 Jeff Johnston <jjohnstn@redhat.com>

* libc/argz/argz_add.c: Change to use _DEFUN macro for function
        definition.
        * libc/argz/argz_add_sep.c: Ditto.
        * libc/argz/argz_append.c libc/argz/argz_count.c: Ditto.
        * libc/argz/argz_create.c libc/argz/argz_create_sep.c: Ditto.
        * libc/argz/argz_delete.c libc/argz/argz_extract.c: Ditto.
        * libc/argz/argz_insert.c libc/argz/argz_next.c: Ditto.
        * libc/argz/argz_replace.c libc/argz/argz_stringify.c: Ditto.
        * libc/argz/envz_add.c libc/argz/envz_entry.c: Ditto.
        * libc/argz/envz_get.c libc/argz/envz_merge.c: Ditto.
        * libc/argz/envz_remove.c libc/argz/envz_strip.c: Ditto.
        * libc/locale/nl_langinfo.c libc/misc/ffs.c: Ditto.
        * libc/posix/closedir.c libc/posix/creat.c: Ditto.
        * libc/posix/execl.c libc/posix/execle.c: Ditto.
        * libc/posix/execlp.c libc/posix/execve.c: Ditto.
        * libc/posix/isatty.c libc/posix/opendir.c: Ditto.
        * libc/posix/popen.c libc/posix/readdir.c: Ditto.
        * libc/posix/readdir_r.c libc/posix/rewinddir.c: Ditto.
        * libc/posix/scandir.c libc/posix/seekdir.c: Ditto.
        * libc/posix/telldir.c libc/search/hcreate.c: Ditto.
        * libc/search/tdelete.c libc/search/tdestroy.c: Ditto.
        * libc/search/tfind.c libc/search/tsearch.c: Ditto.
        * libc/search/twalk.c libc/signal/signal.c: Ditto.
This commit is contained in:
Jeff Johnston 2003-06-06 19:57:51 +00:00
parent 045e4d2e08
commit 729d1ff9d8
43 changed files with 211 additions and 103 deletions

View File

@ -1,3 +1,29 @@
2003-06-06 Jeff Johnston <jjohnstn@redhat.com>
* libc/argz/argz_add.c: Change to use _DEFUN macro for function
definition.
* libc/argz/argz_add_sep.c: Ditto.
* libc/argz/argz_append.c libc/argz/argz_count.c: Ditto.
* libc/argz/argz_create.c libc/argz/argz_create_sep.c: Ditto.
* libc/argz/argz_delete.c libc/argz/argz_extract.c: Ditto.
* libc/argz/argz_insert.c libc/argz/argz_next.c: Ditto.
* libc/argz/argz_replace.c libc/argz/argz_stringify.c: Ditto.
* libc/argz/envz_add.c libc/argz/envz_entry.c: Ditto.
* libc/argz/envz_get.c libc/argz/envz_merge.c: Ditto.
* libc/argz/envz_remove.c libc/argz/envz_strip.c: Ditto.
* libc/locale/nl_langinfo.c libc/misc/ffs.c: Ditto.
* libc/posix/closedir.c libc/posix/creat.c: Ditto.
* libc/posix/execl.c libc/posix/execle.c: Ditto.
* libc/posix/execlp.c libc/posix/execve.c: Ditto.
* libc/posix/isatty.c libc/posix/opendir.c: Ditto.
* libc/posix/popen.c libc/posix/readdir.c: Ditto.
* libc/posix/readdir_r.c libc/posix/rewinddir.c: Ditto.
* libc/posix/scandir.c libc/posix/seekdir.c: Ditto.
* libc/posix/telldir.c libc/search/hcreate.c: Ditto.
* libc/search/tdelete.c libc/search/tdestroy.c: Ditto.
* libc/search/tfind.c libc/search/tsearch.c: Ditto.
* libc/search/twalk.c libc/signal/signal.c: Ditto.
2003-06-05 Nick Clifton <nickc@redhat.com>
* libc/include/sys/reent.h (struct _on_exit_args): New

View File

@ -10,7 +10,10 @@
#include <stdlib.h>
error_t
argz_add (char **argz, size_t *argz_len, const char *str)
_DEFUN (argz_add, (argz, argz_len, str),
char **argz _AND
size_t *argz_len _AND
const char *str)
{
int len_to_add = 0;
size_t last = *argz_len;

View File

@ -11,7 +11,11 @@
#include <argz.h>
error_t
argz_add_sep (char **argz, size_t *argz_len, const char *str, int sep)
_DEFUN (argz_add_sep, (argz, argz_len, str, sep),
char **argz _AND
size_t *argz_len _AND
const char *str _AND
int sep)
{
char *str_argz = 0;
size_t str_argz_len = 0;

View File

@ -10,7 +10,11 @@
#include <stdlib.h>
error_t
argz_append (char **argz, size_t *argz_len, const char *buf, size_t buf_len)
_DEFUN (argz_append, (argz, argz_len, buf, buf_len),
char **argz _AND
size_t *argz_len _AND
const char *buf _AND
size_t buf_len)
{
size_t last = *argz_len;

View File

@ -4,10 +4,13 @@
* is freely granted, provided that this notice is preserved.
*/
#include <_ansi.h>
#include <sys/types.h>
size_t
argz_count (const char *argz, size_t argz_len)
_DEFUN (argz_count, (argz, argz_len),
const char *argz _AND
size_t argz_len)
{
int i;
size_t count = 0;

View File

@ -10,7 +10,10 @@
#include <stdlib.h>
error_t
argz_create (char *const argv[], char **argz, size_t *argz_len)
_DEFUN (argz_create, (argv, argz, argz_len),
char *const argv[] _AND
char **argz _AND
size_t *argz_len)
{
int argc = 0;
int i = 0;

View File

@ -10,7 +10,11 @@
#include <stdlib.h>
error_t
argz_create_sep (const char *string, int sep, char **argz, size_t *argz_len)
_DEFUN (argz_create_sep, (string, sep, argz, argz_len),
const char *string _AND
int sep _AND
char **argz _AND
size_t *argz_len)
{
int len = 0;
int i = 0;

View File

@ -10,7 +10,10 @@
#include <stdlib.h>
error_t
argz_delete (char **argz, size_t *argz_len, char *entry)
_DEFUN (argz_delete, (argz, argz_len, entry),
char **argz _AND
size_t *argz_len _AND
char *entry)
{
int len = 0;
char *moveto = entry;

View File

@ -8,7 +8,10 @@
#include <sys/types.h>
void
argz_extract (char *argz, size_t argz_len, char **argv)
_DEFUN (argz_extract, (argz, argz_len, argv),
char *argz _AND
size_t argz_len _AND
char **argv)
{
size_t i = 0;
int j = 0;

View File

@ -11,7 +11,11 @@
#include <argz.h>
error_t
argz_insert (char **argz, size_t *argz_len, char *before, const char *entry)
_DEFUN (argz_insert, (argz, argz_len, before, entry),
char **argz _AND
size_t *argz_len _AND
char *before _AND
const char *entry)
{
int len = 0;

View File

@ -10,7 +10,10 @@
#include <stdlib.h>
char *
argz_next (char *argz, size_t argz_len, const char *entry)
_DEFUN (argz_next, (argz, argz_len, entry),
char *argz _AND
size_t argz_len _AND
const char *entry)
{
if (entry)
{

View File

@ -13,7 +13,12 @@
#include "buf_findstr.h"
error_t
argz_replace (char **argz, size_t *argz_len, const char *str, const char *with, unsigned *replace_count)
_DEFUN (argz_replace, (argz, argz_len, str, with, replace_count),
char **argz _AND
size_t *argz_len _AND
const char *str _AND
const char *with _AND
unsigned *replace_count)
{
const int str_len = strlen(str);
const int with_len = strlen(with);

View File

@ -4,10 +4,14 @@
* is freely granted, provided that this notice is preserved.
*/
#include <_ansi.h>
#include <sys/types.h>
void
argz_stringify (char *argz, size_t argz_len, int sep)
_DEFUN (argz_stringify, (argz, argz_len, sep),
char *argz _AND
size_t argz_len _AND
int sep)
{
size_t i;

View File

@ -12,7 +12,11 @@
#include <envz.h>
error_t
envz_add (char **envz, size_t *envz_len, const char *name, const char *value)
_DEFUN (envz_add, (envz, envz_len, name, value),
char **envz _AND
size_t *envz_len _AND
const char *name _AND
const char *value)
{
char *concat = NULL;
int name_len = 0;

View File

@ -13,7 +13,10 @@
#include "buf_findstr.h"
char *
envz_entry (const char *envz, size_t envz_len, const char *name)
_DEFUN (envz_entry, (envz, envz_len, name),
const char *envz _AND
size_t envz_len _AND
const char *name)
{
char *buf_ptr = (char *)envz;
size_t buf_len = envz_len;

View File

@ -13,7 +13,10 @@
#include "buf_findstr.h"
char *
envz_get (const char *envz, size_t envz_len, const char *name)
_DEFUN (envz_get, (envz, envz_len, name),
const char *envz _AND
size_t envz_len _AND
const char *name)
{
char *buf_ptr = (char *)envz;
size_t buf_len = envz_len;

View File

@ -12,7 +12,12 @@
#include <envz.h>
error_t
envz_merge (char **envz, size_t *envz_len, const char *envz2, size_t envz2_len, int override)
_DEFUN (envz_merge, (envz, envz_len, envz2, envz2_len, override),
char **envz _AND
size_t *envz_len _AND
const char *envz2 _AND
size_t envz2_len _AND
int override)
{
char *entry = NULL;
char *name_str = NULL;

View File

@ -12,7 +12,10 @@
#include <envz.h>
void
envz_remove(char **envz, size_t *envz_len, const char *name)
_DEFUN (envz_remove, (envz, envz_len, name),
char **envz _AND
size_t *envz_len _AND
const char *name)
{
char *entry = NULL;
int len = 0;

View File

@ -12,7 +12,9 @@
#include <envz.h>
void
envz_strip (char **envz, size_t *envz_len)
_DEFUN (envz_strip, (envz, envz_len),
char **envz _AND
size_t *envz_len)
{
char *entry = 0;
int len = 0;

View File

@ -42,7 +42,8 @@
#define _REL(BASE) ((int)item-BASE)
char *
nl_langinfo(nl_item item) {
_DEFUN(nl_langinfo, (item),
nl_item item) {
char *ret, *s, *cs;
static char *csym = NULL;

View File

@ -24,9 +24,11 @@ PORTABILITY
No supporting OS subroutines are required. */
#include <_ansi.h>
int
ffs (word)
int word;
_DEFUN(ffs, (word),
int word)
{
int i;

View File

@ -49,8 +49,8 @@ extern void _cleanupdir (DIR *dirp);
* close a directory.
*/
int
closedir(dirp)
register DIR *dirp;
_DEFUN(closedir, (dirp),
register DIR *dirp)
{
int fd, rc;

View File

@ -5,7 +5,9 @@
#include <fcntl.h>
int
creat (const char *path, mode_t mode)
_DEFUN(creat, (path, mode),
const char *path _AND
mode_t mode)
{
return open (path, O_WRONLY | O_CREAT | O_TRUNC, mode);
}

View File

@ -16,17 +16,19 @@ static char ***p_environ = &environ;
#include <stdarg.h>
int
execl (_CONST char *path, _CONST char *arg0, ...)
_DEFUN(execl, (path, arg0, ...),
_CONST char *path _AND
_CONST char *arg0 _DOTS)
#else
#include <varargs.h>
int
execl (path, arg0, va_alist)
_CONST char *path;
_CONST char *arg0;
va_dcl
_DEFUN(execl, (path, arg0, va_alist),
_CONST char *path _AND
_CONST char *arg0 _AND
va_dcl)
#endif

View File

@ -11,17 +11,19 @@
#include <stdarg.h>
int
execle (_CONST char *path, _CONST char *arg0, ...)
_DEFUN(execle, (path, arg0, ...),
_CONST char *path _AND
_CONST char *arg0 _DOTS)
#else
#include <varargs.h>
int
execle (path, arg0, va_alist)
_CONST char *path;
_CONST char *arg0;
va_dcl
_DEFUN(execle, (path, arg0, va_alist),
_CONST char *path _AND
_CONST char *arg0 _AND
va_dcl)
#endif

View File

@ -11,17 +11,19 @@
#include <stdarg.h>
int
execlp (_CONST char *path, _CONST char *arg0, ...)
_DEFUN(execlp, (path, arg0, ...),
_CONST char *path _AND
_CONST char *arg0 _DOTS)
#else
#include <varargs.h>
int
execlp (path, arg0, va_alist)
_CONST char *path;
_CONST char *arg0;
va_dcl
_DEFUN(execlp, (path, arg0, va_alist),
_CONST char *path _AND
_CONST char *arg0 _AND
va_dcl)
#endif

View File

@ -8,7 +8,10 @@
int
execve (const char *path, char * const argv[], char * const envp[])
_DEFUN(execve, (path, argv, envp),
const char *path _AND
char * const argv[] _AND
char * const envp[])
{
return _execve (path, argv, envp);
}

View File

@ -5,7 +5,7 @@
#include <sys/stat.h>
int
isatty (int fd)
_DEFUN(isatty, (fd), int fd)
{
struct stat buf;

View File

@ -47,8 +47,8 @@ static char sccsid[] = "@(#)opendir.c 5.11 (Berkeley) 2/23/91";
* open a directory.
*/
DIR *
opendir(name)
const char *name;
_DEFUN(opendir, (name),
const char *name)
{
register DIR *dirp;
register int fd;

View File

@ -63,9 +63,9 @@ static struct pid {
} *pidlist;
FILE *
popen(program, type)
const char *program;
const char *type;
_DEFUN(popen, (program, type),
const char *program _AND
const char *type)
{
struct pid *cur;
FILE *iop;
@ -144,8 +144,8 @@ popen(program, type)
* if already `pclosed', or waitpid returns an error.
*/
int
pclose(iop)
FILE *iop;
_DEFUN(pclose, (iop),
FILE *iop)
{
register struct pid *cur, *last;
int pstat;

View File

@ -45,8 +45,9 @@ extern int getdents (int fd, void *dp, int count);
* get next entry in a directory.
*/
struct dirent *
readdir(dirp)
register DIR *dirp; {
_DEFUN(readdir, (dirp),
register DIR *dirp)
{
register struct dirent *dp;
#ifdef HAVE_DD_LOCK

View File

@ -49,10 +49,10 @@ extern int getdents (int fd, void *dp, int count);
* get next entry in a directory using supplied dirent structure.
*/
int
readdir_r(dirp, dp, dpp)
register DIR *dirp;
struct dirent *dp;
struct dirent **dpp; {
_DEFUN(readdir_r, (dirp, dp, dpp),
register DIR *dirp _AND
struct dirent *dp _AND
struct dirent **dpp) {
struct dirent *tmpdp;

View File

@ -42,8 +42,8 @@ static char sccsid[] = "@(#)rewinddir.c 5.1 (Berkeley) 5/25/90";
#include <sys/lock.h>
void
rewinddir(dirp)
DIR *dirp;
_DEFUN(rewinddir, (dirp),
DIR *dirp)
{
#ifdef HAVE_DD_LOCK
__lock_acquire_recursive(dirp->dd_lock);

View File

@ -71,11 +71,11 @@ static char sccsid[] = "@(#)scandir.c 5.10 (Berkeley) 2/23/91";
#endif
int
scandir(dirname, namelist, select, dcomp)
const char *dirname;
struct dirent ***namelist;
int (*select) __P((struct dirent *));
int (*dcomp) __P((const void *, const void *));
_DEFUN(scandir, (dirname, namelist, select, dcomp),
const char *dirname _AND
struct dirent ***namelist _AND
int (*select) __P((struct dirent *)) _AND
int (*dcomp) __P((const void *, const void *)))
{
register struct dirent *d, *p, **names;
register size_t nitems;
@ -167,9 +167,9 @@ scandir(dirname, namelist, select, dcomp)
* Alphabetic order comparison routine for those who want it.
*/
int
alphasort(d1, d2)
const struct dirent **d1;
const struct dirent **d2;
_DEFUN(alphasort, (d1, d2),
const struct dirent **d1 _AND
const struct dirent **d2)
{
return(strcmp((*d1)->d_name, (*d2)->d_name));
}

View File

@ -46,9 +46,9 @@ static char sccsid[] = "@(#)seekdir.c 5.7 (Berkeley) 6/1/90";
* _seekdir is in telldir.c so that it can share opaque data structures.
*/
void
seekdir(dirp, loc)
DIR *dirp;
long loc;
_DEFUN(seekdir, (dirp, loc),
DIR *dirp _AND
long loc)
{
#ifdef HAVE_DD_LOCK
__lock_acquire_recursive(dirp->dd_lock);

View File

@ -78,8 +78,8 @@ __LOCK_INIT(static, dd_hash_lock);
#ifndef _ELIX_LEVEL || _ELIX_LEVEL >= 2
long
telldir(dirp)
DIR *dirp;
_DEFUN(telldir, (dirp),
DIR *dirp)
{
register int index;
register struct ddloc *lp;
@ -112,9 +112,9 @@ telldir(dirp)
* Only values returned by "telldir" should be passed to seekdir.
*/
void
_seekdir(dirp, loc)
register DIR *dirp;
long loc;
_DEFUN(_seekdir, (dirp, loc),
register DIR *dirp _AND
long loc)
{
register struct ddloc *lp;
register struct ddloc **prevlp;
@ -160,8 +160,8 @@ found:
/* clean out any hash entries from a closed directory */
void
_cleanupdir (dirp)
register DIR *dirp;
_DEFUN(_cleanupdir, (dirp),
register DIR *dirp)
{
int i;

View File

@ -58,19 +58,21 @@ __RCSID("$NetBSD: hcreate.c,v 1.2 2001/02/19 21:26:04 ross Exp $");
static struct hsearch_data htab;
int
hcreate(size_t nel)
_DEFUN(hcreate, (nel), size_t nel)
{
return hcreate_r (nel, &htab);
}
void
hdestroy(void)
_DEFUN_VOID (hdestroy)
{
hdestroy_r (&htab);
}
ENTRY *
hsearch(ENTRY item, ACTION action)
_DEFUN(hsearch, (item, action),
ENTRY item _AND
ACTION action)
{
ENTRY *retval;

View File

@ -26,10 +26,10 @@ __RCSID("$NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $");
/* delete node with given key */
void *
tdelete(vkey, vrootp, compar)
const void *vkey; /* key to be deleted */
void **vrootp; /* address of the root of tree */
int (*compar)(const void *, const void *);
_DEFUN(tdelete, (vkey, vrootp, compar),
const void *vkey _AND /* key to be deleted */
void **vrootp _AND /* address of the root of tree */
int (*compar)(const void *, const void *))
{
node_t **rootp = (node_t **)vrootp;
node_t *p, *q, *r;

View File

@ -40,7 +40,9 @@ trecurse(root, free_action)
}
void
tdestroy (void *vrootp, void (*freefct)(void *))
_DEFUN(tdestroy, (vrootp, freefct),
void *vrootp _AND
void (*freefct)(void *))
{
node_t *root = (node_t *) vrootp;

View File

@ -25,10 +25,10 @@ __RCSID("$NetBSD: tfind.c,v 1.2 1999/09/16 11:45:37 lukem Exp $");
/* find a node, or return 0 */
void *
tfind(vkey, vrootp, compar)
const void *vkey; /* key to be found */
void **vrootp; /* address of the tree root */
int (*compar)(const void *, const void *);
_DEFUN(tfind, (vkey, vrootp, compar),
const void *vkey _AND /* key to be found */
void **vrootp _AND /* address of the tree root */
int (*compar)(const void *, const void *))
{
node_t **rootp = (node_t **)vrootp;

View File

@ -25,10 +25,10 @@ __RCSID("$NetBSD: tsearch.c,v 1.3 1999/09/16 11:45:37 lukem Exp $");
/* find or insert datum into search tree */
void *
tsearch(vkey, vrootp, compar)
const void *vkey; /* key to be located */
void **vrootp; /* address of tree root */
int (*compar)(const void *, const void *);
_DEFUN(tsearch, (vkey, vrootp, compar),
const void *vkey _AND /* key to be located */
void **vrootp _AND /* address of tree root */
int (*compar)(const void *, const void *))
{
node_t *q;
node_t **rootp = (node_t **)vrootp;

View File

@ -49,9 +49,9 @@ trecurse(root, action, level)
/* Walk the nodes of a tree */
void
twalk(vroot, action)
const void *vroot; /* Root of the tree to be walked */
void (*action)(const void *, VISIT, int);
_DEFUN(twalk, (vroot, action),
const void *vroot _AND /* Root of the tree to be walked */
void (*action)(const void *, VISIT, int))
{
if (vroot != NULL && action != NULL)
trecurse(vroot, action, 0);

View File

@ -162,9 +162,9 @@ _DEFUN (_signal_r, (ptr, sig, func),
}
int
_raise_r (ptr, sig)
struct _reent *ptr;
int sig;
_DEFUN (_raise_r, (ptr, sig),
struct _reent *ptr _AND
int sig)
{
_sig_func_ptr func;
@ -196,9 +196,9 @@ _raise_r (ptr, sig)
}
int
__sigtramp_r (ptr, sig)
struct _reent *ptr;
int sig;
_DEFUN (__sigtramp_r, (ptr, sig),
struct _reent *ptr _AND
int sig)
{
_sig_func_ptr func;
@ -228,8 +228,8 @@ __sigtramp_r (ptr, sig)
#ifndef _REENT_ONLY
int
raise (sig)
int sig;
_DEFUN (raise, (sig),
int sig)
{
return _raise_r (_REENT, sig);
}
@ -243,13 +243,13 @@ _DEFUN (signal, (sig, func),
}
int
_init_signal ()
_DEFUN_VOID (_init_signal)
{
return _init_signal_r (_REENT);
}
int
__sigtramp (int sig)
_DEFUN (__sigtramp, (sig), int sig)
{
return __sigtramp_r (_REENT, sig);
}