udevadm.c revision e598c5738c2dc85a3e93c3f68cd88e8eea51215b
/*
* Copyright (C) 2007-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 <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <errno.h>
#include <getopt.h>
#include "udev.h"
static int debug;
{
if (debug) {
} else {
}
}
struct command {
const char *name;
const char *help;
int debug;
};
{
return 0;
}
{
printf("Usage: udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]\n");
printf("\n");
return 0;
}
{
.name = "info",
.cmd = udevadm_info,
.help = "query sysfs or the udev database",
},
{
.name = "trigger",
.cmd = udevadm_trigger,
.help = "request events from the kernel",
},
{
.name = "settle",
.help = "wait for the event queue to finish",
},
{
.name = "control",
.cmd = udevadm_control,
.help = "control the udev daemon",
},
{
.name = "monitor",
.cmd = udevadm_monitor,
.help = "listen to kernel and udev events",
},
{
.name = "test",
.cmd = udevadm_test,
.help = "simulation run",
.debug = 1,
},
{
.name = "version",
},
{
.name = "help",
},
{}
};
{
debug = 1;
}
}
{
{}
};
const char *command;
int i;
const char *pos;
int rc = 1;
goto out;
logging_init("udevadm");
sysfs_init();
/* see if we are a compat link, this will be removed in a future release */
/* the trailing part of the binary or link name is the command */
char path[128];
char prog[512];
if (len > 0) {
}
goto out;
}
}
while (1) {
int option;
if (option == -1)
break;
switch (option) {
case 'd':
debug = 1;
break;
case 'h':
goto out;
case 'V':
goto out;
default:
goto out;
}
}
optind++;
goto out;
}
}
rc = 2;
out:
return rc;
}