mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 06:11:46 +00:00
[c-host] linux: implemented getValues
support for shmDevice option
This commit is contained in:
parent
e22f33a44b
commit
b662128708
2 changed files with 8 additions and 6 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
a12-184-g5d69d2aba9+1
|
||||
a12-185-ge22f33a44b+1
|
|
@ -141,12 +141,13 @@ static bool shmDeviceValidator(struct Option * opt, const char ** error)
|
|||
return true;
|
||||
}
|
||||
|
||||
static void shmDevicePrintHelp()
|
||||
static StringList shmDeviceGetValues(struct Option * option)
|
||||
{
|
||||
printf("Valid devices are:\n\n");
|
||||
StringList sl = stringlist_new(true);
|
||||
|
||||
DIR * d = opendir("/sys/class/uio");
|
||||
if (!d)
|
||||
return;
|
||||
return sl;
|
||||
|
||||
struct dirent * dir;
|
||||
while((dir = readdir(d)) != NULL)
|
||||
|
@ -159,12 +160,13 @@ static void shmDevicePrintHelp()
|
|||
continue;
|
||||
|
||||
if (strcmp(name, "KVMFR") == 0)
|
||||
printf(" * %s\n", dir->d_name);
|
||||
stringlist_push(sl, strdup(dir->d_name));
|
||||
|
||||
free(name);
|
||||
}
|
||||
|
||||
closedir(d);
|
||||
return sl;
|
||||
}
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
|
@ -180,7 +182,7 @@ int main(int argc, char * argv[])
|
|||
.type = OPTION_TYPE_STRING,
|
||||
.value.x_string = "uio0",
|
||||
.validator = shmDeviceValidator,
|
||||
.printHelp = shmDevicePrintHelp
|
||||
.getValues = shmDeviceGetValues
|
||||
},
|
||||
{0}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue