--- /dev/null
+#ifndef __HUGEHELP_H
+#define __HUGEHELP_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ * $Id$
+ ***************************************************************************/
+void hugehelp(void);
+#endif
#include "writeout.h"
#include "getpass.h"
#include "homedir.h"
+#include "hugehelp.h"
#ifdef USE_ENVIRONMENT
#include "writeenv.h"
#endif
#include "curlmsg_vms.h"
#endif
-extern void hugehelp(void);
-
/*
* This is the main global constructor for the app. Call this before
* _any_ libcurl usage. If this fails, *NO* libcurl functions may be
* used, or havoc may be the result.
*/
-CURLcode main_init(void)
+static CURLcode main_init(void)
{
return curl_global_init(CURL_GLOBAL_DEFAULT);
}
* This is the main global destructor for the app. Call this after
* _all_ libcurl usage is done.
*/
-void main_free(void)
+static void main_free(void)
{
curl_global_cleanup();
}
-int SetHTTPrequest(HttpReq req, HttpReq *store)
+static int SetHTTPrequest(HttpReq req, HttpReq *store)
{
if((*store == HTTPREQ_UNSPEC) ||
(*store == req)) {
static void help(void)
{
int i;
- const char *help[]={
+ static const char *helptext[]={
"Usage: curl [options...] <url>",
"Options: (H) means HTTP/HTTPS only, (F) means FTP only",
" -a/--append Append to target file when uploading (F)",
" -#/--progress-bar Display transfer progress as a progress bar",
NULL
};
- for(i=0; help[i]; i++)
- puts(help[i]);
+ for(i=0; helptext[i]; i++)
+ puts(helptext[i]);
}
struct LongShort {
return NULL; /* no string */
}
-void clean_getout(struct Configurable *config)
+static void clean_getout(struct Configurable *config)
{
struct getout *node=config->url_list;
struct getout *next;
}
}
-struct getout *new_getout(struct Configurable *config)
+static struct getout *new_getout(struct Configurable *config)
{
struct getout *node =malloc(sizeof(struct getout));
struct getout *last= config->url_last;
default:
return "unknown error";
}
- return NULL;
}
static void cleanarg(char *str)
char prompt[256];
int passwdlen;
int userlen = strlen(*userpwd);
- char *ptr;
+ char *passptr;
/* build a nice-looking prompt */
curl_msnprintf(prompt, sizeof(prompt),
getpass_r(prompt, passwd, sizeof(passwd));
passwdlen = strlen(passwd);
- /* extend the allocated memory are to fit the password too */
- ptr = realloc(*userpwd,
- passwdlen + 1 + /* an extra for the colon */
- userlen + 1); /* an extra for the zero */
+ /* extend the allocated memory area to fit the password too */
+ passptr = realloc(*userpwd,
+ passwdlen + 1 + /* an extra for the colon */
+ userlen + 1); /* an extra for the zero */
- if(ptr) {
+ if(passptr) {
/* append the password separated with a colon */
- ptr[userlen]=':';
- memcpy(&ptr[userlen+1], passwd, passwdlen+1);
- *userpwd = ptr;
+ passptr[userlen]=':';
+ memcpy(&passptr[userlen+1], passwd, passwdlen+1);
+ *userpwd = passptr;
}
}
}
struct Configurable *config;
};
-int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream)
+static int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream)
{
int rc;
struct OutStruct *out=(struct OutStruct *)stream;
struct Configurable *config;
};
-int my_fread(void *buffer, size_t size, size_t nmemb, void *userp)
+static int my_fread(void *buffer, size_t size, size_t nmemb, void *userp)
{
struct InStruct *in=(struct InStruct *)userp;
curl_off_t initial_size;
};
-int myprogress (void *clientp,
- double dltotal,
- double dlnow,
- double ultotal,
- double ulnow)
+static int myprogress (void *clientp,
+ double dltotal,
+ double dlnow,
+ double ultotal,
+ double ulnow)
{
/* The original progress-bar source code was written for curl by Lars Aas,
- and this new edition inherites some of his concepts. */
+ and this new edition inherits some of his concepts. */
char line[256];
char outline[256];
bar->calls++; /* simply count invokes */
- if(0 == total) {
+ if(total < 1) {
int prevblock = (int)bar->prev / 1024;
int thisblock = (int)point / 1024;
while ( thisblock > prevblock ) {
return 0;
}
-void free_config_fields(struct Configurable *config)
+static void free_config_fields(struct Configurable *config)
{
if(config->random_file)
free(config->random_file);
}
if (httpgetfields) {
/* Find out whether the url contains a file name */
- char *pc =strstr(url, "://");
- char separator='?';
+ const char *pc =strstr(url, "://");
+ char sep='?';
if(pc)
pc+=3;
else
if(strchr(pc, '?'))
/* Ouch, there's already a question mark in the URL string, we
- then appead the data with an amperand separator instead! */
- separator='&';
+ then append the data with an ampersand separator instead! */
+ sep='&';
}
/*
* Then append ? followed by the get fields to the url.
return CURLE_OUT_OF_MEMORY;
}
if (pc)
- sprintf(urlbuffer, "%s%c%s", url, separator, httpgetfields);
+ sprintf(urlbuffer, "%s%c%s", url, sep, httpgetfields);
else
/* Append / before the ? to create a well-formed url
if the url contains a hostname only