device: constify string args

pull/1784/head
Victor Julien 10 years ago
parent d87a60f3cc
commit 7b45a8a2a9

@ -42,7 +42,7 @@ static int live_devices_stats = 1;
* \retval 0 on success.
* \retval -1 on failure.
*/
int LiveRegisterDevice(char *dev)
int LiveRegisterDevice(const char *dev)
{
LiveDevice *pd = SCMalloc(sizeof(LiveDevice));
if (unlikely(pd == NULL)) {
@ -113,7 +113,7 @@ char *LiveGetDeviceName(int number)
* \retval ptr pointer to the string containing the device
* \retval NULL on error
*/
LiveDevice *LiveGetDevice(char *name)
LiveDevice *LiveGetDevice(const char *name)
{
int i = 0;
LiveDevice *pd;
@ -136,12 +136,12 @@ LiveDevice *LiveGetDevice(char *name)
int LiveBuildDeviceList(char * runmode)
int LiveBuildDeviceList(const char *runmode)
{
return LiveBuildDeviceListCustom(runmode, "interface");
}
int LiveBuildDeviceListCustom(char * runmode, char * itemname)
int LiveBuildDeviceListCustom(const char *runmode, const char *itemname)
{
ConfNode *base = ConfGetNode(runmode);
ConfNode *child;

@ -32,14 +32,14 @@ typedef struct LiveDevice_ {
} LiveDevice;
int LiveRegisterDevice(char *dev);
int LiveRegisterDevice(const char *dev);
int LiveGetDeviceCount(void);
char *LiveGetDeviceName(int number);
LiveDevice *LiveGetDevice(char *dev);
int LiveBuildDeviceList(char * base);
LiveDevice *LiveGetDevice(const char *dev);
int LiveBuildDeviceList(const char *base);
void LiveDeviceHasNoStats(void);
int LiveDeviceListClean(void);
int LiveBuildDeviceListCustom(char * base, char * itemname);
int LiveBuildDeviceListCustom(const char *base, const char *itemname);
#ifdef BUILD_UNIX_SOCKET
TmEcode LiveDeviceIfaceStat(json_t *cmd, json_t *server_msg, void *data);

Loading…
Cancel
Save