1
0
Fork 0
mirror of https://github.com/pygos/pkg-utils.git synced 2024-11-05 13:17:10 +01:00
pkg-utils/main/compressor.c
David Oberhollenzer 6ec11b532e Initial commit
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2019-01-26 23:19:21 +01:00

31 lines
495 B
C

#include <string.h>
#include "compressor.h"
static compressor_t *list = NULL;
void compressor_register(compressor_t *compressor)
{
compressor->next = list;
list = compressor;
}
compressor_t *compressor_by_name(const char *name)
{
compressor_t *it = list;
while (it != NULL && strcmp(it->name, name) != 0)
it = it->next;
return it;
}
compressor_t *compressor_by_id(PKG_COMPRESSION id)
{
compressor_t *it = list;
while (it != NULL && it->id != id)
it = it->next;
return it;
}