-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnamelist.h
61 lines (46 loc) · 1.93 KB
/
namelist.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright (c) 2015-2017, Parallels International GmbH
* Copyright (c) 2017-2019 Virtuozzo International GmbH. All rights reserved.
*
* This file is part of OpenVZ. OpenVZ is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* Lesser General Public License as published by the Free Software Foundation;
* either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* Our contact details: Virtuozzo International GmbH, Vordergasse 59, 8200
* Schaffhausen, Switzerland.
*
* Implement list of names
*/
#ifndef __NAMELIST_H__
#define __NAMELIST_H__
struct namelist
{
char *name ;
struct namelist *next ;
};
int namelist_add(const char * name, struct namelist **info) ;
/*search string in info with same name*/
/* return 1 - found */
int namelist_search(const char *name, struct namelist **info);
int namelist_count(struct namelist **info);
int namelist_remove(const char *name, struct namelist **info);
void namelist_clean(struct namelist **info);
void print_namelist(struct namelist **info);
void print_namelist_to_str_delim(struct namelist **info, char *str, size_t size, const char *delim);
void print_namelist_to_str(struct namelist **info, char *str, size_t size);
void namelist_split_delim(struct namelist **list, const char *str, const char *delim);
void namelist_split(struct namelist **list, const char *str);
int namelist_compare(struct namelist **info, const char *str, const char *delim);
#endif