mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-02 08:34:26 +08:00
Add create_name() helper function
This commit is contained in:
parent
f616523e5c
commit
ab767dcf7c
@ -88,6 +88,11 @@ int create_file(const char *filename, const mode_t mode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int create_name(char *buf, size_t size, char *address, char *name)
|
||||
{
|
||||
return snprintf(buf, size, "%s/%s/%s", STORAGEDIR, address, name);
|
||||
}
|
||||
|
||||
static inline char *find_key(char *map, const char *key, size_t len)
|
||||
{
|
||||
char *off = strstr(map, key);
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
int create_dirs(const char *filename, const mode_t mode);
|
||||
int create_file(const char *filename, const mode_t mode);
|
||||
int create_name(char *buf, size_t size, char *address, char *name);
|
||||
|
||||
int textfile_put(const char *pathname, const char *key, const char *value);
|
||||
int textfile_del(const char *pathname, const char *key);
|
||||
|
Loading…
Reference in New Issue
Block a user