summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/config.c10
-rw-r--r--src/download.c16
-rw-r--r--src/getht.c8
-rw-r--r--src/getht.h4
4 files changed, 19 insertions, 19 deletions
diff --git a/src/config.c b/src/config.c
index 714bbf9..778ad3b 100644
--- a/src/config.c
+++ b/src/config.c
@@ -29,7 +29,7 @@ extern long proxy_port;
extern proxyauth proxy_auth;
extern char proxy_user[STR_MAX];
extern char proxy_pass[STR_MAX];
-extern char issue_url[STR_MAX];
+extern char issue_uri[STR_MAX];
int loadconfig(char * htde_path, char * issue_path, int * update)
/* Loads variables from config file to extern and passed
@@ -56,8 +56,8 @@ int loadconfig(char * htde_path, char * issue_path, int * update)
strncpy(issue_path, parameter, STR_MAX);
else if(!strcmp(option, "startup_check"))
*update = atoi(parameter);
- else if(!strcmp(option, "toc_url"))
- strncpy(issue_url, parameter, STR_MAX);
+ else if(!strcmp(option, "toc_uri"))
+ strncpy(issue_uri, parameter, STR_MAX);
else if(!strcmp(option, "proxy_type"))
{
if(!strcmp(parameter, "http"))
@@ -119,8 +119,8 @@ int writefreshconfig(char * htde_path, char * issue_path, int * update)
fprintf(config_file, "%s = %s\n", "issuepath", issue_path);
if(update)
fprintf(config_file, "%s = %i\n", "startup_check", *update);
- if(issue_url[0])
- fprintf(config_file, "%s = %s\n", "toc_url", issue_url);
+ if(issue_uri[0])
+ fprintf(config_file, "%s = %s\n", "toc_uri", issue_uri);
if(proxy_type != NONE)
{
if(proxy_type = HTTP)
diff --git a/src/download.c b/src/download.c
index 0e2e23f..948b289 100644
--- a/src/download.c
+++ b/src/download.c
@@ -43,10 +43,10 @@ extern char proxy_user[STR_MAX];
extern char proxy_pass[STR_MAX];
extern CURL *main_curl_handle;
-int save_file(CURL *curl_handle, char *url, char *filepath, long resume_offset)
-/* Save the file *url to *filepath */
+int save_file(CURL *curl_handle, char *uri, char *filepath, long resume_offset)
+/* Save the file *uri to *filepath */
{
- printf("Downloading %s\n",url);
+ printf("Downloading %s\n",uri);
if(!curl_handle)
curl_handle = main_curl_handle;
@@ -60,7 +60,7 @@ int save_file(CURL *curl_handle, char *url, char *filepath, long resume_offset)
return 1;
}
- curl_easy_setopt(curl_handle, CURLOPT_URL, url);
+ curl_easy_setopt(curl_handle, CURLOPT_URL, uri);
curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, read_func);
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_func);
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, file);
@@ -110,7 +110,7 @@ int save_file(CURL *curl_handle, char *url, char *filepath, long resume_offset)
if(curl_easy_perform(curl_handle))
{
remove(filepath);
- fprintf(stderr,"\nError, could not download %s: %s\n",url, errorinfo);
+ fprintf(stderr,"\nError, could not download %s: %s\n",uri, errorinfo);
return 1;
}
@@ -120,7 +120,7 @@ int save_file(CURL *curl_handle, char *url, char *filepath, long resume_offset)
}
else {
fprintf(stderr,"Error: curl failed to initialise.\n");
- printf("Could not download %s\n",url);
+ printf("Could not download %s\n",uri);
return 1;
}
return 0;
@@ -148,7 +148,7 @@ int update_progress(void *data, double dltotal, double dlnow,
return 0;
}
-double getremotefilesize(CURL *curl_handle, char *url)
+double getremotefilesize(CURL *curl_handle, char *uri)
{
double filesize;
@@ -157,7 +157,7 @@ double getremotefilesize(CURL *curl_handle, char *url)
if(curl_handle) {
- curl_easy_setopt(curl_handle, CURLOPT_URL, url);
+ curl_easy_setopt(curl_handle, CURLOPT_URL, uri);
curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, read_func);
/* don't download or return either body or header */
diff --git a/src/getht.c b/src/getht.c
index 7076882..3df802c 100644
--- a/src/getht.c
+++ b/src/getht.c
@@ -36,7 +36,7 @@ proxytype proxy_type; char proxy_addr[STR_MAX]; long proxy_port;
proxyauth proxy_auth;
char proxy_user[STR_MAX]; char proxy_pass[STR_MAX];
char issue_xml[STR_MAX];
-char issue_url[STR_MAX];
+char issue_uri[STR_MAX];
CURL *main_curl_handle;
int main(int argc, char *argv[])
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
snprintf(issue_xml,STR_MAX,"%s/%s",getht_path,ISS_XML_FILE);
- strncpy(issue_url,XML_TOC_URL,STR_MAX);
+ strncpy(issue_uri,XML_TOC_URI,STR_MAX);
snprintf(save_path,STR_MAX,"%s/hinduism_today",getenv("HOME"));
@@ -75,7 +75,7 @@ int main(int argc, char *argv[])
proxy_pass[0] = '\0';
if(loadconfig(getht_path, &save_path, &update) != 0)
- writefreshconfig(getht_path, &save_path, &update, &issue_url);
+ writefreshconfig(getht_path, &save_path, &update, &issue_uri);
if(!opendir(save_path))
if(mkdir(save_path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH))
@@ -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_url, issue_xml, 0))
+ if(save_file(NULL, issue_uri, issue_xml, 0))
return 1;
else
return 0;
diff --git a/src/getht.h b/src/getht.h
index 57c2ac9..c5f0728 100644
--- a/src/getht.h
+++ b/src/getht.h
@@ -18,10 +18,10 @@
*
*/
-#define XML_TOC_URL "http://www.hinduismtoday.com/digital/htde_toc.xml"
+#define XML_TOC_URI "http://www.hinduismtoday.com/digital/htde_toc.xml"
/* currently unused - see 0.1 patch-30 for latest version parsing media */
-#define MEDIA_TOC_URL "http://www.hinduismtoday.com/digital/htde_media-player.rev.gz"
+#define MEDIA_TOC_URI "http://www.hinduismtoday.com/digital/htde_media-player.rev.gz"
#define ISS_XML_FILE "htde_toc.xml"