test-libudev.c revision 04f5d75f0cfaf82e1bbdec5e398e95b3d6f3f16d
/*
* test-libudev
*
* Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <getopt.h>
#include <syslog.h>
#include <fcntl.h>
#include "libudev.h"
{
}
{
const char *str;
int count;
count = 0;
count++;
}
count = 0;
count++;
}
printf("\n");
}
{
struct udev_device *device;
printf("no device\n");
return -1;
}
return 0;
}
{
struct udev_device *device;
struct udev_device *device_parent;
return -1;
printf("looking at parents\n");
do {
} while (device_parent != NULL);
printf("looking at parents again\n");
do {
} while (device_parent != NULL);
return 0;
}
{
struct udev_device *device;
return -1;
return 0;
}
{
struct udev_enumerate *enumerate;
int count = 0;
return -1;
struct udev_device *device;
printf("device: '%s' (%s) '%s'\n",
count++;
}
}
return count;
}
{
struct udev_monitor *udev_monitor;
int fd;
if (udev_monitor == NULL) {
printf("no socket\n");
return -1;
}
if (udev_monitor_enable_receiving(udev_monitor) < 0) {
printf("bind failed\n");
return -1;
}
while (1) {
struct udev_device *device;
int fdcount;
printf("no device from socket\n");
continue;
}
}
printf("exiting loop\n");
break;
}
}
return 0;
}
{
{}
};
char path[1024];
const char *str;
printf("no context\n");
return 1;
}
while (1) {
int option;
if (option == -1)
break;
switch (option) {
case 'p':
break;
case 's':
break;
case 'S':
break;
case 'd':
break;
case 'h':
printf("--debug --syspath= --subsystem= --socket= --help\n");
goto out;
case 'V':
goto out;
default:
goto out;
}
}
/* add sys path if needed */
}
out:
return 0;
}