Adjustments for unified binary

This commit is contained in:
topjohnwu
2017-04-05 06:00:42 +08:00
parent dc9670c439
commit cd498711bc
4 changed files with 19 additions and 39 deletions
-22
View File
@@ -1,27 +1,5 @@
#include "magiskpolicy.h"
void vec_init(vector *v) {
v->size = 0;
v->cap = 1;
v->data = (char**) malloc(sizeof(char*));
}
void vec_push_back(vector *v, char* s) {
if (v == NULL) return;
if (v->size == v->cap) {
v->cap *= 2;
v->data = (char**) realloc(v->data, sizeof(char*) * v->cap);
}
v->data[v->size] = s;
++v->size;
}
void vec_destroy(vector *v) {
v->size = 0;
v->cap = 0;
free(v->data);
}
int allow(char *s, char *t, char *c, char *p) {
return add_rule(s, t, c, p, AVTAB_ALLOWED, 0);
}