Lines Matching refs:store

34 struct store {  struct
37 char **store; argument
42 struct store *storecreate(struct store *);
43 static int storeappend(struct store *, const char *);
63 static struct store *store = NULL; in matchinstalled() local
68 store = storecreate(store); in matchinstalled()
69 if (store == NULL) { in matchinstalled()
122 errcode = storeappend(store, matched); in matchinstalled()
137 storeappend(store, patterns[i]); in matchinstalled()
140 if (store->used == 0) in matchinstalled()
143 return store->store; in matchinstalled()
303 struct store *store = NULL; in matchallbyorigin() local
304 store = storecreate(store); in matchallbyorigin()
309 storeappend(store, installed[j]); in matchallbyorigin()
313 if (store->used == 0) in matchallbyorigin()
316 matches[i] = store->store; in matchallbyorigin()
547 struct store *
548 storecreate(struct store *store) in storecreate() argument
552 if (store == NULL) { in storecreate()
553 store = malloc(sizeof *store); in storecreate()
554 if (store == NULL) { in storecreate()
558 store->currlen = 0; in storecreate()
559 store->store = NULL; in storecreate()
560 } else if (store->store != NULL) { in storecreate()
562 for (i = 0; store->store[i] != NULL; i++) in storecreate()
563 free(store->store[i]); in storecreate()
564 store->store[0] = NULL; in storecreate()
566 store->used = 0; in storecreate()
568 return store; in storecreate()
575 storeappend(struct store *store, const char *item) in storeappend() argument
577 if (store->used + 2 > store->currlen) { in storeappend()
578 store->currlen += 16; in storeappend()
579 store->store = reallocf(store->store, in storeappend()
580 store->currlen * sizeof(*(store->store))); in storeappend()
581 if (store->store == NULL) { in storeappend()
582 store->currlen = 0; in storeappend()
588 asprintf(&(store->store[store->used]), "%s", item); in storeappend()
589 if (store->store[store->used] == NULL) { in storeappend()
593 store->used++; in storeappend()
594 store->store[store->used] = NULL; in storeappend()