Lines Matching refs:tbl
59 static int syscalltbl__init_native(struct syscalltbl *tbl) in syscalltbl__init_native() argument
68 entries = tbl->syscalls.entries = malloc(sizeof(struct syscall) * nr_entries); in syscalltbl__init_native()
69 if (tbl->syscalls.entries == NULL) in syscalltbl__init_native()
80 qsort(tbl->syscalls.entries, nr_entries, sizeof(struct syscall), syscallcmp); in syscalltbl__init_native()
81 tbl->syscalls.nr_entries = nr_entries; in syscalltbl__init_native()
82 tbl->syscalls.max_id = syscalltbl_native_max_id; in syscalltbl__init_native()
88 struct syscalltbl *tbl = malloc(sizeof(*tbl)); in syscalltbl__new() local
89 if (tbl) { in syscalltbl__new()
90 if (syscalltbl__init_native(tbl)) { in syscalltbl__new()
91 free(tbl); in syscalltbl__new()
95 return tbl; in syscalltbl__new()
98 void syscalltbl__delete(struct syscalltbl *tbl) in syscalltbl__delete() argument
100 zfree(&tbl->syscalls.entries); in syscalltbl__delete()
101 free(tbl); in syscalltbl__delete()
104 const char *syscalltbl__name(const struct syscalltbl *tbl __maybe_unused, int id) in syscalltbl__name()
109 int syscalltbl__id(struct syscalltbl *tbl, const char *name) in syscalltbl__id() argument
111 struct syscall *sc = bsearch(name, tbl->syscalls.entries, in syscalltbl__id()
112 tbl->syscalls.nr_entries, sizeof(*sc), in syscalltbl__id()
118 int syscalltbl__strglobmatch_next(struct syscalltbl *tbl, const char *syscall_glob, int *idx) in syscalltbl__strglobmatch_next() argument
121 struct syscall *syscalls = tbl->syscalls.entries; in syscalltbl__strglobmatch_next()
123 for (i = *idx + 1; i < tbl->syscalls.nr_entries; ++i) { in syscalltbl__strglobmatch_next()
133 int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_glob, int *idx) in syscalltbl__strglobmatch_first() argument
136 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); in syscalltbl__strglobmatch_first()
145 struct syscalltbl *tbl = zalloc(sizeof(*tbl)); in syscalltbl__new() local
146 if (tbl) in syscalltbl__new()
147 tbl->audit_machine = audit_detect_machine(); in syscalltbl__new()
148 return tbl; in syscalltbl__new()
151 void syscalltbl__delete(struct syscalltbl *tbl) in syscalltbl__delete() argument
153 free(tbl); in syscalltbl__delete()
156 const char *syscalltbl__name(const struct syscalltbl *tbl, int id) in syscalltbl__name() argument
158 return audit_syscall_to_name(id, tbl->audit_machine); in syscalltbl__name()
161 int syscalltbl__id(struct syscalltbl *tbl, const char *name) in syscalltbl__id() argument
163 return audit_name_to_syscall(name, tbl->audit_machine); in syscalltbl__id()
166 int syscalltbl__strglobmatch_next(struct syscalltbl *tbl __maybe_unused, in syscalltbl__strglobmatch_next()
172 int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_glob, int *idx) in syscalltbl__strglobmatch_first() argument
174 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); in syscalltbl__strglobmatch_first()