Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
d7579087
Commit
d7579087
authored
21 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
use hugehelp.h to silence picky compiler warnings
parent
3415ac38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/hugehelp.h
+26
-0
26 additions, 0 deletions
src/hugehelp.h
src/main.c
+33
-35
33 additions, 35 deletions
src/main.c
src/mkhelp.pl
+1
-0
1 addition, 0 deletions
src/mkhelp.pl
with
60 additions
and
35 deletions
src/hugehelp.h
0 → 100644
+
26
−
0
View file @
d7579087
#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
This diff is collapsed.
Click to expand it.
src/main.c
+
33
−
35
View file @
d7579087
...
...
@@ -42,6 +42,7 @@
#include
"writeout.h"
#include
"getpass.h"
#include
"homedir.h"
#include
"hugehelp.h"
#ifdef USE_ENVIRONMENT
#include
"writeenv.h"
#endif
...
...
@@ -191,14 +192,12 @@ char *strdup(char *str)
#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
);
}
...
...
@@ -207,12 +206,12 @@ CURLcode main_init(void)
* 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
))
{
...
...
@@ -257,7 +256,7 @@ struct getout {
static
void
help
(
void
)
{
int
i
;
const
char
*
help
[]
=
{
static
const
char
*
help
text
[]
=
{
"Usage: curl [options...] <url>"
,
"Options: (H) means HTTP/HTTPS only, (F) means FTP only"
,
" -a/--append Append to target file when uploading (F)"
,
...
...
@@ -365,8 +364,8 @@ static void help(void)
" -#/--progress-bar Display transfer progress as a progress bar"
,
NULL
};
for
(
i
=
0
;
help
[
i
];
i
++
)
puts
(
help
[
i
]);
for
(
i
=
0
;
help
text
[
i
];
i
++
)
puts
(
help
text
[
i
]);
}
struct
LongShort
{
...
...
@@ -564,7 +563,7 @@ static char *file2memory(FILE *file, long *size)
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
;
...
...
@@ -583,7 +582,7 @@ void clean_getout(struct Configurable *config)
}
}
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
;
...
...
@@ -951,7 +950,6 @@ static const char *param2text(ParameterError error)
default:
return
"unknown error"
;
}
return
NULL
;
}
static
void
cleanarg
(
char
*
str
)
...
...
@@ -1032,7 +1030,7 @@ static void checkpasswd(const char *kind, /* for what purpose */
char
prompt
[
256
];
int
passwdlen
;
int
userlen
=
strlen
(
*
userpwd
);
char
*
ptr
;
char
*
pass
ptr
;
/* build a nice-looking prompt */
curl_msnprintf
(
prompt
,
sizeof
(
prompt
),
...
...
@@ -1043,16 +1041,16 @@ static void checkpasswd(const char *kind, /* for what purpose */
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 are
a
to fit the password too */
pass
ptr
=
realloc
(
*
userpwd
,
passwdlen
+
1
+
/* an extra for the colon */
userlen
+
1
);
/* an extra for the zero */
if
(
ptr
)
{
if
(
pass
ptr
)
{
/* append the password separated with a colon */
ptr
[
userlen
]
=
':'
;
memcpy
(
&
ptr
[
userlen
+
1
],
passwd
,
passwdlen
+
1
);
*
userpwd
=
ptr
;
pass
ptr
[
userlen
]
=
':'
;
memcpy
(
&
pass
ptr
[
userlen
+
1
],
passwd
,
passwdlen
+
1
);
*
userpwd
=
pass
ptr
;
}
}
}
...
...
@@ -2190,7 +2188,7 @@ struct OutStruct {
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
;
...
...
@@ -2236,7 +2234,7 @@ struct InStruct {
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
;
...
...
@@ -2283,14 +2281,14 @@ struct ProgressData {
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 inherit
e
s some of his concepts. */
and this new edition inherits some of his concepts. */
char
line
[
256
];
char
outline
[
256
];
...
...
@@ -2307,7 +2305,7 @@ int myprogress (void *clientp,
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
)
{
...
...
@@ -2476,7 +2474,7 @@ int my_trace(CURL *handle, curl_infotype type,
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
);
...
...
@@ -3018,8 +3016,8 @@ operate(struct Configurable *config, int argc, char *argv[])
}
if
(
httpgetfields
)
{
/* Find out whether the url contains a file name */
char
*
pc
=
strstr
(
url
,
"://"
);
char
sep
arator
=
'?'
;
const
char
*
pc
=
strstr
(
url
,
"://"
);
char
sep
=
'?'
;
if
(
pc
)
pc
+=
3
;
else
...
...
@@ -3032,8 +3030,8 @@ operate(struct Configurable *config, int argc, char *argv[])
if
(
strchr
(
pc
,
'?'
))
/* Ouch, there's already a question mark in the URL string, we
then appe
a
d the data with an amperand separator instead! */
sep
arator
=
'&'
;
then appe
n
d the data with an amper
s
and separator instead! */
sep
=
'&'
;
}
/*
* Then append ? followed by the get fields to the url.
...
...
@@ -3044,7 +3042,7 @@ operate(struct Configurable *config, int argc, char *argv[])
return
CURLE_OUT_OF_MEMORY
;
}
if
(
pc
)
sprintf
(
urlbuffer
,
"%s%c%s"
,
url
,
sep
arator
,
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
...
...
This diff is collapsed.
Click to expand it.
src/mkhelp.pl
+
1
−
0
View file @
d7579087
...
...
@@ -112,6 +112,7 @@ print <<HEAD
* NEVER EVER edit this manually, fix the mkhelp.pl script instead!
* Generation time: $now
*/
#include "hugehelp.h"
#include <stdio.h>
HEAD
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment