Lines Matching refs:tbl
67 static int syscalltbl__init_native(struct syscalltbl *tbl) in syscalltbl__init_native() argument
76 entries = tbl->syscalls.entries = malloc(sizeof(struct syscall) * nr_entries); in syscalltbl__init_native()
77 if (tbl->syscalls.entries == NULL) in syscalltbl__init_native()
88 qsort(tbl->syscalls.entries, nr_entries, sizeof(struct syscall), syscallcmp); in syscalltbl__init_native()
89 tbl->syscalls.nr_entries = nr_entries; in syscalltbl__init_native()
90 tbl->syscalls.max_id = syscalltbl_native_max_id; in syscalltbl__init_native()
96 struct syscalltbl *tbl = malloc(sizeof(*tbl)); in syscalltbl__new() local
97 if (tbl) { in syscalltbl__new()
98 if (syscalltbl__init_native(tbl)) { in syscalltbl__new()
99 free(tbl); in syscalltbl__new()
103 return tbl; in syscalltbl__new()
106 void syscalltbl__delete(struct syscalltbl *tbl) in syscalltbl__delete() argument
108 zfree(&tbl->syscalls.entries); in syscalltbl__delete()
109 free(tbl); in syscalltbl__delete()
112 const char *syscalltbl__name(const struct syscalltbl *tbl __maybe_unused, int id) in syscalltbl__name()
117 int syscalltbl__id(struct syscalltbl *tbl, const char *name) in syscalltbl__id() argument
119 struct syscall *sc = bsearch(name, tbl->syscalls.entries, in syscalltbl__id()
120 tbl->syscalls.nr_entries, sizeof(*sc), in syscalltbl__id()
126 int syscalltbl__strglobmatch_next(struct syscalltbl *tbl, const char *syscall_glob, int *idx) in syscalltbl__strglobmatch_next() argument
129 struct syscall *syscalls = tbl->syscalls.entries; in syscalltbl__strglobmatch_next()
131 for (i = *idx + 1; i < tbl->syscalls.nr_entries; ++i) { in syscalltbl__strglobmatch_next()
141 int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_glob, int *idx) in syscalltbl__strglobmatch_first() argument
144 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); in syscalltbl__strglobmatch_first()
153 struct syscalltbl *tbl = zalloc(sizeof(*tbl)); in syscalltbl__new() local
154 if (tbl) in syscalltbl__new()
155 tbl->audit_machine = audit_detect_machine(); in syscalltbl__new()
156 return tbl; in syscalltbl__new()
159 void syscalltbl__delete(struct syscalltbl *tbl) in syscalltbl__delete() argument
161 free(tbl); in syscalltbl__delete()
164 const char *syscalltbl__name(const struct syscalltbl *tbl, int id) in syscalltbl__name() argument
166 return audit_syscall_to_name(id, tbl->audit_machine); in syscalltbl__name()
169 int syscalltbl__id(struct syscalltbl *tbl, const char *name) in syscalltbl__id() argument
171 return audit_name_to_syscall(name, tbl->audit_machine); in syscalltbl__id()
174 int syscalltbl__strglobmatch_next(struct syscalltbl *tbl __maybe_unused, in syscalltbl__strglobmatch_next()
180 int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_glob, int *idx) in syscalltbl__strglobmatch_first() argument
182 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); in syscalltbl__strglobmatch_first()