Commit 662bee71 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

All static functions that were previously name Curl_* something no longer

use that prefix as we use that prefix only for library-wide internal global
symbols.
parent f8172f85
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@
 * Forward declarations.
 */

static CURLcode Curl_dict(struct connectdata *conn, bool *done);
static CURLcode dict_do(struct connectdata *conn, bool *done);

/*
 * DICT protocol handler.
@@ -96,7 +96,7 @@ static CURLcode Curl_dict(struct connectdata *conn, bool *done);
const struct Curl_handler Curl_handler_dict = {
  "DICT",                               /* scheme */
  ZERO_NULL,                            /* setup_connection */
  Curl_dict,                            /* do_it */
  dict_do,                              /* do_it */
  ZERO_NULL,                            /* done */
  ZERO_NULL,                            /* do_more */
  ZERO_NULL,                            /* connect_it */
@@ -142,7 +142,7 @@ static char *unescape_word(struct SessionHandle *data, const char *inp)
  return dictp;
}

static CURLcode Curl_dict(struct connectdata *conn, bool *done)
static CURLcode dict_do(struct connectdata *conn, bool *done)
{
  char *word;
  char *eword;
+13 −13
Original line number Diff line number Diff line
@@ -94,10 +94,10 @@
 * Forward declarations.
 */

static CURLcode Curl_file(struct connectdata *, bool *done);
static CURLcode Curl_file_done(struct connectdata *conn,
static CURLcode file_do(struct connectdata *, bool *done);
static CURLcode file_done(struct connectdata *conn,
                          CURLcode status, bool premature);
static CURLcode Curl_file_connect(struct connectdata *conn, bool *done);
static CURLcode file_connect(struct connectdata *conn, bool *done);

/*
 * FILE scheme handler.
@@ -106,10 +106,10 @@ static CURLcode Curl_file_connect(struct connectdata *conn, bool *done);
const struct Curl_handler Curl_handler_file = {
  "FILE",                               /* scheme */
  ZERO_NULL,                            /* setup_connection */
  Curl_file,                            /* do_it */
  Curl_file_done,                       /* done */
  file_do,                              /* do_it */
  file_done,                            /* done */
  ZERO_NULL,                            /* do_more */
  Curl_file_connect,                    /* connect_it */
  file_connect,                         /* connect_it */
  ZERO_NULL,                            /* connecting */
  ZERO_NULL,                            /* doing */
  ZERO_NULL,                            /* proto_getsock */
@@ -120,11 +120,11 @@ const struct Curl_handler Curl_handler_file = {
};

/*
 * Curl_file_connect() gets called from Curl_protocol_connect() to allow us to
 * file_connect() gets called from Curl_protocol_connect() to allow us to
 * do protocol-specific actions at connect-time.  We emulate a
 * connect-then-transfer protocol and "connect" to the file here
 */
static CURLcode Curl_file_connect(struct connectdata *conn, bool *done)
static CURLcode file_connect(struct connectdata *conn, bool *done)
{
  struct SessionHandle *data = conn->data;
  char *real_path = curl_easy_unescape(data, data->state.path, 0, NULL);
@@ -201,7 +201,7 @@ static CURLcode Curl_file_connect(struct connectdata *conn, bool *done)
  file->fd = fd;
  if(!data->set.upload && (fd == -1)) {
    failf(data, "Couldn't open file %s", data->state.path);
    Curl_file_done(conn, CURLE_FILE_COULDNT_READ_FILE, FALSE);
    file_done(conn, CURLE_FILE_COULDNT_READ_FILE, FALSE);
    return CURLE_FILE_COULDNT_READ_FILE;
  }
  *done = TRUE;
@@ -209,7 +209,7 @@ static CURLcode Curl_file_connect(struct connectdata *conn, bool *done)
  return CURLE_OK;
}

static CURLcode Curl_file_done(struct connectdata *conn,
static CURLcode file_done(struct connectdata *conn,
                               CURLcode status, bool premature)
{
  struct FILEPROTO *file = conn->data->state.proto.file;
@@ -349,14 +349,14 @@ static CURLcode file_upload(struct connectdata *conn)
}

/*
 * Curl_file() is the protocol-specific function for the do-phase, separated
 * file_do() is the protocol-specific function for the do-phase, separated
 * from the connect-phase above. Other protocols merely setup the transfer in
 * the do-phase, to have it done in the main transfer loop but since some
 * platforms we support don't allow select()ing etc on file handles (as
 * opposed to sockets) we instead perform the whole do-operation in this
 * function.
 */
static CURLcode Curl_file(struct connectdata *conn, bool *done)
static CURLcode file_do(struct connectdata *conn, bool *done)
{
  /* This implementation ignores the host name in conformance with
     RFC 1738. Only local files (reachable via the standard file system)
+55 −55
Original line number Diff line number Diff line
@@ -134,21 +134,21 @@ static CURLcode ftp_nb_type(struct connectdata *conn,
                            bool ascii, ftpstate newstate);
static int ftp_need_type(struct connectdata *conn,
                         bool ascii);
static CURLcode Curl_ftp(struct connectdata *conn, bool *done);
static CURLcode Curl_ftp_done(struct connectdata *conn,
static CURLcode ftp_do(struct connectdata *conn, bool *done);
static CURLcode ftp_done(struct connectdata *conn,
                              CURLcode, bool premature);
static CURLcode Curl_ftp_connect(struct connectdata *conn, bool *done);
static CURLcode Curl_ftp_disconnect(struct connectdata *conn);
static CURLcode Curl_ftp_nextconnect(struct connectdata *conn);
static CURLcode Curl_ftp_multi_statemach(struct connectdata *conn, bool *done);
static int Curl_ftp_getsock(struct connectdata *conn,
static CURLcode ftp_connect(struct connectdata *conn, bool *done);
static CURLcode ftp_disconnect(struct connectdata *conn);
static CURLcode ftp_nextconnect(struct connectdata *conn);
static CURLcode ftp_multi_statemach(struct connectdata *conn, bool *done);
static int ftp_getsock(struct connectdata *conn,
                            curl_socket_t *socks,
                            int numsocks);
static CURLcode Curl_ftp_doing(struct connectdata *conn,
static CURLcode ftp_doing(struct connectdata *conn,
                               bool *dophase_done);
static CURLcode Curl_ftp_setup_connection(struct connectdata * conn);
static CURLcode ftp_setup_connection(struct connectdata * conn);
#ifdef USE_SSL
static CURLcode Curl_ftps_setup_connection(struct connectdata * conn);
static CURLcode ftps_setup_connection(struct connectdata * conn);
#endif

/* easy-to-use macro: */
@@ -164,16 +164,16 @@ static CURLcode Curl_ftps_setup_connection(struct connectdata * conn);

const struct Curl_handler Curl_handler_ftp = {
  "FTP",                                /* scheme */
  Curl_ftp_setup_connection,            /* setup_connection */
  Curl_ftp,                             /* do_it */
  Curl_ftp_done,                        /* done */
  Curl_ftp_nextconnect,                 /* do_more */
  Curl_ftp_connect,                     /* connect_it */
  Curl_ftp_multi_statemach,             /* connecting */
  Curl_ftp_doing,                       /* doing */
  Curl_ftp_getsock,                     /* proto_getsock */
  Curl_ftp_getsock,                     /* doing_getsock */
  Curl_ftp_disconnect,                  /* disconnect */
  ftp_setup_connection,            /* setup_connection */
  ftp_do,                          /* do_it */
  ftp_done,                        /* done */
  ftp_nextconnect,                 /* do_more */
  ftp_connect,                     /* connect_it */
  ftp_multi_statemach,             /* connecting */
  ftp_doing,                       /* doing */
  ftp_getsock,                     /* proto_getsock */
  ftp_getsock,                     /* doing_getsock */
  ftp_disconnect,                  /* disconnect */
  PORT_FTP,                             /* defport */
  PROT_FTP                              /* protocol */
};
@@ -186,16 +186,16 @@ const struct Curl_handler Curl_handler_ftp = {

const struct Curl_handler Curl_handler_ftps = {
  "FTPS",                               /* scheme */
  Curl_ftps_setup_connection,           /* setup_connection */
  Curl_ftp,                             /* do_it */
  Curl_ftp_done,                        /* done */
  Curl_ftp_nextconnect,                 /* do_more */
  Curl_ftp_connect,                     /* connect_it */
  Curl_ftp_multi_statemach,             /* connecting */
  Curl_ftp_doing,                       /* doing */
  Curl_ftp_getsock,                     /* proto_getsock */
  Curl_ftp_getsock,                     /* doing_getsock */
  Curl_ftp_disconnect,                  /* disconnect */
  ftps_setup_connection,           /* setup_connection */
  ftp_do,                          /* do_it */
  ftp_done,                        /* done */
  ftp_nextconnect,                 /* do_more */
  ftp_connect,                     /* connect_it */
  ftp_multi_statemach,             /* connecting */
  ftp_doing,                       /* doing */
  ftp_getsock,                     /* proto_getsock */
  ftp_getsock,                     /* doing_getsock */
  ftp_disconnect,                  /* disconnect */
  PORT_FTPS,                            /* defport */
  PROT_FTP | PROT_FTPS | PROT_SSL       /* protocol */
};
@@ -810,7 +810,7 @@ static CURLcode ftp_state_pwd(struct connectdata *conn)
}

/* For the FTP "protocol connect" and "doing" phases only */
static int Curl_ftp_getsock(struct connectdata *conn,
static int ftp_getsock(struct connectdata *conn,
                            curl_socket_t *socks,
                            int numsocks)
{
@@ -1589,7 +1589,7 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn,
        result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);

        /* Set ->transfer so that we won't get any error in
         * Curl_ftp_done() because we didn't transfer anything! */
         * ftp_done() because we didn't transfer anything! */
        ftp->transfer = FTPTRANSFER_NONE;

        state(conn, FTP_STOP);
@@ -2148,7 +2148,7 @@ static CURLcode ftp_state_post_retr_size(struct connectdata *conn,
      result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
      infof(data, "File already completely downloaded\n");

      /* Set ->transfer so that we won't get any error in Curl_ftp_done()
      /* Set ->transfer so that we won't get any error in ftp_done()
       * because we didn't transfer the any file */
      ftp->transfer = FTPTRANSFER_NONE;
      state(conn, FTP_STOP);
@@ -2930,7 +2930,7 @@ static long ftp_state_timeout(struct connectdata *conn)


/* called repeatedly until done from multi.c */
static CURLcode Curl_ftp_multi_statemach(struct connectdata *conn,
static CURLcode ftp_multi_statemach(struct connectdata *conn,
                                         bool *done)
{
  curl_socket_t sock = conn->sock[FIRSTSOCKET];
@@ -3032,14 +3032,14 @@ static CURLcode ftp_init(struct connectdata *conn)
}

/*
 * Curl_ftp_connect() should do everything that is to be considered a part of
 * ftp_connect() should do everything that is to be considered a part of
 * the connection phase.
 *
 * The variable 'done' points to will be TRUE if the protocol-layer connect
 * phase is done when this function returns, or FALSE is not. When called as
 * a part of the easy interface, it will always be TRUE.
 */
static CURLcode Curl_ftp_connect(struct connectdata *conn,
static CURLcode ftp_connect(struct connectdata *conn,
                                 bool *done) /* see description above */
{
  CURLcode result;
@@ -3107,7 +3107,7 @@ static CURLcode Curl_ftp_connect(struct connectdata *conn,
  ftpc->response = Curl_tvnow(); /* start response time-out now! */

  if(data->state.used_interface == Curl_if_multi)
    result = Curl_ftp_multi_statemach(conn, done);
    result = ftp_multi_statemach(conn, done);
  else {
    result = ftp_easy_statemach(conn);
    if(!result)
@@ -3119,14 +3119,14 @@ static CURLcode Curl_ftp_connect(struct connectdata *conn,

/***********************************************************************
 *
 * Curl_ftp_done()
 * ftp_done()
 *
 * The DONE function. This does what needs to be done after a single DO has
 * performed.
 *
 * Input argument is already checked for validity.
 */
static CURLcode Curl_ftp_done(struct connectdata *conn, CURLcode status,
static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
                              bool premature)
{
  struct SessionHandle *data = conn->data;
@@ -3472,19 +3472,19 @@ static CURLcode ftp_range(struct connectdata *conn)


/*
 * Curl_ftp_nextconnect()
 * ftp_nextconnect()
 *
 * This function shall be called when the second FTP (data) connection is
 * connected.
 */

static CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
static CURLcode ftp_nextconnect(struct connectdata *conn)
{
  struct SessionHandle *data=conn->data;
  struct ftp_conn *ftpc = &conn->proto.ftpc;
  CURLcode result = CURLE_OK;

  /* the ftp struct is inited in Curl_ftp_connect() */
  /* the ftp struct is inited in ftp_connect() */
  struct FTP *ftp = data->state.proto.ftp;

  DEBUGF(infof(data, "DO-MORE phase starts\n"));
@@ -3574,7 +3574,7 @@ CURLcode ftp_perform(struct connectdata *conn,

  /* run the state-machine */
  if(conn->data->state.used_interface == Curl_if_multi)
    result = Curl_ftp_multi_statemach(conn, dophase_done);
    result = ftp_multi_statemach(conn, dophase_done);
  else {
    result = ftp_easy_statemach(conn);
    *dophase_done = TRUE; /* with the easy interface we are done here */
@@ -3589,14 +3589,14 @@ CURLcode ftp_perform(struct connectdata *conn,

/***********************************************************************
 *
 * Curl_ftp()
 * ftp_do()
 *
 * This function is registered as 'curl_do' function. It decodes the path
 * parts etc as a wrapper to the actual DO function (ftp_perform).
 *
 * The input argument is already checked for validity.
 */
static CURLcode Curl_ftp(struct connectdata *conn, bool *done)
static CURLcode ftp_do(struct connectdata *conn, bool *done)
{
  CURLcode retcode = CURLE_OK;

@@ -3606,7 +3606,7 @@ static CURLcode Curl_ftp(struct connectdata *conn, bool *done)
    Since connections can be re-used between SessionHandles, this might be a
    connection already existing but on a fresh SessionHandle struct so we must
    make sure we have a good 'struct FTP' to play with. For new connections,
    the struct FTP is allocated and setup in the Curl_ftp_connect() function.
    the struct FTP is allocated and setup in the ftp_connect() function.
  */
  Curl_reset_reqproto(conn);
  retcode = ftp_init(conn);
@@ -3789,12 +3789,12 @@ static CURLcode ftp_quit(struct connectdata *conn)

/***********************************************************************
 *
 * Curl_ftp_disconnect()
 * ftp_disconnect()
 *
 * Disconnect from an FTP server. Cleanup protocol-specific per-connection
 * resources. BLOCKING.
 */
static CURLcode Curl_ftp_disconnect(struct connectdata *conn)
static CURLcode ftp_disconnect(struct connectdata *conn)
{
  struct ftp_conn *ftpc= &conn->proto.ftpc;

@@ -4024,7 +4024,7 @@ static CURLcode ftp_dophase_done(struct connectdata *conn,
  struct ftp_conn *ftpc = &conn->proto.ftpc;

  if(connected)
    result = Curl_ftp_nextconnect(conn);
    result = ftp_nextconnect(conn);

  if(result && (conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD)) {
    /* Failure detected, close the second socket if it was created already */
@@ -4046,11 +4046,11 @@ static CURLcode ftp_dophase_done(struct connectdata *conn,
}

/* called from multi.c while DOing */
static CURLcode Curl_ftp_doing(struct connectdata *conn,
static CURLcode ftp_doing(struct connectdata *conn,
                               bool *dophase_done)
{
  CURLcode result;
  result = Curl_ftp_multi_statemach(conn, dophase_done);
  result = ftp_multi_statemach(conn, dophase_done);

  if(*dophase_done) {
    result = ftp_dophase_done(conn, FALSE /* not connected */);
@@ -4070,7 +4070,7 @@ static CURLcode Curl_ftp_doing(struct connectdata *conn,
 * remote host.
 *
 * ftp->ctl_valid starts out as FALSE, and gets set to TRUE if we reach the
 * Curl_ftp_done() function without finding any major problem.
 * ftp_done() function without finding any major problem.
 */
static
CURLcode ftp_regular_transfer(struct connectdata *conn,
@@ -4109,7 +4109,7 @@ CURLcode ftp_regular_transfer(struct connectdata *conn,
  return result;
}

static CURLcode Curl_ftp_setup_connection(struct connectdata * conn)
static CURLcode ftp_setup_connection(struct connectdata * conn)
{
  struct SessionHandle *data = conn->data;
  char * type;
@@ -4170,12 +4170,12 @@ static CURLcode Curl_ftp_setup_connection(struct connectdata * conn)
}

#ifdef USE_SSL
static CURLcode Curl_ftps_setup_connection(struct connectdata * conn)
static CURLcode ftps_setup_connection(struct connectdata * conn)
{
  struct SessionHandle *data = conn->data;

  conn->ssl[SECONDARYSOCKET].use = data->set.ftp_ssl != CURLUSESSL_CONTROL;
  return Curl_ftp_setup_connection(conn);
  return ftp_setup_connection(conn);
}
#endif

+22 −22
Original line number Diff line number Diff line
@@ -109,9 +109,9 @@
 * Forward declarations.
 */

static CURLcode Curl_https_connecting(struct connectdata *conn, bool *done);
static CURLcode https_connecting(struct connectdata *conn, bool *done);
#ifdef USE_SSL
static int Curl_https_getsock(struct connectdata *conn,
static int https_getsock(struct connectdata *conn,
                              curl_socket_t *socks,
                              int numsocks);
#endif
@@ -146,9 +146,9 @@ const struct Curl_handler Curl_handler_https = {
  Curl_http_done,                       /* done */
  ZERO_NULL,                            /* do_more */
  Curl_http_connect,                    /* connect_it */
  Curl_https_connecting,                /* connecting */
  https_connecting,                /* connecting */
  ZERO_NULL,                            /* doing */
  Curl_https_getsock,                   /* proto_getsock */
  https_getsock,                   /* proto_getsock */
  ZERO_NULL,                            /* doing_getsock */
  ZERO_NULL,                            /* disconnect */
  PORT_HTTPS,                           /* defport */
@@ -176,12 +176,12 @@ static char *checkheaders(struct SessionHandle *data, const char *thisheader)
}

/*
 * Curl_output_basic() sets up an Authorization: header (or the proxy version)
 * http_output_basic() sets up an Authorization: header (or the proxy version)
 * for HTTP Basic authentication.
 *
 * Returns CURLcode.
 */
static CURLcode Curl_output_basic(struct connectdata *conn, bool proxy)
static CURLcode http_output_basic(struct connectdata *conn, bool proxy)
{
  char *authorization;
  struct SessionHandle *data=conn->data;
@@ -435,7 +435,7 @@ CURLcode Curl_http_auth_act(struct connectdata *conn)
 * @returns CURLcode
 */
static CURLcode
Curl_http_output_auth(struct connectdata *conn,
http_output_auth(struct connectdata *conn,
                 const char *request,
                 const char *path,
                 bool proxytunnel) /* TRUE if this is the request setting
@@ -502,11 +502,11 @@ Curl_http_output_auth(struct connectdata *conn,
        if(conn->bits.proxy_user_passwd &&
           !checkheaders(data, "Proxy-authorization:")) {
          auth="Basic";
          result = Curl_output_basic(conn, TRUE);
          result = http_output_basic(conn, TRUE);
          if(result)
            return result;
        }
        /* NOTE: Curl_output_basic() should set 'done' TRUE, as the other auth
        /* NOTE: http_output_basic() should set 'done' TRUE, as the other auth
           functions work that way */
        authproxy->done = TRUE;
      }
@@ -582,7 +582,7 @@ Curl_http_output_auth(struct connectdata *conn,
          if(conn->bits.user_passwd &&
             !checkheaders(data, "Authorization:")) {
            auth="Basic";
            result = Curl_output_basic(conn, FALSE);
            result = http_output_basic(conn, FALSE);
            if(result)
              return result;
          }
@@ -1264,7 +1264,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
      }

      /* Setup the proxy-authorization header, if any */
      result = Curl_http_output_auth(conn, (char *)"CONNECT", host_port, TRUE);
      result = http_output_auth(conn, (char *)"CONNECT", host_port, TRUE);

      if(CURLE_OK == result) {
        char *host=(char *)"";
@@ -1682,7 +1682,7 @@ CURLcode Curl_http_connect(struct connectdata *conn, bool *done)
  if(conn->protocol & PROT_HTTPS) {
    /* perform SSL initialization */
    if(data->state.used_interface == Curl_if_multi) {
      result = Curl_https_connecting(conn, done);
      result = https_connecting(conn, done);
      if(result)
        return result;
    }
@@ -1701,7 +1701,7 @@ CURLcode Curl_http_connect(struct connectdata *conn, bool *done)
  return CURLE_OK;
}

static CURLcode Curl_https_connecting(struct connectdata *conn, bool *done)
static CURLcode https_connecting(struct connectdata *conn, bool *done)
{
  CURLcode result;
  DEBUGASSERT((conn) && (conn->protocol & PROT_HTTPS));
@@ -1717,7 +1717,7 @@ static CURLcode Curl_https_connecting(struct connectdata *conn, bool *done)
#ifdef USE_SSLEAY
/* This function is OpenSSL-specific. It should be made to query the generic
   SSL layer instead. */
static int Curl_https_getsock(struct connectdata *conn,
static int https_getsock(struct connectdata *conn,
                              curl_socket_t *socks,
                              int numsocks)
{
@@ -1742,7 +1742,7 @@ static int Curl_https_getsock(struct connectdata *conn,
}
#else
#ifdef USE_GNUTLS
int Curl_https_getsock(struct connectdata *conn,
int https_getsock(struct connectdata *conn,
                       curl_socket_t *socks,
                       int numsocks)
{
@@ -1753,7 +1753,7 @@ int Curl_https_getsock(struct connectdata *conn,
}
#else
#ifdef USE_NSS
int Curl_https_getsock(struct connectdata *conn,
int https_getsock(struct connectdata *conn,
                       curl_socket_t *socks,
                       int numsocks)
{
@@ -1764,7 +1764,7 @@ int Curl_https_getsock(struct connectdata *conn,
}
#else
#ifdef USE_QSOSSL
int Curl_https_getsock(struct connectdata *conn,
int https_getsock(struct connectdata *conn,
                       curl_socket_t *socks,
                       int numsocks)
{
@@ -1979,7 +1979,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
  }

  /* setup the authentication headers */
  result = Curl_http_output_auth(conn, request, ppath, FALSE);
  result = http_output_auth(conn, request, ppath, FALSE);
  if(result)
    return result;

+3 −3
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@

#include <curl/curl.h>

static time_t Curl_parsedate(const char *date);
static time_t parsedate(const char *date);

const char * const Curl_wkday[] =
{"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
@@ -223,7 +223,7 @@ enum assume {
  DATE_TIME
};

static time_t Curl_parsedate(const char *date)
static time_t parsedate(const char *date)
{
  time_t t = 0;
  int wdaynum=-1;  /* day of the week number, 0-6 (mon-sun) */
@@ -421,5 +421,5 @@ static time_t Curl_parsedate(const char *date)
time_t curl_getdate(const char *p, const time_t *now)
{
  (void)now;
  return Curl_parsedate(p);
  return parsedate(p);
}
Loading