| 1 |
/**************************************************************************/ |
| 2 |
/* */ |
| 3 |
/* This file is part of Frama-C. */ |
| 4 |
/* */ |
| 5 |
/* Copyright (C) 1995-2022 */ |
| 6 |
/* Free Software Foundation, Inc. */ |
| 7 |
/* Copyright (C) 2021-2022 */ |
| 8 |
/* CEA (Commissariat à l'énergie atomique et aux énergies */ |
| 9 |
/* alternatives) */ |
| 10 |
/* */ |
| 11 |
/* This file is derived from the GNU C Library. You can redistribute it */ |
| 12 |
/* and/or modify it under the terms of the GNU Lesser General Public */ |
| 13 |
/* License as published by the Free Software Foundation, version 2.1. */ |
| 14 |
/* */ |
| 15 |
/* you can redistribute it and/or modify it under the terms of the GNU */ |
| 16 |
/* Lesser General Public License as published by the Free Software */ |
| 17 |
/* Foundation, version 2.1. */ |
| 18 |
/* */ |
| 19 |
/* It is distributed in the hope that it will be useful, */ |
| 20 |
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
| 21 |
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
| 22 |
/* GNU Lesser General Public License for more details. */ |
| 23 |
/* */ |
| 24 |
/* See the GNU Lesser General Public License version 2.1 */ |
| 25 |
/* for more details (enclosed in the file licenses/LGPLv2.1). */ |
| 26 |
/* */ |
| 27 |
/**************************************************************************/ |
| 28 |
|
| 29 |
// Non-POSIX; this file is defined in the GNU libc. |
| 30 |
|
| 31 |
#ifndef __FC_ARGZ_H |
| 32 |
#define __FC_ARGZ_H |
| 33 |
|
| 34 |
#include "features.h" |
| 35 |
__PUSH_FC_STDLIB |
| 36 |
|
| 37 |
#include "errno.h" |
| 38 |
#include "stdlib.h" |
| 39 |
#include "string.h" |
| 40 |
|
| 41 |
__BEGIN_DECLS |
| 42 |
|
| 43 |
typedef int error_t; |
| 44 |
|
| 45 |
extern error_t argz_create (char *const argv[], char **restrict argz, |
| 46 |
size_t *restrict len); |
| 47 |
|
| 48 |
/*@ assigns \result, *argz[..] \from \nothing; */ |
| 49 |
extern error_t argz_create_sep (const char *restrict string, |
| 50 |
int sep, char **restrict argz, |
| 51 |
size_t *restrict len); |
| 52 |
|
| 53 |
extern size_t argz_count (const char *argz, size_t len); |
| 54 |
|
| 55 |
extern void argz_extract (const char *restrict argz, size_t len, |
| 56 |
char **restrict argv); |
| 57 |
|
| 58 |
extern void argz_stringify (char *argz, size_t len, int sep); |
| 59 |
|
| 60 |
extern error_t argz_append (char **restrict argz, |
| 61 |
size_t *restrict argz_len, |
| 62 |
const char *restrict buf, size_t buf_len); |
| 63 |
|
| 64 |
extern error_t argz_add (char **restrict argz, |
| 65 |
size_t *restrict argz_len, |
| 66 |
const char *restrict str); |
| 67 |
|
| 68 |
extern error_t argz_add_sep (char **restrict argz, |
| 69 |
size_t *restrict argz_len, |
| 70 |
const char *restrict string, int delim); |
| 71 |
|
| 72 |
extern void argz_delete (char **restrict argz, |
| 73 |
size_t *restrict argz_len, |
| 74 |
char *restrict entry); |
| 75 |
|
| 76 |
extern error_t argz_insert (char **restrict argz, |
| 77 |
size_t *restrict argz_len, |
| 78 |
char *restrict before, |
| 79 |
const char *restrict entry); |
| 80 |
|
| 81 |
extern error_t argz_replace (char **restrict argz, |
| 82 |
size_t *restrict argz_len, |
| 83 |
const char *restrict str, |
| 84 |
const char *restrict with, |
| 85 |
unsigned int *restrict replace_count); |
| 86 |
|
| 87 |
extern char *argz_next (const char *restrict argz, size_t argz_len, |
| 88 |
const char *restrict entry); |
| 89 |
|
| 90 |
__END_DECLS |
| 91 |
|
| 92 |
__POP_FC_STDLIB |
| 93 |
#endif |