OpenCBM
LINUX/configuration_name.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version
5  * 2 of the License, or (at your option) any later version.
6  *
7  * Copyright 2007 Spiro Trikaliotis
8  *
9 */
10 
20 #include "configuration.h"
21 #include "libmisc.h"
22 
23 #include <stdlib.h>
24 #include <assert.h>
25 #include <string.h>
26 
36 #define OPENCBM_DEFAULT_CONFIGURATION_FILE_NAME OPENCBM_CONFIG_FILE
37 
38 // Special case: config file location relative to OPENCBM_HOME environment variable
39 // This string get appended to the OPENCBM_HOME environment variable if it exists
40 #define OPENCBM_HOME_CONFIG_FILEPATH "/etc/opencbm.conf"
41 
49 const char *
51 {
52  char* opencbm_home = getenv("OPENCBM_HOME");
53  if (opencbm_home != NULL) {
54  return cbmlibmisc_strcat(opencbm_home, OPENCBM_HOME_CONFIG_FILEPATH);
55  }
57 }
char * cbmlibmisc_strdup(const char *const OldString)
Duplicate a given string.
Definition: libstring.c:84
Shared library / DLL for accessing the driver Read configuration file.
char * cbmlibmisc_strcat(const char *First, const char *Second)
Concatenate two strings.
Definition: libstring.c:202
#define OPENCBM_DEFAULT_CONFIGURATION_FILE_NAME
The name (including path) of the configuration file.
const char * configuration_get_default_filename(void)
Get the default filename for the configuration file.
Some functions for string handling.