diff options
author | Nick White <arch@njw.me.uk> | 2008-05-03 01:28:13 +0000 |
---|---|---|
committer | Nick White <arch@njw.me.uk> | 2008-05-03 01:28:13 +0000 |
commit | 3487cada8f2ec50b20ccf919d36df211030f1088 (patch) | |
tree | 81579027fdf753374e5f23fefa374afeba40b040 | |
parent | 3b5e0ddd46a8f4034b7e8aaebd4cdadce2d54828 (diff) |
Changed a couple of configuration variable names
Altered name of issuepath config variable to savepath, in config.ini as well as code
Altered name of issue_xml config variable to toc_xml
Removed unnecessary variable definitions from header
git-archimport-id: getht@sv.gnu.org/getht--mainline--0.1--patch-49
-rw-r--r-- | doc/getht.man | 2 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/config.c | 14 | ||||
-rw-r--r-- | src/getht.c | 10 | ||||
-rw-r--r-- | src/getht.h | 3 |
5 files changed, 14 insertions, 17 deletions
diff --git a/doc/getht.man b/doc/getht.man index e41ce2c..f3aa54f 100644 --- a/doc/getht.man +++ b/doc/getht.man @@ -83,7 +83,7 @@ with commented lines starting with a # The following options may be set. .TP -.B issuepath +.B savepath Stores the path in which all issues will be saved The default setting is \fB~/hinduism_today/\fR .TP diff --git a/src/Makefile.am b/src/Makefile.am index e6b2bc1..254ac6b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,4 +4,4 @@ bin_PROGRAMS = getht getht_SOURCES = config.c cli.c download.c getht.c issuemem.c \ tocxml.c xml.c \ - getht.h issue.h version.h + config.h getht.h issue.h version.h diff --git a/src/config.c b/src/config.c index f0545d3..e89bc94 100644 --- a/src/config.c +++ b/src/config.c @@ -33,7 +33,7 @@ extern char proxy_user[STR_MAX]; extern char proxy_pass[STR_MAX]; extern char issue_uri[STR_MAX]; -int loadconfig(char * htde_path, char * issue_path, int * update) +int loadconfig(char * htde_path, char * save_path, int * update) /* Loads variables from config file to extern and passed * variables. */ { @@ -54,8 +54,8 @@ int loadconfig(char * htde_path, char * issue_path, int * update) fscanf(config_file, "%s = %s", option, parameter); if(option[0] == '#'); /* ignore lines beginning with a hash */ - else if(!strcmp(option, "issuepath")) - strncpy(issue_path, parameter, STR_MAX); + else if(!strcmp(option, "savepath")) + strncpy(save_path, parameter, STR_MAX); else if(!strcmp(option, "startup_check")) *update = atoi(parameter); else if(!strcmp(option, "toc_uri")) @@ -101,7 +101,7 @@ int loadconfig(char * htde_path, char * issue_path, int * update) return 0; } -int writefreshconfig(char * htde_path, char * issue_path, int * update) +int writefreshconfig(char * htde_path, char * save_path, int * update) /* Write a new config file according to extern and passed variables. */ { FILE * config_file; @@ -117,8 +117,8 @@ int writefreshconfig(char * htde_path, char * issue_path, int * update) else fprintf(stdout,"Writing a fresh config file to %s.\n",filepath); - if(issue_path[0]) - fprintf(config_file, "%s = %s\n", "issuepath", issue_path); + if(save_path[0]) + fprintf(config_file, "%s = %s\n", "savepath", save_path); if(update) fprintf(config_file, "%s = %i\n", "startup_check", *update); if(issue_uri[0]) @@ -153,7 +153,7 @@ int writefreshconfig(char * htde_path, char * issue_path, int * update) return 0; } -int updateconfig(char * htde_path, char * issue_path, int * update) +int updateconfig(char * htde_path, char * save_path, int * update) /* Read existing config file, and rewrite any variables which differ * in memory. */ { diff --git a/src/getht.c b/src/getht.c index 644577e..e1aa847 100644 --- a/src/getht.c +++ b/src/getht.c @@ -35,7 +35,7 @@ int update_contents_files(); int proxy_type; char proxy_addr[STR_MAX]; long proxy_port; int proxy_auth; char proxy_user[STR_MAX]; char proxy_pass[STR_MAX]; -char issue_xml[STR_MAX]; +char toc_xml[STR_MAX]; char issue_uri[STR_MAX]; CURL *main_curl_handle; @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) scanf("%s", getht_path); } - snprintf(issue_xml,STR_MAX,"%s/%s",getht_path,ISS_XML_FILE); + snprintf(toc_xml,STR_MAX,"%s/%s",getht_path,ISS_XML_FILE); strncpy(issue_uri,XML_TOC_URI,STR_MAX); @@ -163,7 +163,7 @@ int main(int argc, char *argv[]) if(downissue || listissues) { - issue = parsetoc(issue_xml, &no_of_issues); + issue = parsetoc(toc_xml, &no_of_issues); if(!issue) { @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) printf("Cannot open contents file, trying to update contents\n"); if(update_contents_files()) return 1; - issue = parsetoc(issue_xml, &no_of_issues); + issue = parsetoc(toc_xml, &no_of_issues); } else { @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) int update_contents_files() /* Returns 0 on success, 1 on failure */ { - if(save_file(NULL, issue_uri, issue_xml, "contents", 0)) + if(save_file(NULL, issue_uri, toc_xml, "contents", 0)) return 1; else return 0; diff --git a/src/getht.h b/src/getht.h index ee5176a..8c09c3f 100644 --- a/src/getht.h +++ b/src/getht.h @@ -26,6 +26,3 @@ #define ISS_XML_FILE "htde_toc.xml" #define STR_MAX 512 - -char * proxytype; -char * proxyauth; |