udev-builtin.c revision 2eec67acbb00593e414549a7e5b35eb7dd776b1b
/***
This file is part of systemd.
Copyright 2007-2012 Kay Sievers <kay@vrfy.org>
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdio.h>
#include <string.h>
#include <getopt.h>
#include "udev.h"
static bool initialized;
static const struct udev_builtin *builtins[] = {
#ifdef HAVE_BLKID
#endif
#ifdef HAVE_KMOD
#endif
#ifdef HAVE_ACL
#endif
};
unsigned int i;
if (initialized)
return;
for (i = 0; i < ELEMENTSOF(builtins); i++)
initialized = true;
}
unsigned int i;
if (!initialized)
return;
for (i = 0; i < ELEMENTSOF(builtins); i++)
initialized = false;
}
unsigned int i;
for (i = 0; i < ELEMENTSOF(builtins); i++)
return true;
return false;
}
unsigned int i;
for (i = 0; i < ELEMENTSOF(builtins); i++)
}
}
}
char name[UTIL_PATH_SIZE];
enum udev_builtin_cmd i;
char *pos;
if (pos)
pos[0] = '\0';
for (i = 0; i < ELEMENTSOF(builtins); i++)
return i;
return UDEV_BUILTIN_MAX;
}
int udev_builtin_run(struct udev_device *dev, enum udev_builtin_cmd cmd, const char *command, bool test) {
char arg[UTIL_PATH_SIZE];
int argc;
char *argv[128];
/* we need '0' here to reset the internal state */
optind = 0;
}
int udev_builtin_add_property(struct udev_device *dev, bool test, const char *key, const char *val) {
struct udev_list_entry *entry;
/* store in db, skip private keys */
if (key[0] != '.')
udev_list_entry_set_num(entry, true);
if (test)
return 0;
}