summaryrefslogtreecommitdiffstats
path: root/abs/core/udev/resolve-modalias.c
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2010-10-23 18:17:40 (GMT)
committerJames Meyer <james.meyer@operamail.com>2010-10-23 18:19:39 (GMT)
commitadbcf19958300e9b6598990184c8815b945ba0ee (patch)
treef4283c850ac0ac202c17e78a637ee7ca8147621b /abs/core/udev/resolve-modalias.c
parent61a68250df10d29b624650948484898334ff22d0 (diff)
downloadlinhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.zip
linhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.tar.gz
linhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.tar.bz2
Removed old core and extra from repo. Renamed -testing to core/extra. This will setup the base for the testing branch.
Diffstat (limited to 'abs/core/udev/resolve-modalias.c')
-rw-r--r--abs/core/udev/resolve-modalias.c62
1 files changed, 0 insertions, 62 deletions
diff --git a/abs/core/udev/resolve-modalias.c b/abs/core/udev/resolve-modalias.c
deleted file mode 100644
index d1680b1..0000000
--- a/abs/core/udev/resolve-modalias.c
+++ /dev/null
@@ -1,62 +0,0 @@
-#include <stdio.h>
-#include <fnmatch.h>
-#include <string.h>
-#include <malloc.h>
-
-static char *getline(FILE *file) {
- static size_t size = 1024;
- static char *buf = NULL;
- static unsigned int i = 0, r = 0;;
-
- if(buf == NULL)
- buf = (char*)malloc(size);
-
- if(i) {
- memmove(buf, buf+i, size-i);
- r -= i;
- i = 0;
- }
-
- while(1) {
- if(i == size) {
- size *= 2;
- buf = (char*)realloc(buf, size);
- }
-
- if(i==r)
- r += fread(buf+i, 1, size-i, file);
-
- if(i==r && i == 0) {
- free(buf);
- buf = NULL;
- r = 0;
- return NULL;
- }
-
- if(i==r || buf[i] == '\n') {
- buf[i++] = '\0';
- return buf;
- }
- i++;
- }
-}
-
-int main(int argc, char *argv[]) {
- FILE *f=fopen(argv[1], "r");
- char *line, *pattern, *module;
- char *pos1, *pos2;
-
- while((line=getline(f))!=NULL) {
- if(!strncmp(line, "alias", strlen("alias"))) {
- pos1 = index(line, ' ');
- pos2 = index(pos1+1, ' ');
- pattern = pos1+1;
- *pos2 = '\0';
- module = pos2+1;
-
- if(!fnmatch(pattern, argv[2], 0))
- printf("%s\n", module);
- }
- }
- return 0;
-}