automotive-dlt
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "dlt_common.h"
#include "dlt-control-common.h"
#include "dlt-logstorage-common.h"
Go to the source code of this file.
Data Structures | |
struct | LogstorageDeviceInfo |
Macros | |
#define | pr_fmt(fmt) "Log storage list: "fmt |
Functions | |
void | print_list () |
Prints the device list in verbose mode. More... | |
static struct LogstorageDeviceInfo * | logstorage_find_dev_info (const char *node) |
Find element in the list based on device node. More... | |
int | logstorage_store_dev_info (const char *node, const char *path) |
Add new device in the list. More... | |
char * | logstorage_delete_dev_info (const char *node) |
Remove a device from the list. More... | |
Variables | |
static struct LogstorageDeviceInfo * | g_info |
app begin@ Copyright (C) 2013 - 2015 Advanced Driver Information Technology. This code is developed by Advanced Driver Information Technology. Copyright of Advanced Driver Information Technology, Bosch and DENSO.
This file is part of GENIVI Project Dlt - Diagnostic Log and Trace console apps.
For further information see http://www.genivi.org/. end@
Definition in file dlt-logstorage-list.c.
#define pr_fmt | ( | fmt | ) | "Log storage list: "fmt |
Definition at line 57 of file dlt-logstorage-list.c.
char* logstorage_delete_dev_info | ( | const char * | node | ) |
Remove a device from the list.
If the device is removed from the list, the mount point pointer is given back to the caller. That means that he has to free it.
node | The device node to be removed |
Definition at line 197 of file dlt-logstorage-list.c.
References LogstorageDeviceInfo::dev_node, g_info, logstorage_find_dev_info(), LogstorageDeviceInfo::mnt_point, LogstorageDeviceInfo::next, NULL, pr_verbose, LogstorageDeviceInfo::prev, and print_list().
Referenced by check_mountpoint_from_partition().
|
static |
Find element in the list based on device node.
Allows to check whether a device is already in the list or to find out the one to be removed.
node | The device node to look for |
Definition at line 106 of file dlt-logstorage-list.c.
References LogstorageDeviceInfo::dev_node, DLT_MOUNT_PATH_MAX, g_info, LogstorageDeviceInfo::next, NULL, and pr_verbose.
Referenced by logstorage_delete_dev_info(), and logstorage_store_dev_info().
int logstorage_store_dev_info | ( | const char * | node, |
const char * | path | ||
) |
Add new device in the list.
The device is only added if a configuration file has been found and if it's not already in the list.
node | The device node to add |
path | The corresponding mount point path |
Definition at line 143 of file dlt-logstorage-list.c.
References LogstorageDeviceInfo::dev_node, DLT_MOUNT_PATH_MAX, g_info, logstorage_find_dev_info(), LogstorageDeviceInfo::mnt_point, LogstorageDeviceInfo::next, NULL, pr_error, pr_verbose, LogstorageDeviceInfo::prev, and print_list().
Referenced by check_mountpoint_from_partition().
void print_list | ( | ) |
Prints the device list in verbose mode.
This can be used to debug the behavior. Therefore, it's only available in verbose mode.
Definition at line 81 of file dlt-logstorage-list.c.
References LogstorageDeviceInfo::dev_node, g_info, LogstorageDeviceInfo::mnt_point, LogstorageDeviceInfo::next, NULL, and pr_verbose.
Referenced by logstorage_delete_dev_info(), and logstorage_store_dev_info().
|
static |
Referenced by logstorage_delete_dev_info(), logstorage_find_dev_info(), logstorage_store_dev_info(), and print_list().