mirror of
https://github.com/pygos/pkg-utils.git
synced 2024-11-25 22:10:42 +01:00
6ec11b532e
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
31 lines
495 B
C
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;
|
|
}
|