source: trunk/libs/newlib/src/newlib/libc/argz/argz_next.c @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 680 bytes
Line 
1/* Copyright (C) 2002 by  Red Hat, Incorporated. All rights reserved.
2 *
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
5 */
6
7#include <argz.h>
8#include <errno.h>
9#include <sys/types.h>
10#include <string.h>
11#include <stdlib.h>
12
13char *
14argz_next (char *argz,
15       size_t argz_len,
16       const char *entry)
17{
18  if (entry)
19    {
20      while(*entry != '\0')
21        entry++;
22      entry++;
23
24      if (entry >= argz + argz_len)
25        return NULL;
26      else
27        return (char *) entry;
28    }
29  else
30    {
31      if (argz_len > 0)
32        return (char *) argz;
33      else
34        return NULL;
35    }
36}
Note: See TracBrowser for help on using the repository browser.