getht-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getht-commit] arch commit: getht--mainline--0.1--patch-43


From: Nick
Subject: [Getht-commit] arch commit: getht--mainline--0.1--patch-43
Date: Thu, 1 May 2008 03:33:39 +0100
User-agent: Mutt/1.5.16 (2007-06-09)

Revision: getht--mainline--0.1--patch-43
Archive: address@hidden
Creator: Nick White <address@hidden>
Date: Thu May  1 03:32:40 BST 2008
Standard-date: 2008-05-01 02:32:40 GMT
Modified-files: src/config.c src/download.c src/getht.c
    src/getht.h
New-patches: address@hidden/getht--mainline--0.1--patch-43
Summary: Aesthetic: improved consistency of uri terminology
Keywords: 

Switched any references to 'url' to 'uri'

M  src/config.c
M  src/download.c
M  src/getht.c
M  src/getht.h

* modified files

--- orig/src/config.c
+++ mod/src/config.c
@@ -29,7 +29,7 @@
 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 @@
                        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 @@
                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)


--- orig/src/download.c
+++ mod/src/download.c
@@ -43,10 +43,10 @@
 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 @@
                        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 @@
                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 @@
        }
        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 @@
        return 0;
 }
 
-double getremotefilesize(CURL *curl_handle, char *url)
+double getremotefilesize(CURL *curl_handle, char *uri)
 {
        double filesize;
 
@@ -157,7 +157,7 @@
 
        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 */


--- orig/src/getht.c
+++ mod/src/getht.c
@@ -36,7 +36,7 @@
 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 @@
 
        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 @@
        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 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;


--- orig/src/getht.h
+++ mod/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"
 







reply via email to

[Prev in Thread] Current Thread [Next in Thread]