libudev.c revision ee7122c0ec6aa11f02e9e8d94254b353f12d2c14
/***
This file is part of systemd.
Copyright 2008-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 <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include "libudev.h"
#include "libudev-private.h"
#include "missing.h"
/**
* SECTION:libudev
* @short_description: libudev context
*
* The context contains the default values read from the udev config file,
* and is passed to all library operations.
*/
/**
* udev:
*
* Opaque object representing the library context.
*/
struct udev {
int refcount;
void *userdata;
struct udev_list properties_list;
int log_priority;
};
const char *format, ...)
{
}
_printf_(6,0)
{
}
/**
* udev_get_userdata:
* @udev: udev library context
*
* Retrieve stored data pointer from library context. This might be useful
* to access from callbacks like a custom logging function.
*
* Returns: stored userdata
**/
{
return NULL;
}
/**
* udev_set_userdata:
* @udev: udev library context
* @userdata: data pointer
*
* Store custom @userdata in the library context.
**/
{
return;
}
/**
* udev_new:
*
* Create udev library context. This reads the udev configuration
* file, and fills in the default values.
*
* The initial refcount is 1, and needs to be decremented to
* release the resources of the udev library context.
*
* Returns: a new udev library context
**/
{
const char *env;
return NULL;
if (f != NULL) {
char line[UTIL_LINE_SIZE];
unsigned line_nr = 0;
char *key;
char *val;
line_nr++;
/* find key */
key++;
/* comment or empty line */
continue;
continue;
}
val[0] = '\0';
val++;
/* find value */
val++;
/* terminate key */
if (len == 0)
continue;
len--;
/* terminate value */
if (len == 0)
continue;
len--;
if (len == 0)
continue;
/* unquote */
continue;
}
val++;
}
int prio;
if (prio < 0)
else
continue;
}
}
}
/* environment overrides config */
int prio;
if (prio < 0)
else
}
return udev;
}
/**
* udev_ref:
* @udev: udev library context
*
* Take a reference of the udev library context.
*
* Returns: the passed udev library context
**/
{
return NULL;
return udev;
}
/**
* udev_unref:
* @udev: udev library context
*
* Drop a reference of the udev library context. If the refcount
* reaches zero, the resources of the context will be released.
*
* Returns: the passed udev library context if it has still an active reference, or #NULL otherwise.
**/
{
return NULL;
return udev;
return NULL;
}
/**
* udev_set_log_fn:
* @udev: udev library context
* @log_fn: function to be called for logging messages
*
* The built-in logging writes to stderr. It can be
* overridden by a custom function, to plug log messages
* into the users' logging functionality.
*
**/
{
}
/**
* udev_get_log_priority:
* @udev: udev library context
*
* The initial logging priority is read from the udev config file
* at startup.
*
* Returns: the current logging priority
**/
{
return udev->log_priority;
}
/**
* udev_set_log_priority:
* @udev: udev library context
* @priority: the new logging priority
*
* Set the current logging priority. The value controls which messages
* are logged.
**/
{
char num[32];
}
{
struct udev_list_entry *list_entry;
if (list_entry != NULL)
return NULL;
}
}
{
}