#include "conf.h"
#include "debug_print.h"
+#include "ad_ring.h"
// ミューテックス
static pthread_mutex_t mutex_conf = PTHREAD_MUTEX_INITIALIZER;
return linux_time_set;
}
+// 記録パス
+static char recpath[CONF_RECPATH_MAX];
+void conf_recpath_set(char *s)
+{
+ strncpy(recpath, s, sizeof(recpath));
+}
+char* conf_recpath_getp(void)
+{
+ return recpath;
+}
+
+// 記録CH
+static int recchnum;
+void conf_recchn_set(int chn)
+{
+ recchnum = chn;
+}
+int conf_recchn_get(void)
+{
+ return recchnum;
+}
+
//
/**** 設定ファイル *******************************************
*/
FILE *fp;
char buf[256];
// char buf2[256];
+ char buf2[CONF_RECPATH_MAX];
int f;
int val;
-
+
fp = fopen(CONF_FILE, "rt");
if (fp == NULL) {
syslog(LOG_ERR, "conf_read(): conf file not found. %s", CONF_FILE);
conf_linux_time_set_set(val);
syslog(LOG_INFO, "linux_time_set=%d", conf_linux_time_set_get());
}
+ // 記録パス
+ if (sscanf(buf, "rec_path = %s", buf2) == 1) {
+ trim_space(buf2);
+ conf_recpath_set(buf2);
+ syslog(LOG_INFO, "rec_path=%s", conf_recpath_getp());
+ }
+ // 記録CH
+ if (sscanf(buf, "rec_chn = %d", &f) == 1) {
+ if (f < 1 || f > AD_CHNUM) f = AD_CHNUM;
+ conf_recchn_set(f);
+ }
}
fclose(fp);
return 0;