| 1 | /* Routines for dealing with '\0' separated arg vectors.
|
|---|
| 2 | Copyright (C) 1995,96,97,98,99,2000,2004 Free Software Foundation, Inc.
|
|---|
| 3 | This file is part of the GNU C Library.
|
|---|
| 4 |
|
|---|
| 5 | The GNU C Library is free software; you can redistribute it and/or
|
|---|
| 6 | modify it under the terms of the GNU Lesser General Public
|
|---|
| 7 | License as published by the Free Software Foundation; either
|
|---|
| 8 | version 2.1 of the License, or (at your option) any later version.
|
|---|
| 9 |
|
|---|
| 10 | The GNU C Library is distributed in the hope that it will be useful,
|
|---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 13 | Lesser General Public License for more details.
|
|---|
| 14 |
|
|---|
| 15 | You should have received a copy of the GNU Lesser General Public
|
|---|
| 16 | License along with the GNU C Library; if not, write to the Free
|
|---|
| 17 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|---|
| 18 | 02111-1307 USA. */
|
|---|
| 19 |
|
|---|
| 20 | /** @file
|
|---|
| 21 | * GLIBC v2.3.x CVS
|
|---|
| 22 | */
|
|---|
| 23 |
|
|---|
| 24 | #ifndef _ARGZ_H
|
|---|
| 25 | #define _ARGZ_H 1
|
|---|
| 26 |
|
|---|
| 27 | #include <features.h>
|
|---|
| 28 |
|
|---|
| 29 | #define __need_error_t
|
|---|
| 30 | #include <errno.h>
|
|---|
| 31 | #include <string.h> /* Need size_t, and strchr is called below. */
|
|---|
| 32 |
|
|---|
| 33 | #ifndef __const
|
|---|
| 34 | # define __const const
|
|---|
| 35 | #endif
|
|---|
| 36 |
|
|---|
| 37 | #ifndef __error_t_defined
|
|---|
| 38 | typedef int error_t;
|
|---|
| 39 | #endif
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 | __BEGIN_DECLS
|
|---|
| 43 |
|
|---|
| 44 | /* Make a '\0' separated arg vector from a unix argv vector, returning it in
|
|---|
| 45 | ARGZ, and the total length in LEN. If a memory allocation error occurs,
|
|---|
| 46 | ENOMEM is returned, otherwise 0. The result can be destroyed using free. */
|
|---|
| 47 | extern error_t __argz_create (char *__const __argv[], char **__restrict __argz,
|
|---|
| 48 | size_t *__restrict __len) __THROW;
|
|---|
| 49 | extern error_t argz_create (char *__const __argv[], char **__restrict __argz,
|
|---|
| 50 | size_t *__restrict __len) __THROW;
|
|---|
| 51 |
|
|---|
| 52 | /* Make a '\0' separated arg vector from a SEP separated list in
|
|---|
| 53 | STRING, returning it in ARGZ, and the total length in LEN. If a
|
|---|
| 54 | memory allocation error occurs, ENOMEM is returned, otherwise 0.
|
|---|
| 55 | The result can be destroyed using free. */
|
|---|
| 56 | extern error_t __argz_create_sep (__const char *__restrict __string,
|
|---|
| 57 | int __sep, char **__restrict __argz,
|
|---|
|
|---|