#include "files/cfgreader.h"
+#ifndef UCLINUX
+
/* Read configuration information from a ".INI" style file */
-struct CFG_Header *CFG_ReadFile(char *filename)
+static struct CFG_Header *CFG_ReadFile(char *filename)
{
FILE *handle;
char *line;
/* Write configuration information to a config file */
-int CFG_WriteFile(struct CFG_Header *cfg, char *filename)
+static int CFG_WriteFile(struct CFG_Header *cfg, char *filename)
{
/* Not implemented - tricky to do and preserve comments */
/* Set the value of a key in a config file. Return the new value if
the section/key can be found, else return NULL. */
-char *CFG_Set(struct CFG_Header *cfg, char *section, char *key,
+static char *CFG_Set(struct CFG_Header *cfg, char *section, char *key,
char *value)
{
struct CFG_Header *h;
return cfg_info;
}
+#endif /* UCLINUX */
+
int CFG_ReadConfig(char **model, char **port, char **initlength,
- char **connection, char **bindir, char **synchronizetime,
+ char **connection, char **bindir,
bool isgnokiid)
{
+#ifdef UCLINUX
+
+ *model=strdup(CONFIG_CFG_MODEL);
+ *port=strdup(CONFIG_CFG_PORT);
+ *initlength=strdup(CONFIG_CFG_INITLENGTH);
+ *connection=strdup("fbus");
+ *bindir=NULL;
+
+#else /* UCLINUX */
struct CFG_Header *cfg_info;
#ifdef WIN32
char *DefaultPort = "com2:";
char *DefaultModel = "auto";
char *DefaultConnection = "fbus";
char *DefaultBindir = "/usr/local/sbin/";
- char *DefaultSynchronizeTime = "yes";
char *DefaultInitLength = "30";
char *section = "global";
(char *)*port = DefaultPort;
(char *)*connection = DefaultConnection;
(char *)*bindir = DefaultBindir;
- (char *)*synchronizetime = DefaultSynchronizeTime;
(char *)*initlength = DefaultInitLength;
cfg_info=CFG_FindGnokiirc();
(char *)*bindir = CFG_Get(cfg_info, section, "bindir");
if (!*bindir) (char *)*bindir = DefaultBindir;
- (char *)*synchronizetime = CFG_Get(cfg_info, section, "synchronizetime");
- if (!*synchronizetime) (char *)*synchronizetime = DefaultSynchronizeTime;
-
(char *)*initlength = CFG_Get(cfg_info, section, "initlength");
if (!*initlength) (char *)*initlength = "default";
+#endif /* UCLINUX */
return 0;
}