OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [argz/] [argz_next.c] - Blame information for rev 326

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* 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
 
13
char *
14
_DEFUN (argz_next, (argz, argz_len, entry),
15
       char *argz _AND
16
       size_t argz_len _AND
17
       const char *entry)
18
{
19
  if (entry)
20
    {
21
      while(*entry != '\0')
22
        entry++;
23
      entry++;
24
 
25
      if (entry >= argz + argz_len)
26
        return NULL;
27
      else
28
        return (char *) entry;
29
    }
30
  else
31
    {
32
      if (argz_len > 0)
33
        return (char *) argz;
34
      else
35
        return NULL;
36
    }
37
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.