-
Notifications
You must be signed in to change notification settings - Fork 3
/
cal.h
61 lines (45 loc) · 1.59 KB
/
cal.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
/**
@file cal.h
@brief Maemo Configuration Access Library
Copyright (C) 2012 Ivaylo Dimitrov <[email protected]>
This file is part of libcal.
this library is free software;
you can redistribute it and/or modify it under the terms of the
GNU Lesser General Public License version 2.1 as published by the
Free Software Foundation.
libcal 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 libcal.
If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CAL_H
#define CAL_H
#define CAL_MAX_NAME_LEN 16
#define CAL_FLAG_USER 0x0001
#define CAL_FLAG_WRITE_ONCE 0x0002
#ifdef __cplusplus
extern "C" {
#endif
struct cal;
extern void (* cal_debug_log)(int level, const char *str);
extern void (* cal_error_log)(const char *str);
int cal_init(struct cal** cal_out);
void cal_finish(struct cal* cal);
int cal_read_block(struct cal* cal,
const char* name,
void** ptr,
unsigned long* len,
unsigned long flags);
int cal_write_block(struct cal* cal,
const char* name,
const void* data,
unsigned long data_len,
unsigned long flags);
int cal_lock_otp_area(struct cal* cal, unsigned int flag);
#ifdef __cplusplus
}
#endif
#endif