OpenVAS Libraries  7.0.6
arglists.h
Go to the documentation of this file.
1 /* OpenVAS
2  * $Id$
3  * Description: Header file for module arglists.
4  *
5  * Authors:
6  * Renaud Deraison <deraison@nessus.org> (Original pre-fork development)
7  *
8  * Copyright:
9  * Based on work Copyright (C) 1998 - 2007 Tenable Network Security, Inc.
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25 
26 #ifndef OPENVAS_ARGLISTS_H
27 #define OPENVAS_ARGLISTS_H
28 
29 struct arglist
30 {
31  char *name;
32  int type;
33  void *value;
34  long length;
35  struct arglist *next;
36  int hash;
37 };
38 
47 struct name_cache
48 {
49  char *name;
51  struct name_cache *next;
52  struct name_cache *prev;
53 };
54 
55 #define ARG_STRING 1
56 #define ARG_PTR 2
57 #define ARG_INT 3
58 #define ARG_ARGLIST 4
59 #define ARG_STRUCT 5
60 
61 char *cache_inc (const char *name);
62 void cache_dec (const char *name);
63 
64 void arg_add_value (struct arglist *, const char *, int, long, void *);
65 int arg_set_value (struct arglist *, const char *, long, void *);
66 void *arg_get_value (struct arglist *, const char *);
67 int arg_get_type (struct arglist *, const char *);
68 void arg_dump (struct arglist *, int);
69 void arg_dup (struct arglist *, struct arglist *);
70 void arg_free (struct arglist *);
71 void arg_free_all (struct arglist *);
72 void arg_del_value (struct arglist *, const char *name);
73 
74 struct arglist * str2arglist (char *str);
75 
76 #endif /* OPENVAS_ARGLISTS_H */
void * arg_get_value(struct arglist *, const char *)
Definition: arglists.c:235
struct arglist * str2arglist(char *str)
Definition: arglists.c:443
int arg_get_type(struct arglist *, const char *)
Definition: arglists.c:251
void arg_del_value(struct arglist *, const char *name)
Definition: arglists.c:396
Struct to cache names (keys) of arglist entries.
Definition: arglists.h:47
void cache_dec(const char *name)
Definition: arglists.c:126
struct name_cache * prev
Definition: arglists.h:52
void arg_dump(struct arglist *, int)
Definition: arglists.c:315
long length
Definition: arglists.h:34
int type
Definition: arglists.h:32
void * value
Definition: arglists.h:33
int arg_set_value(struct arglist *, const char *, long, void *)
Definition: arglists.c:204
int occurences
Definition: arglists.h:50
struct arglist * next
Definition: arglists.h:35
void arg_add_value(struct arglist *, const char *, int, long, void *)
Definition: arglists.c:157
struct name_cache * next
Definition: arglists.h:51
const char * name
Definition: nasl_init.c:501
Definition: arglists.h:29
char * name
Definition: arglists.h:49
int hash
Definition: arglists.h:36
void arg_dup(struct arglist *, struct arglist *)
Definition: arglists.c:264
char * name
Definition: arglists.h:31
void arg_free(struct arglist *)
Definition: arglists.c:357
void arg_free_all(struct arglist *)
Definition: arglists.c:371
char * cache_inc(const char *name)
Definition: arglists.c:112