Imported Upstream version 4.2.2-2
[deb_android-headers.git] / cutils / str_parms.h
CommitLineData
1e494cf4
JB
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __CUTILS_STR_PARMS_H
18#define __CUTILS_STR_PARMS_H
19
20#include <stdint.h>
21
22struct str_parms;
23
24struct str_parms *str_parms_create(void);
25struct str_parms *str_parms_create_str(const char *_string);
26void str_parms_destroy(struct str_parms *str_parms);
27
28void str_parms_del(struct str_parms *str_parms, const char *key);
29
30int str_parms_add_str(struct str_parms *str_parms, const char *key,
31 const char *value);
32int str_parms_add_int(struct str_parms *str_parms, const char *key, int value);
33
34int str_parms_add_float(struct str_parms *str_parms, const char *key,
35 float value);
36
37int str_parms_get_str(struct str_parms *str_parms, const char *key,
38 char *out_val, int len);
39int str_parms_get_int(struct str_parms *str_parms, const char *key,
40 int *out_val);
41int str_parms_get_float(struct str_parms *str_parms, const char *key,
42 float *out_val);
43
44char *str_parms_to_str(struct str_parms *str_parms);
45
46/* debug */
47void str_parms_dump(struct str_parms *str_parms);
48
49#endif /* __CUTILS_STR_PARMS_H */