libudev.c revision cf0fbc49e67b55f8d346fc94de28c90113505297
/***
This file is part of systemd.
Copyright 2008-2014 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 <ctype.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "fd-util.h"
#include "libudev-private.h"
#include "libudev.h"
#include "missing.h"
#include "string-util.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;
};
/**
* udev_get_userdata:
* @udev: udev library context
*
* Retrieve stored data pointer from library context. This might be useful
* to access from callbacks.
*
* 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
**/
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;
}
}
}
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 log messages
*
* This function is deprecated.
*
**/
return;
}
/**
* udev_get_log_priority:
* @udev: udev library context
*
* This function is deprecated.
*
**/
return log_get_max_level();
}
/**
* udev_set_log_priority:
* @udev: udev library context
* @priority: the new log priority
*
* This function is deprecated.
*
**/
}