Permalink
Browse files

Internal symbols that aren't static are now prefixed with 'Curl_'

  • Loading branch information...
1 parent 9f9cac7 commit 4031104404c6ceed5e57134125dcdb6cac51c564 @bagder bagder committed Jan 5, 2001
Showing with 670 additions and 593 deletions.
  1. +5 −0 CHANGES
  2. +7 −0 docs/INTERNALS
  3. +4 −2 include/curl/curl.h
  4. +20 −18 include/curl/mprintf.h
  5. +2 −0 lib/arpa_telnet.h
  6. +2 −2 lib/base64.c
  7. +2 −1 lib/base64.h
  8. +11 −10 lib/cookie.c
  9. +5 −5 lib/cookie.h
  10. +2 −2 lib/dict.c
  11. +2 −2 lib/dict.h
  12. +1 −2 lib/download.c
  13. +12 −8 lib/download.h
  14. +7 −7 lib/file.c
  15. +20 −32 lib/formdata.c
  16. +9 −13 lib/formdata.h
  17. +92 −42 lib/ftp.c
  18. +10 −3 lib/ftp.h
  19. +1 −0 lib/getenv.c
  20. +1 −2 lib/getenv.h
  21. +21 −21 lib/highlevel.c
  22. +9 −6 lib/hostip.c
  23. +3 −1 lib/hostip.h
  24. +176 −33 lib/http.c
  25. +6 −6 lib/http.h
  26. +1 −1 lib/if2ip.c
  27. +2 −2 lib/if2ip.h
  28. +20 −15 lib/krb4.c
  29. +3 −3 lib/ldap.c
  30. +2 −2 lib/ldap.h
  31. +1 −1 lib/memdebug.c
  32. +13 −13 lib/mprintf.c
  33. +4 −4 lib/netrc.c
  34. +3 −3 lib/netrc.h
  35. +19 −19 lib/progress.c
  36. +8 −8 lib/progress.h
  37. +26 −16 lib/security.c
  38. +9 −133 lib/sendf.c
  39. +11 −12 lib/sendf.h
  40. +5 −5 lib/speedcheck.c
  41. +3 −3 lib/speedcheck.h
  42. +8 −6 lib/ssluse.c
  43. +1 −4 lib/ssluse.h
  44. +2 −2 lib/strequal.c
  45. +5 −2 lib/strequal.h
  46. +16 −7 lib/telnet.c
  47. +2 −2 lib/telnet.h
  48. +3 −3 lib/timeval.c
  49. +3 −3 lib/timeval.h
  50. +55 −91 lib/url.c
  51. +2 −1 lib/url.h
  52. +12 −13 lib/version.c
  53. +1 −1 src/main.c
View
@@ -6,6 +6,11 @@
History of Changes
+Daniel (5 January 2001)
+- The krb4 support was broken in the release. Fixed now.
+
+- Huge internal symbol rename operation.
+
Version 7.5.2
Daniel (4 January 2001)
View
@@ -12,6 +12,13 @@ INTERNALS
Thus, the largest amount of code and complexity is in the library part.
+SYMBOLS
+=======
+ All symbols used internally must use a 'Curl_' prefix if they're used in
+ more than a single file. Single file symbols must be made static. Public
+ symbols must use a 'curl_' prefix. (There are exceptions, but they are
+ destined to change to this pattern in the future.)
+
CVS
===
View
@@ -435,8 +435,10 @@ typedef enum {
NOTE: they return TRUE if the strings match *case insensitively*.
*/
-extern int (strequal)(const char *s1, const char *s2);
-extern int (strnequal)(const char *s1, const char *s2, size_t n);
+extern int (Curl_strequal)(const char *s1, const char *s2);
+extern int (Curl_strnequal)(const char *s1, const char *s2, size_t n);
+#define strequal(a,b) Curl_strequal(a,b)
+#define strnequal(a,b,c) Curl_strnequal(a,b,c)
/* external form function */
int curl_formparse(char *string,
View
@@ -55,26 +55,28 @@
#include <stdarg.h>
-int mprintf(const char *format, ...);
-int mfprintf(FILE *fd, const char *format, ...);
-int msprintf(char *buffer, const char *format, ...);
-int msnprintf(char *buffer, size_t maxlength, const char *format, ...);
-int mvprintf(const char *format, va_list args);
-int mvfprintf(FILE *fd, const char *format, va_list args);
-int mvsprintf(char *buffer, const char *format, va_list args);
-int mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args);
-char *maprintf(const char *format, ...);
-char *mvaprintf(const char *format, va_list args);
+int Curl_mprintf(const char *format, ...);
+int Curl_mfprintf(FILE *fd, const char *format, ...);
+int Curl_msprintf(char *buffer, const char *format, ...);
+int Curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...);
+int Curl_mvprintf(const char *format, va_list args);
+int Curl_mvfprintf(FILE *fd, const char *format, va_list args);
+int Curl_mvsprintf(char *buffer, const char *format, va_list args);
+int Curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args);
+char *Curl_maprintf(const char *format, ...);
+char *Curl_mvaprintf(const char *format, va_list args);
#ifdef _MPRINTF_REPLACE
-# define printf mprintf
-# define fprintf mfprintf
-# define sprintf msprintf
-# define snprintf msnprintf
-# define vprintf mvprintf
-# define vfprintf mvfprintf
-# define vsprintf mvsprintf
-# define vsnprintf mvsnprintf
+# define printf Curl_mprintf
+# define fprintf Curl_mfprintf
+# define sprintf Curl_msprintf
+# define snprintf Curl_msnprintf
+# define vprintf Curl_mvprintf
+# define vfprintf Curl_mvfprintf
+# define vsprintf Curl_mvsprintf
+# define vsnprintf Curl_mvsnprintf
+# define aprintf Curl_maprintf
+# define vaprintf Curl_mvaprintf
#endif
#endif /* H_MPRINTF */
View
@@ -63,6 +63,7 @@
#define SYNCH 242 /* for telfunc calls */
#ifdef TELCMDS
+static
char *telcmds[] = {
"EOF", "SUSP", "ABORT", "EOR",
"SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
@@ -124,6 +125,7 @@ extern char *telcmds[];
#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
#ifdef TELOPTS
+static
char *telopts[NTELOPTS+1] = {
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
View
@@ -55,7 +55,7 @@ static int pos(char c)
}
#if 1
-int base64_encode(const void *data, int size, char **str)
+int Curl_base64_encode(const void *data, int size, char **str)
{
char *s, *p;
int i;
@@ -93,7 +93,7 @@ int base64_encode(const void *data, int size, char **str)
}
#endif
-int base64_decode(const char *str, void *data)
+int Curl_base64_decode(const char *str, void *data)
{
const char *p;
unsigned char *q;
View
@@ -34,6 +34,7 @@
#ifndef __BASE64_H
#define __BASE64_H
-int base64_encode(const void *data, int size, char **str);
+int Curl_base64_encode(const void *data, int size, char **str);
+int Curl_base64_decode(const char *str, void *data);
#endif
View
@@ -100,9 +100,10 @@ Example set of cookies:
*
***************************************************************************/
-struct Cookie *cookie_add(struct CookieInfo *c,
- bool httpheader, /* TRUE if HTTP header-style line */
- char *lineptr) /* first non-space of the line */
+struct Cookie *
+Curl_cookie_add(struct CookieInfo *c,
+ bool httpheader, /* TRUE if HTTP header-style line */
+ char *lineptr) /* first non-space of the line */
{
struct Cookie *clist;
char what[MAX_COOKIE_LINE];
@@ -347,7 +348,7 @@ struct Cookie *cookie_add(struct CookieInfo *c,
* called before any cookies are set. File may be NULL.
*
****************************************************************************/
-struct CookieInfo *cookie_init(char *file)
+struct CookieInfo *Curl_cookie_init(char *file)
{
char line[MAX_COOKIE_LINE];
struct CookieInfo *c;
@@ -375,15 +376,15 @@ struct CookieInfo *cookie_init(char *file)
while(*lineptr && isspace((int)*lineptr))
lineptr++;
- cookie_add(c, TRUE, lineptr);
+ Curl_cookie_add(c, TRUE, lineptr);
}
else {
/* This might be a netscape cookie-file line, get it! */
char *lineptr=line;
while(*lineptr && isspace((int)*lineptr))
lineptr++;
- cookie_add(c, FALSE, lineptr);
+ Curl_cookie_add(c, FALSE, lineptr);
}
}
if(fromfile)
@@ -405,8 +406,8 @@ struct CookieInfo *cookie_init(char *file)
*
****************************************************************************/
-struct Cookie *cookie_getlist(struct CookieInfo *c,
- char *host, char *path, bool secure)
+struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
+ char *host, char *path, bool secure)
{
struct Cookie *newco;
struct Cookie *co;
@@ -473,7 +474,7 @@ struct Cookie *cookie_getlist(struct CookieInfo *c,
*
****************************************************************************/
-void cookie_freelist(struct Cookie *co)
+void Curl_cookie_freelist(struct Cookie *co)
{
struct Cookie *next;
if(co) {
@@ -493,7 +494,7 @@ void cookie_freelist(struct Cookie *co)
* Free a "cookie object" previous created with cookie_init().
*
****************************************************************************/
-void cookie_cleanup(struct CookieInfo *c)
+void Curl_cookie_cleanup(struct CookieInfo *c)
{
struct Cookie *co;
struct Cookie *next;
View
@@ -63,10 +63,10 @@ struct CookieInfo {
#define MAX_NAME 256
#define MAX_NAME_TXT "255"
-struct Cookie *cookie_add(struct CookieInfo *, bool, char *);
-struct CookieInfo *cookie_init(char *);
-struct Cookie *cookie_getlist(struct CookieInfo *, char *, char *, bool);
-void cookie_freelist(struct Cookie *);
-void cookie_cleanup(struct CookieInfo *);
+struct Cookie *Curl_cookie_add(struct CookieInfo *, bool, char *);
+struct CookieInfo *Curl_cookie_init(char *);
+struct Cookie *Curl_cookie_getlist(struct CookieInfo *, char *, char *, bool);
+void Curl_cookie_freelist(struct Cookie *);
+void Curl_cookie_cleanup(struct CookieInfo *);
#endif
View
@@ -80,12 +80,12 @@
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
-CURLcode dict_done(struct connectdata *conn)
+CURLcode Curl_dict_done(struct connectdata *conn)
{
return CURLE_OK;
}
-CURLcode dict(struct connectdata *conn)
+CURLcode Curl_dict(struct connectdata *conn)
{
int nth;
char *word;
View
@@ -23,7 +23,7 @@
*
* $Id$
*****************************************************************************/
-CURLcode dict(struct connectdata *conn);
-CURLcode dict_done(struct connectdata *conn);
+CURLcode Curl_dict(struct connectdata *conn);
+CURLcode Curl_dict_done(struct connectdata *conn);
#endif
View
@@ -58,7 +58,6 @@
#endif
#include "progress.h"
-#include "speedcheck.h"
#include "sendf.h"
#include <curl/types.h>
@@ -69,7 +68,7 @@
<butlerm@xmission.com>. */
CURLcode
-Transfer(CURLconnect *c_conn,
+Curl_Transfer(CURLconnect *c_conn,
/* READ stuff */
int sockfd, /* socket to read from or -1 */
int size, /* -1 if unknown at this point */
View
@@ -23,14 +23,18 @@
* $Id$
*****************************************************************************/
CURLcode
-Transfer (struct connectdata *data,
- int sockfd, /* socket to read from or -1 */
- int size, /* -1 if unknown at this point */
- bool getheader, /* TRUE if header parsing is wanted */
- long *bytecountp, /* return number of bytes read */
- int writesockfd, /* socket to write to, it may very well be
- the same we read from. -1 disables */
- long *writebytecountp /* return number of bytes written */
+Curl_Transfer (struct connectdata *data,
+ int sockfd, /* socket to read from or -1 */
+ int size, /* -1 if unknown at this point */
+ bool getheader, /* TRUE if header parsing is wanted */
+ long *bytecountp, /* return number of bytes read */
+ int writesockfd, /* socket to write to, it may very well be
+ the same we read from. -1 disables */
+ long *writebytecountp /* return number of bytes written */
);
+/* "hackish" define to make sources compile without too much human editing.
+ Don't use "Tranfer()" anymore! */
+#define Transfer(a,b,c,d,e,f,g) Curl_Transfer(a,b,c,d,e,f,g)
+
#endif
View
@@ -106,7 +106,7 @@ CURLcode file(struct connectdata *conn)
struct UrlData *data = conn->data;
char *buf = data->buffer;
int bytecount = 0;
- struct timeval start = tvnow();
+ struct timeval start = Curl_tvnow();
struct timeval now = start;
int fd;
char *actual_path = curl_unescape(path, 0);
@@ -139,7 +139,7 @@ CURLcode file(struct connectdata *conn)
it avoids problems with select() and recv() on file descriptors
in Winsock */
if(expected_size != -1)
- pgrsSetDownloadSize(data, expected_size);
+ Curl_pgrsSetDownloadSize(data, expected_size);
while (res == CURLE_OK) {
nread = read(fd, buf, BUFSIZE-1);
@@ -155,16 +155,16 @@ CURLcode file(struct connectdata *conn)
to prevent CR/LF translation (this then goes to a binary mode
file descriptor). */
- res = client_write(data, CLIENTWRITE_BODY, buf, nread);
+ res = Curl_client_write(data, CLIENTWRITE_BODY, buf, nread);
if(res)
return res;
- now = tvnow();
- if(pgrsUpdate(data))
+ now = Curl_tvnow();
+ if(Curl_pgrsUpdate(data))
res = CURLE_ABORTED_BY_CALLBACK;
}
- now = tvnow();
- if(pgrsUpdate(data))
+ now = Curl_tvnow();
+ if(Curl_pgrsUpdate(data))
res = CURLE_ABORTED_BY_CALLBACK;
close(fd);
Oops, something went wrong.

0 comments on commit 4031104

Please sign in to comment.