2 #ifndef SAFE_ID_RANGE_LIST_H_
3 #define SAFE_ID_RANGE_LIST_H_
25 #include <sys/types.h>
35 extern const id_t safe_err_id;
39 struct safe_id_range_list_elem;
42 typedef struct safe_id_range_list
46 struct safe_id_range_list_elem *list;
50 int safe_init_id_range_list(safe_id_range_list *list);
51 int safe_add_id_range_to_list(safe_id_range_list *list, id_t min_id, id_t max_id);
52 int safe_add_id_to_list(safe_id_range_list *list, id_t
id);
53 void safe_destroy_id_range_list(safe_id_range_list *list);
54 int safe_is_id_in_list(safe_id_range_list *list, id_t
id);
55 int safe_is_id_list_empty(safe_id_range_list *list);
57 uid_t safe_strto_uid(
const char *value,
const char **endptr);
58 gid_t safe_strto_gid(
const char *value,
const char **endptr);
59 id_t safe_strto_id(
const char *value,
const char **endptr);
60 void safe_strto_id_list(safe_id_range_list *list,
const char *value,
const char **endptr);
61 void safe_strto_uid_list(safe_id_range_list *list,
const char *value,
const char **endptr);
62 void safe_strto_gid_list(safe_id_range_list *list,
const char *value,
const char **endptr);
63 int safe_parse_id_list(safe_id_range_list *list,
const char *value);
64 int safe_parse_uid_list(safe_id_range_list *list,
const char *value);
65 int safe_parse_gid_list(safe_id_range_list *list,
const char *value);