T-Box Basic dev
Loading...
Searching...
No Matches
property_service.h
1/*
2 * Copyright (C) 2007 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/* clang-format off */
18#ifndef _INIT_PROPERTY_H
19#define _INIT_PROPERTY_H
20
21#include <stdio.h>
22
23#include "system_properties.h"
24
25extern void handle_property_set_fd(void);
26void property_init_se(void);
27extern void property_load_boot_defaults(void);
28extern void load_persist_props(void);
29extern void start_property_service(void);
30void get_property_workspace(int *fd, int *sz);
31extern int __property_get(const char *name, char *value);
32extern int property_set(const char *name, const char *value);
33extern int properties_inited();
34int get_property_set_fd(void);
35int property_is_running(void);
36void property_init_mm(void);
37
38extern void __property_get_size_error()
39 __attribute__((__error__("property_get called with too small buffer")));
40
41static inline
42__attribute__ ((always_inline))
43__attribute__ ((gnu_inline))
44__attribute__ ((artificial))
45int property_get_se(const char *name, char *value)
46{
47 size_t value_len = __builtin_object_size(value, 0);
48 if (value_len != PROP_VALUE_MAX)
49 __property_get_size_error();
50
51 return __property_get(name, value);
52}
53
54#endif /* _INIT_PROPERTY_H */
55/* clang-format on */