]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
checksrc: reduce exceptions, apply again to curlx
authorViktor Szakats <commit@vsz.me>
Fri, 27 Jun 2025 12:21:44 +0000 (14:21 +0200)
committerViktor Szakats <commit@vsz.me>
Fri, 27 Jun 2025 15:33:35 +0000 (17:33 +0200)
- tests/libtest: move exception to `stub_gssapi.h`.
- tests/libtest: move remaining exception to `testtrace.c`.
- tests/server: drop obsolete exception.
- docs/examples: move `BANNEDFUNC` exceptions to local files (3 lines).
- docs/examples: move `ERRNOVAR` exception to `ephiperfifo.c`.
- docs/examples: drop `typedef struct` (8 files).
- lib/curlx: add `.checksrc` with banned funcs copied from lib.
- checksrc: ban `strncpy`, `strtok_r`, `strtoul` by default.
  Drop local bans. Add exception for `strtoul` to `tests/server'.
- lib, src: sync banned funcs.

Also:
- REUSE: drop `stunnel.pem`, it no longer exists.
- docs/examples: formatting.
- docs/examples: simplify some `sizeof()`s.

Closes #17764

27 files changed:
REUSE.toml
docs/examples/.checksrc [deleted file]
docs/examples/Makefile.am
docs/examples/crawler.c
docs/examples/ephiperfifo.c
docs/examples/evhiperfifo.c
docs/examples/ghiper.c
docs/examples/hiperfifo.c
docs/examples/http2-upload.c
docs/examples/multi-event.c
docs/examples/multi-uv.c
docs/examples/synctime.c
docs/examples/xmlstream.c
lib/.checksrc
lib/Makefile.am
lib/curlx/.checksrc [new file with mode: 0644]
lib/vauth/.checksrc
lib/vquic/.checksrc
lib/vssh/.checksrc
lib/vtls/.checksrc
scripts/checksrc.pl
src/.checksrc
tests/libtest/.checksrc [deleted file]
tests/libtest/Makefile.am
tests/libtest/stub_gssapi.h
tests/libtest/testtrace.c
tests/server/.checksrc

index 5f05c91edece220a5f4c38f4169684505fa8e660..81c214863fcd74cc71d33ca0a0d7cb408b9b4639 100644 (file)
@@ -38,17 +38,15 @@ path = [
   "renovate.json",
   "tests/certs/**",
   "tests/data/test**",
-  "tests/stunnel.pem",
   "tests/valgrind.supp",
   # checksrc control files
-  "docs/examples/.checksrc",
   "lib/.checksrc",
+  "lib/curlx/.checksrc",
   "lib/vauth/.checksrc",
   "lib/vquic/.checksrc",
   "lib/vssh/.checksrc",
   "lib/vtls/.checksrc",
   "src/.checksrc",
-  "tests/libtest/.checksrc",
   "tests/server/.checksrc",
 ]
 SPDX-FileCopyrightText = "Daniel Stenberg, <daniel@haxx.se>, et al."
diff --git a/docs/examples/.checksrc b/docs/examples/.checksrc
deleted file mode 100644 (file)
index cfcd695..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-disable BANNEDFUNC
-disable ERRNOVAR
-disable TYPEDEFSTRUCT
index 86010f3f3ea3dbaab2618bf657aaaa804c8d97db..27d4ce741bd4a83010df758a54f1dd4ac4cd7b0d 100644 (file)
@@ -24,8 +24,7 @@
 
 AUTOMAKE_OPTIONS = foreign nostdinc
 
-EXTRA_DIST = README.md Makefile.example CMakeLists.txt \
-  $(COMPLICATED_EXAMPLES) .checksrc
+EXTRA_DIST = CMakeLists.txt README.md Makefile.example $(COMPLICATED_EXAMPLES)
 
 # Specify our include paths here, and do it relative to $(top_srcdir) and
 # $(top_builddir), to ensure that these paths which belong to the library
index d2f89db9dcffc90afa1ba48510213cf82571a8d5..6b737652d40ef74bbe0143d34f424141e7006ca7 100644 (file)
@@ -55,15 +55,15 @@ static void sighandler(int dummy)
 }
 
 /* resizable buffer */
-typedef struct {
+struct memory {
   char *buf;
   size_t size;
-} memory;
+};
 
 static size_t grow_buffer(void *contents, size_t sz, size_t nmemb, void *ctx)
 {
   size_t realsize = sz * nmemb;
-  memory *mem = (memory*) ctx;
+  struct memory *mem = (struct memory*) ctx;
   char *ptr = realloc(mem->buf, mem->size + realsize);
   if(!ptr) {
     /* out of memory */
@@ -79,14 +79,14 @@ static size_t grow_buffer(void *contents, size_t sz, size_t nmemb, void *ctx)
 static CURL *make_handle(const char *url)
 {
   CURL *handle = curl_easy_init();
-  memory *mem;
+  struct memory *mem;
 
   /* Important: use HTTP2 over HTTPS */
   curl_easy_setopt(handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
   curl_easy_setopt(handle, CURLOPT_URL, url);
 
   /* buffer body */
-  mem = malloc(sizeof(memory));
+  mem = malloc(sizeof(*mem));
   mem->size = 0;
   mem->buf = malloc(1);
   curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, grow_buffer);
@@ -119,7 +119,8 @@ static CURL *make_handle(const char *url)
 }
 
 /* HREF finder implemented in libxml2 but could be any HTML parser */
-static size_t follow_links(CURLM *multi_handle, memory *mem, const char *url)
+static size_t follow_links(CURLM *multi_handle, struct memory *mem,
+                           const char *url)
 {
   int opts = HTML_PARSE_NOBLANKS | HTML_PARSE_NOERROR | \
              HTML_PARSE_NOWARNING | HTML_PARSE_NONET;
@@ -213,7 +214,7 @@ int main(void)
       if(m->msg == CURLMSG_DONE) {
         CURL *handle = m->easy_handle;
         char *url;
-        memory *mem;
+        struct memory *mem;
         curl_easy_getinfo(handle, CURLINFO_PRIVATE, &mem);
         curl_easy_getinfo(handle, CURLINFO_EFFECTIVE_URL, &url);
         if(m->data.result == CURLE_OK) {
index 5a25429f764e4fe2828311bc10ad8e279248ef8c..f411d2ea6c4caebb7040fc7fa648bc9b6c23bbd9 100644 (file)
@@ -79,36 +79,33 @@ callback.
 
 
 /* Global information, common to all connections */
-typedef struct _GlobalInfo
-{
+struct GlobalInfo {
   int epfd;    /* epoll filedescriptor */
   int tfd;     /* timer filedescriptor */
   int fifofd;  /* fifo filedescriptor */
   CURLM *multi;
   int still_running;
   FILE *input;
-} GlobalInfo;
+};
 
 
 /* Information associated with a specific easy handle */
-typedef struct _ConnInfo
-{
+struct ConnInfo {
   CURL *easy;
   char *url;
-  GlobalInfo *global;
+  struct GlobalInfo *global;
   char error[CURL_ERROR_SIZE];
-} ConnInfo;
+};
 
 
 /* Information associated with a specific socket */
-typedef struct _SockInfo
-{
+struct SockInfo {
   curl_socket_t sockfd;
   CURL *easy;
   int action;
   long timeout;
-  GlobalInfo *global;
-} SockInfo;
+  struct GlobalInfo *global;
+};
 
 #define mycase(code) \
   case code: s = __STRING(code)
@@ -136,12 +133,12 @@ static void mcode_or_die(const char *where, CURLMcode code)
   }
 }
 
-static void timer_cb(GlobalInfo* g, int revents);
+static void timer_cb(struct GlobalInfo *g, int revents);
 
 /* Update the timer after curl_multi library does its thing. Curl informs the
  * application through this callback what it wants the new timeout to be,
  * after it does some work. */
-static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
+static int multi_timer_cb(CURLM *multi, long timeout_ms, struct GlobalInfo *g)
 {
   struct itimerspec its;
 
@@ -163,7 +160,7 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
     its.it_value.tv_nsec = 1;
   }
   else {
-    memset(&its, 0, sizeof(struct itimerspec));
+    memset(&its, 0, sizeof(its));
   }
 
   timerfd_settime(g->tfd, /* flags= */0, &its, NULL);
@@ -172,12 +169,12 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
 
 
 /* Check for completed transfers, and remove their easy handles */
-static void check_multi_info(GlobalInfo *g)
+static void check_multi_info(struct GlobalInfo *g)
 {
   char *eff_url;
   CURLMsg *msg;
   int msgs_left;
-  ConnInfo *conn;
+  struct ConnInfo *conn;
   CURL *easy;
   CURLcode res;
 
@@ -198,7 +195,7 @@ static void check_multi_info(GlobalInfo *g)
 }
 
 /* Called by libevent when we get action on a multi socket filedescriptor */
-static void event_cb(GlobalInfo *g, int fd, int revents)
+static void event_cb(struct GlobalInfo *g, int fd, int revents)
 {
   CURLMcode rc;
   struct itimerspec its;
@@ -212,13 +209,13 @@ static void event_cb(GlobalInfo *g, int fd, int revents)
   check_multi_info(g);
   if(g->still_running <= 0) {
     fprintf(MSG_OUT, "last transfer done, kill timeout\n");
-    memset(&its, 0, sizeof(struct itimerspec));
+    memset(&its, 0, sizeof(its));
     timerfd_settime(g->tfd, 0, &its, NULL);
   }
 }
 
 /* Called by main loop when our timeout expires */
-static void timer_cb(GlobalInfo* g, int revents)
+static void timer_cb(struct GlobalInfo *g, int revents)
 {
   CURLMcode rc;
   uint64_t count = 0;
@@ -250,7 +247,7 @@ static void timer_cb(GlobalInfo* g, int revents)
 
 
 /* Clean up the SockInfo structure */
-static void remsock(SockInfo *f, GlobalInfo* g)
+static void remsock(struct SockInfo *f, struct GlobalInfo *g)
 {
   if(f) {
     if(f->sockfd) {
@@ -265,8 +262,8 @@ static void remsock(SockInfo *f, GlobalInfo* g)
 
 
 /* Assign information to a SockInfo structure */
-static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
-                    GlobalInfo *g)
+static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act,
+                    struct GlobalInfo *g)
 {
   struct epoll_event ev;
   int kind = ((act & CURL_POLL_IN) ? EPOLLIN : 0) |
@@ -292,9 +289,10 @@ static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
 
 
 /* Initialize a new SockInfo structure */
-static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
+static void addsock(curl_socket_t s, CURL *easy, int action,
+                    struct GlobalInfo *g)
 {
-  SockInfo *fdp = (SockInfo*)calloc(1, sizeof(SockInfo));
+  struct SockInfo *fdp = (struct SockInfo*)calloc(1, sizeof(struct SockInfo));
 
   fdp->global = g;
   setsock(fdp, s, easy, action, g);
@@ -304,8 +302,8 @@ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
 /* CURLMOPT_SOCKETFUNCTION */
 static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
 {
-  GlobalInfo *g = (GlobalInfo*) cbp;
-  SockInfo *fdp = (SockInfo*) sockp;
+  struct GlobalInfo *g = (struct GlobalInfo*) cbp;
+  struct SockInfo *fdp = (struct SockInfo*) sockp;
   const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" };
 
   fprintf(MSG_OUT,
@@ -344,7 +342,7 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
 static int prog_cb(void *p, double dltotal, double dlnow, double ult,
                    double uln)
 {
-  ConnInfo *conn = (ConnInfo *)p;
+  struct ConnInfo *conn = (struct ConnInfo *)p;
   (void)ult;
   (void)uln;
 
@@ -354,12 +352,12 @@ static int prog_cb(void *p, double dltotal, double dlnow, double ult,
 
 
 /* Create a new easy handle, and add it to the global curl_multi */
-static void new_conn(const char *url, GlobalInfo *g)
+static void new_conn(const char *url, struct GlobalInfo *g)
 {
-  ConnInfo *conn;
+  struct ConnInfo *conn;
   CURLMcode rc;
 
-  conn = (ConnInfo*)calloc(1, sizeof(ConnInfo));
+  conn = (struct ConnInfo*)calloc(1, sizeof(*conn));
   conn->error[0] = '\0';
 
   conn->easy = curl_easy_init();
@@ -391,7 +389,7 @@ static void new_conn(const char *url, GlobalInfo *g)
 }
 
 /* This gets called whenever data is received from the fifo */
-static void fifo_cb(GlobalInfo* g, int revents)
+static void fifo_cb(struct GlobalInfo *g, int revents)
 {
   char s[1024];
   long int rv = 0;
@@ -411,7 +409,7 @@ static void fifo_cb(GlobalInfo* g, int revents)
 
 /* Create a named pipe and tell libevent to monitor it */
 static const char *fifo = "hiper.fifo";
-static int init_fifo(GlobalInfo *g)
+static int init_fifo(struct GlobalInfo *g)
 {
   struct stat st;
   curl_socket_t sockfd;
@@ -447,7 +445,7 @@ static int init_fifo(GlobalInfo *g)
   return 0;
 }
 
-static void clean_fifo(GlobalInfo *g)
+static void clean_fifo(struct GlobalInfo *g)
 {
   epoll_ctl(g->epfd, EPOLL_CTL_DEL, g->fifofd, NULL);
   fclose(g->input);
@@ -464,7 +462,7 @@ void sigint_handler(int signo)
 
 int main(int argc, char **argv)
 {
-  GlobalInfo g;
+  struct GlobalInfo g;
   struct itimerspec its;
   struct epoll_event ev;
   struct epoll_event events[10];
@@ -474,7 +472,7 @@ int main(int argc, char **argv)
   g_should_exit_ = 0;
   signal(SIGINT, sigint_handler);
 
-  memset(&g, 0, sizeof(GlobalInfo));
+  memset(&g, 0, sizeof(g));
   g.epfd = epoll_create1(EPOLL_CLOEXEC);
   if(g.epfd == -1) {
     perror("epoll_create1 failed");
@@ -487,7 +485,7 @@ int main(int argc, char **argv)
     return 1;
   }
 
-  memset(&its, 0, sizeof(struct itimerspec));
+  memset(&its, 0, sizeof(its));
   its.it_interval.tv_sec = 0;
   its.it_value.tv_sec = 1;
   timerfd_settime(g.tfd, 0, &its, NULL);
@@ -516,6 +514,7 @@ int main(int argc, char **argv)
     int err = epoll_wait(g.epfd, events,
                          sizeof(events)/sizeof(struct epoll_event), 10000);
     if(err == -1) {
+      /* !checksrc! disable ERRNOVAR 1 */
       if(errno == EINTR) {
         fprintf(MSG_OUT, "note: wait interrupted\n");
         continue;
index 76a7cde469fe951ca25b08e03e960fec9b513e1a..96937fc62810c583a90b05ff90dce23ad25f886a 100644 (file)
@@ -79,43 +79,40 @@ callback.
 
 
 /* Global information, common to all connections */
-typedef struct _GlobalInfo
-{
+struct GlobalInfo {
   struct ev_loop *loop;
   struct ev_io fifo_event;
   struct ev_timer timer_event;
   CURLM *multi;
   int still_running;
   FILE *input;
-} GlobalInfo;
+};
 
 
 /* Information associated with a specific easy handle */
-typedef struct _ConnInfo
-{
+struct ConnInfo {
   CURL *easy;
   char *url;
-  GlobalInfo *global;
+  struct GlobalInfo *global;
   char error[CURL_ERROR_SIZE];
-} ConnInfo;
+};
 
 
 /* Information associated with a specific socket */
-typedef struct _SockInfo
-{
+struct SockInfo {
   curl_socket_t sockfd;
   CURL *easy;
   int action;
   long timeout;
   struct ev_io ev;
   int evset;
-  GlobalInfo *global;
-} SockInfo;
+  struct GlobalInfo *global;
+};
 
 static void timer_cb(EV_P_ struct ev_timer *w, int revents);
 
 /* Update the event timer after curl_multi library calls */
-static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
+static int multi_timer_cb(CURLM *multi, long timeout_ms, struct GlobalInfo *g)
 {
   (void)multi;
   printf("%s %li\n", __PRETTY_FUNCTION__, timeout_ms);
@@ -170,12 +167,12 @@ static void mcode_or_die(const char *where, CURLMcode code)
 
 
 /* Check for completed transfers, and remove their easy handles */
-static void check_multi_info(GlobalInfo *g)
+static void check_multi_info(struct GlobalInfo *g)
 {
   char *eff_url;
   CURLMsg *msg;
   int msgs_left;
-  ConnInfo *conn;
+  struct ConnInfo *conn;
   CURL *easy;
   CURLcode res;
 
@@ -200,12 +197,12 @@ static void check_multi_info(GlobalInfo *g)
 /* Called by libevent when we get action on a multi socket */
 static void event_cb(EV_P_ struct ev_io *w, int revents)
 {
-  GlobalInfo *g;
+  struct GlobalInfo *g;
   CURLMcode rc;
   int action;
 
   printf("%s  w %p revents %i\n", __PRETTY_FUNCTION__, (void *)w, revents);
-  g = (GlobalInfo*) w->data;
+  g = (struct GlobalInfo*) w->data;
 
   action = ((revents & EV_READ) ? CURL_POLL_IN : 0) |
            ((revents & EV_WRITE) ? CURL_POLL_OUT : 0);
@@ -221,12 +218,12 @@ static void event_cb(EV_P_ struct ev_io *w, int revents)
 /* Called by libevent when our timeout expires */
 static void timer_cb(EV_P_ struct ev_timer *w, int revents)
 {
-  GlobalInfo *g;
+  struct GlobalInfo *g;
   CURLMcode rc;
 
   printf("%s  w %p revents %i\n", __PRETTY_FUNCTION__, (void *)w, revents);
 
-  g = (GlobalInfo *)w->data;
+  g = (struct GlobalInfo *)w->data;
 
   rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0,
                                 &g->still_running);
@@ -235,7 +232,7 @@ static void timer_cb(EV_P_ struct ev_timer *w, int revents)
 }
 
 /* Clean up the SockInfo structure */
-static void remsock(SockInfo *f, GlobalInfo *g)
+static void remsock(struct SockInfo *f, struct GlobalInfo *g)
 {
   printf("%s  \n", __PRETTY_FUNCTION__);
   if(f) {
@@ -248,8 +245,8 @@ static void remsock(SockInfo *f, GlobalInfo *g)
 
 
 /* Assign information to a SockInfo structure */
-static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
-                    GlobalInfo *g)
+static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act,
+                    struct GlobalInfo *g)
 {
   int kind = ((act & CURL_POLL_IN) ? EV_READ : 0) |
              ((act & CURL_POLL_OUT) ? EV_WRITE : 0);
@@ -270,9 +267,10 @@ static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
 
 
 /* Initialize a new SockInfo structure */
-static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
+static void addsock(curl_socket_t s, CURL *easy, int action,
+                    struct GlobalInfo *g)
 {
-  SockInfo *fdp = calloc(1, sizeof(SockInfo));
+  struct SockInfo *fdp = calloc(1, sizeof(struct SockInfo));
 
   fdp->global = g;
   setsock(fdp, s, easy, action, g);
@@ -282,8 +280,8 @@ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
 /* CURLMOPT_SOCKETFUNCTION */
 static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
 {
-  GlobalInfo *g = (GlobalInfo*) cbp;
-  SockInfo *fdp = (SockInfo*) sockp;
+  struct GlobalInfo *g = (struct GlobalInfo*) cbp;
+  struct SockInfo *fdp = (struct SockInfo*) sockp;
   const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE"};
 
   printf("%s e %p s %i what %i cbp %p sockp %p\n",
@@ -315,7 +313,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
 static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
 {
   size_t realsize = size * nmemb;
-  ConnInfo *conn = (ConnInfo*) data;
+  struct ConnInfo *conn = (struct ConnInfo*) data;
   (void)ptr;
   (void)conn;
   return realsize;
@@ -325,7 +323,7 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
 static int xferinfo_cb(void *p, curl_off_t dltotal, curl_off_t dlnow,
                        curl_off_t ult, curl_off_t uln)
 {
-  ConnInfo *conn = (ConnInfo *)p;
+  struct ConnInfo *conn = (struct ConnInfo *)p;
   (void)ult;
   (void)uln;
 
@@ -336,12 +334,12 @@ static int xferinfo_cb(void *p, curl_off_t dltotal, curl_off_t dlnow,
 
 
 /* Create a new easy handle, and add it to the global curl_multi */
-static void new_conn(const char *url, GlobalInfo *g)
+static void new_conn(const char *url, struct GlobalInfo *g)
 {
-  ConnInfo *conn;
+  struct ConnInfo *conn;
   CURLMcode rc;
 
-  conn = calloc(1, sizeof(ConnInfo));
+  conn = calloc(1, sizeof(*conn));
   conn->error[0]='\0';
 
   conn->easy = curl_easy_init();
@@ -378,7 +376,7 @@ static void fifo_cb(EV_P_ struct ev_io *w, int revents)
   char s[1024];
   long int rv = 0;
   int n = 0;
-  GlobalInfo *g = (GlobalInfo *)w->data;
+  struct GlobalInfo *g = (struct GlobalInfo *)w->data;
 
   (void)revents;
 
@@ -395,7 +393,7 @@ static void fifo_cb(EV_P_ struct ev_io *w, int revents)
 }
 
 /* Create a named pipe and tell libevent to monitor it */
-static int init_fifo(GlobalInfo *g)
+static int init_fifo(struct GlobalInfo *g)
 {
   struct stat st;
   static const char *fifo = "hiper.fifo";
@@ -429,11 +427,11 @@ static int init_fifo(GlobalInfo *g)
 
 int main(int argc, char **argv)
 {
-  GlobalInfo g;
+  struct GlobalInfo g;
   (void)argc;
   (void)argv;
 
-  memset(&g, 0, sizeof(GlobalInfo));
+  memset(&g, 0, sizeof(g));
   g.loop = ev_default_loop(0);
 
   if(init_fifo(&g))
index 5066ff5adc72c5fc10aa9cdc56235325995e988f..7bc6bef0da9f199d687ec500e8d3ae65f3f87f42 100644 (file)
 #define SHOW_PROGRESS 0   /* Set to non-zero to enable progress callback */
 
 /* Global information, common to all connections */
-typedef struct _GlobalInfo {
+struct GlobalInfo {
   CURLM *multi;
   guint timer_event;
   int still_running;
-} GlobalInfo;
+};
 
 /* Information associated with a specific easy handle */
-typedef struct _ConnInfo {
+struct ConnInfo {
   CURL *easy;
   char *url;
-  GlobalInfo *global;
+  struct GlobalInfo *global;
   char error[CURL_ERROR_SIZE];
-} ConnInfo;
+};
 
 /* Information associated with a specific socket */
-typedef struct _SockInfo {
+struct SockInfo {
   curl_socket_t sockfd;
   CURL *easy;
   int action;
   long timeout;
   GIOChannel *ch;
   guint ev;
-  GlobalInfo *global;
-} SockInfo;
+  struct GlobalInfo *global;
+};
 
 /* Die if we get a bad CURLMcode somewhere */
 static void mcode_or_die(const char *where, CURLMcode code)
@@ -116,7 +116,7 @@ static void mcode_or_die(const char *where, CURLMcode code)
 }
 
 /* Check for completed transfers, and remove their easy handles */
-static void check_multi_info(GlobalInfo *g)
+static void check_multi_info(struct GlobalInfo *g)
 {
   CURLMsg *msg;
   int msgs_left;
@@ -127,7 +127,7 @@ static void check_multi_info(GlobalInfo *g)
       CURL *easy = msg->easy_handle;
       CURLcode res = msg->data.result;
       char *eff_url;
-      ConnInfo *conn;
+      struct ConnInfo *conn;
       curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
       curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url);
       MSG_OUT("DONE: %s => (%d) %s\n", eff_url, res, conn->error);
@@ -142,7 +142,7 @@ static void check_multi_info(GlobalInfo *g)
 /* Called by glib when our timeout expires */
 static gboolean timer_cb(gpointer data)
 {
-  GlobalInfo *g = (GlobalInfo *)data;
+  struct GlobalInfo *g = (struct GlobalInfo *)data;
   CURLMcode rc;
 
   rc = curl_multi_socket_action(g->multi,
@@ -156,7 +156,7 @@ static gboolean timer_cb(gpointer data)
 static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp)
 {
   struct timeval timeout;
-  GlobalInfo *g = (GlobalInfo *)userp;
+  struct GlobalInfo *g = (struct GlobalInfo *)userp;
   timeout.tv_sec = timeout_ms/1000;
   timeout.tv_usec = (timeout_ms%1000)*1000;
 
@@ -177,7 +177,7 @@ static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp)
 /* Called by glib when we get action on a multi socket */
 static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
 {
-  GlobalInfo *g = (GlobalInfo*) data;
+  struct GlobalInfo *g = (struct GlobalInfo*) data;
   CURLMcode rc;
   int fd = g_io_channel_unix_get_fd(ch);
 
@@ -202,7 +202,7 @@ static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
 }
 
 /* Clean up the SockInfo structure */
-static void remsock(SockInfo *f)
+static void remsock(struct SockInfo *f)
 {
   if(!f) {
     return;
@@ -214,8 +214,8 @@ static void remsock(SockInfo *f)
 }
 
 /* Assign information to a SockInfo structure */
-static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
-                    GlobalInfo *g)
+static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act,
+                    struct GlobalInfo *g)
 {
   GIOCondition kind =
     ((act & CURL_POLL_IN) ? G_IO_IN : 0) |
@@ -231,9 +231,10 @@ static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
 }
 
 /* Initialize a new SockInfo structure */
-static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
+static void addsock(curl_socket_t s, CURL *easy, int action,
+                    struct GlobalInfo *g)
 {
-  SockInfo *fdp = g_malloc0(sizeof(SockInfo));
+  struct SockInfo *fdp = g_malloc0(sizeof(struct SockInfo));
 
   fdp->global = g;
   fdp->ch = g_io_channel_unix_new(s);
@@ -244,8 +245,8 @@ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
 /* CURLMOPT_SOCKETFUNCTION */
 static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
 {
-  GlobalInfo *g = (GlobalInfo*) cbp;
-  SockInfo *fdp = (SockInfo*) sockp;
+  struct GlobalInfo *g = (struct GlobalInfo*) cbp;
+  struct SockInfo *fdp = (struct SockInfo*) sockp;
   static const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" };
 
   MSG_OUT("socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
@@ -273,7 +274,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
 static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
 {
   size_t realsize = size * nmemb;
-  ConnInfo *conn = (ConnInfo*) data;
+  struct ConnInfo *conn = (struct ConnInfo*) data;
   (void)ptr;
   (void)conn;
   return realsize;
@@ -283,7 +284,7 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
 static int xferinfo_cb(void *p, curl_off_t dltotal, curl_off_t dlnow,
                        curl_off_t ult, curl_off_t uln)
 {
-  ConnInfo *conn = (ConnInfo *)p;
+  struct ConnInfo *conn = (struct ConnInfo *)p;
   (void)ult;
   (void)uln;
 
@@ -293,12 +294,12 @@ static int xferinfo_cb(void *p, curl_off_t dltotal, curl_off_t dlnow,
 }
 
 /* Create a new easy handle, and add it to the global curl_multi */
-static void new_conn(const char *url, GlobalInfo *g)
+static void new_conn(const char *url, struct GlobalInfo *g)
 {
-  ConnInfo *conn;
+  struct ConnInfo *conn;
   CURLMcode rc;
 
-  conn = g_malloc0(sizeof(ConnInfo));
+  conn = g_malloc0(sizeof(*conn));
   conn->error[0] = '\0';
   conn->easy = curl_easy_init();
   if(!conn->easy) {
@@ -344,7 +345,7 @@ static gboolean fifo_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
       if(tp) {
         buf[tp]='\0';
       }
-      new_conn(buf, (GlobalInfo*)data);
+      new_conn(buf, (struct GlobalInfo*)data);
       g_free(buf);
     }
     else {
@@ -368,7 +369,7 @@ static gboolean fifo_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
         }
       }
       if(all) {
-        new_conn(all, (GlobalInfo*)data);
+        new_conn(all, (struct GlobalInfo*)data);
         g_free(all);
       }
       g_free(buf);
@@ -415,7 +416,7 @@ int init_fifo(void)
 
 int main(void)
 {
-  GlobalInfo *g = g_malloc0(sizeof(GlobalInfo));
+  struct GlobalInfo *g = g_malloc0(sizeof(struct GlobalInfo));
   GMainLoop*gmain;
   int fd;
   GIOChannel* ch;
index 6e96794b607e2c155c0e8f2de6aff5c6ae013303..d1e534ffbd2d3520d8986a4a05072e104f29998c 100644 (file)
@@ -78,8 +78,7 @@ callback.
 
 
 /* Global information, common to all connections */
-typedef struct _GlobalInfo
-{
+struct GlobalInfo {
   struct event_base *evbase;
   struct event fifo_event;
   struct event timer_event;
@@ -87,29 +86,27 @@ typedef struct _GlobalInfo
   int still_running;
   FILE *input;
   int stopped;
-} GlobalInfo;
+};
 
 
 /* Information associated with a specific easy handle */
-typedef struct _ConnInfo
-{
+struct ConnInfo {
   CURL *easy;
   char *url;
-  GlobalInfo *global;
+  struct GlobalInfo *global;
   char error[CURL_ERROR_SIZE];
-} ConnInfo;
+};
 
 
 /* Information associated with a specific socket */
-typedef struct _SockInfo
-{
+struct SockInfo {
   curl_socket_t sockfd;
   CURL *easy;
   int action;
   long timeout;
   struct event ev;
-  GlobalInfo *global;
-} SockInfo;
+  struct GlobalInfo *global;
+};
 
 #define mycase(code) \
   case code: s = __STRING(code)
@@ -139,7 +136,7 @@ static void mcode_or_die(const char *where, CURLMcode code)
 
 
 /* Update the event timer after curl_multi library calls */
-static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
+static int multi_timer_cb(CURLM *multi, long timeout_ms, struct GlobalInfo *g)
 {
   struct timeval timeout;
   (void)multi;
@@ -163,12 +160,12 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
 
 
 /* Check for completed transfers, and remove their easy handles */
-static void check_multi_info(GlobalInfo *g)
+static void check_multi_info(struct GlobalInfo *g)
 {
   char *eff_url;
   CURLMsg *msg;
   int msgs_left;
-  ConnInfo *conn;
+  struct ConnInfo *conn;
   CURL *easy;
   CURLcode res;
 
@@ -195,7 +192,7 @@ static void check_multi_info(GlobalInfo *g)
 /* Called by libevent when we get action on a multi socket */
 static void event_cb(int fd, short kind, void *userp)
 {
-  GlobalInfo *g = (GlobalInfo*) userp;
+  struct GlobalInfo *g = (struct GlobalInfo*) userp;
   CURLMcode rc;
 
   int action =
@@ -219,7 +216,7 @@ static void event_cb(int fd, short kind, void *userp)
 /* Called by libevent when our timeout expires */
 static void timer_cb(int fd, short kind, void *userp)
 {
-  GlobalInfo *g = (GlobalInfo *)userp;
+  struct GlobalInfo *g = (struct GlobalInfo *)userp;
   CURLMcode rc;
   (void)fd;
   (void)kind;
@@ -233,7 +230,7 @@ static void timer_cb(int fd, short kind, void *userp)
 
 
 /* Clean up the SockInfo structure */
-static void remsock(SockInfo *f)
+static void remsock(struct SockInfo *f)
 {
   if(f) {
     if(event_initialized(&f->ev)) {
@@ -246,8 +243,8 @@ static void remsock(SockInfo *f)
 
 
 /* Assign information to a SockInfo structure */
-static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
-                    GlobalInfo *g)
+static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act,
+                    struct GlobalInfo *g)
 {
   int kind =
      ((act & CURL_POLL_IN) ? EV_READ : 0) |
@@ -266,9 +263,10 @@ static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
 
 
 /* Initialize a new SockInfo structure */
-static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
+static void addsock(curl_socket_t s, CURL *easy, int action,
+                    struct GlobalInfo *g)
 {
-  SockInfo *fdp = calloc(1, sizeof(SockInfo));
+  struct SockInfo *fdp = calloc(1, sizeof(struct SockInfo));
 
   fdp->global = g;
   setsock(fdp, s, easy, action, g);
@@ -278,8 +276,8 @@ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
 /* CURLMOPT_SOCKETFUNCTION */
 static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
 {
-  GlobalInfo *g = (GlobalInfo*) cbp;
-  SockInfo *fdp = (SockInfo*) sockp;
+  struct GlobalInfo *g = (struct GlobalInfo*) cbp;
+  struct SockInfo *fdp = (struct SockInfo*) sockp;
   const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" };
 
   fprintf(MSG_OUT,
@@ -318,7 +316,7 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
 static int xferinfo_cb(void *p, curl_off_t dltotal, curl_off_t dlnow,
                        curl_off_t ult, curl_off_t uln)
 {
-  ConnInfo *conn = (ConnInfo *)p;
+  struct ConnInfo *conn = (struct ConnInfo *)p;
   (void)ult;
   (void)uln;
 
@@ -329,12 +327,12 @@ static int xferinfo_cb(void *p, curl_off_t dltotal, curl_off_t dlnow,
 
 
 /* Create a new easy handle, and add it to the global curl_multi */
-static void new_conn(const char *url, GlobalInfo *g)
+static void new_conn(const char *url, struct GlobalInfo *g)
 {
-  ConnInfo *conn;
+  struct ConnInfo *conn;
   CURLMcode rc;
 
-  conn = calloc(1, sizeof(ConnInfo));
+  conn = calloc(1, sizeof(*conn));
   conn->error[0] = '\0';
 
   conn->easy = curl_easy_init();
@@ -369,7 +367,7 @@ static void fifo_cb(int fd, short event, void *arg)
   char s[1024];
   long int rv = 0;
   int n = 0;
-  GlobalInfo *g = (GlobalInfo *)arg;
+  struct GlobalInfo *g = (struct GlobalInfo *)arg;
   (void)fd;
   (void)event;
 
@@ -393,7 +391,7 @@ static void fifo_cb(int fd, short event, void *arg)
 
 /* Create a named pipe and tell libevent to monitor it */
 static const char *fifo = "hiper.fifo";
-static int init_fifo(GlobalInfo *g)
+static int init_fifo(struct GlobalInfo *g)
 {
   struct stat st;
   curl_socket_t sockfd;
@@ -425,7 +423,7 @@ static int init_fifo(GlobalInfo *g)
   return 0;
 }
 
-static void clean_fifo(GlobalInfo *g)
+static void clean_fifo(struct GlobalInfo *g)
 {
     event_del(&g->fifo_event);
     fclose(g->input);
@@ -434,11 +432,11 @@ static void clean_fifo(GlobalInfo *g)
 
 int main(int argc, char **argv)
 {
-  GlobalInfo g;
+  struct GlobalInfo g;
   (void)argc;
   (void)argv;
 
-  memset(&g, 0, sizeof(GlobalInfo));
+  memset(&g, 0, sizeof(g));
   g.evbase = event_base_new();
   if(init_fifo(&g))
     return 1;
index 580944f2710acad6adea291d7924c3a53003faf5..c24e5937c17c1cfe49c20181c6b0e9cfc19a1a1d 100644 (file)
@@ -158,6 +158,7 @@ int my_trace(CURL *handle, curl_infotype type,
     known_offset = 1;
   }
   secs = epoch_offset + tv.tv_sec;
+  /* !checksrc! disable BANNEDFUNC 1 */
   now = localtime(&secs);  /* not thread safe but we do not care */
   curl_msnprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld",
                  now->tm_hour, now->tm_min, now->tm_sec, (long)tv.tv_usec);
index 450ac7871c2d697762eb7404b869ec3c405ecc3e..f2c3e87c2b3c3d39a6ee6bcc143c114c4b562c7a 100644 (file)
@@ -36,18 +36,18 @@ static struct event_base *base;
 static CURLM *curl_handle;
 static struct event *timeout;
 
-typedef struct curl_context_s {
+struct curl_context {
   struct event *event;
   curl_socket_t sockfd;
-} curl_context_t;
+};
 
 static void curl_perform(int fd, short event, void *arg);
 
-static curl_context_t *create_curl_context(curl_socket_t sockfd)
+static struct curl_context *create_curl_context(curl_socket_t sockfd)
 {
-  curl_context_t *context;
+  struct curl_context *context;
 
-  context = (curl_context_t *) malloc(sizeof(*context));
+  context = (struct curl_context *) malloc(sizeof(*context));
 
   context->sockfd = sockfd;
 
@@ -56,7 +56,7 @@ static curl_context_t *create_curl_context(curl_socket_t sockfd)
   return context;
 }
 
-static void destroy_curl_context(curl_context_t *context)
+static void destroy_curl_context(struct curl_context *context)
 {
   event_del(context->event);
   event_free(context->event);
@@ -125,7 +125,7 @@ static void curl_perform(int fd, short event, void *arg)
 {
   int running_handles;
   int flags = 0;
-  curl_context_t *context;
+  struct curl_context *context;
 
   (void)fd;
 
@@ -134,7 +134,7 @@ static void curl_perform(int fd, short event, void *arg)
   if(event & EV_WRITE)
     flags |= CURL_CSELECT_OUT;
 
-  context = (curl_context_t *) arg;
+  context = (struct curl_context *) arg;
 
   curl_multi_socket_action(curl_handle, context->sockfd, flags,
                            &running_handles);
@@ -175,7 +175,7 @@ static int start_timeout(CURLM *multi, long timeout_ms, void *userp)
 static int handle_socket(CURL *easy, curl_socket_t s, int action, void *userp,
                          void *socketp)
 {
-  curl_context_t *curl_context;
+  struct curl_context *curl_context;
   int events = 0;
 
   (void)easy;
@@ -186,7 +186,7 @@ static int handle_socket(CURL *easy, curl_socket_t s, int action, void *userp,
   case CURL_POLL_OUT:
   case CURL_POLL_INOUT:
     curl_context = socketp ?
-      (curl_context_t *) socketp : create_curl_context(s);
+      (struct curl_context *) socketp : create_curl_context(s);
 
     curl_multi_assign(curl_handle, s, (void *) curl_context);
 
@@ -205,8 +205,8 @@ static int handle_socket(CURL *easy, curl_socket_t s, int action, void *userp,
     break;
   case CURL_POLL_REMOVE:
     if(socketp) {
-      event_del(((curl_context_t*) socketp)->event);
-      destroy_curl_context((curl_context_t*) socketp);
+      event_del(((struct curl_context*) socketp)->event);
+      destroy_curl_context((struct curl_context*) socketp);
       curl_multi_assign(curl_handle, s, NULL);
     }
     break;
index 1b3fca0de0405f7f258b3aaa14444c7f3f47f8a0..1a61745dfa3f877be1de103c3a11bd9c6ccb452b 100644 (file)
@@ -46,18 +46,18 @@ struct datauv {
   CURLM *multi;
 };
 
-typedef struct curl_context_s {
+struct curl_context {
   uv_poll_t poll_handle;
   curl_socket_t sockfd;
   struct datauv *uv;
-} curl_context_t;
+};
 
-static curl_context_t *create_curl_context(curl_socket_t sockfd,
-                                           struct datauv *uv)
+static struct curl_context *create_curl_context(curl_socket_t sockfd,
+                                                struct datauv *uv)
 {
-  curl_context_t *context;
+  struct curl_context *context;
 
-  context = (curl_context_t *) malloc(sizeof(*context));
+  context = (struct curl_context *) malloc(sizeof(*context));
 
   context->sockfd = sockfd;
   context->uv = uv;
@@ -70,11 +70,11 @@ static curl_context_t *create_curl_context(curl_socket_t sockfd,
 
 static void curl_close_cb(uv_handle_t *handle)
 {
-  curl_context_t *context = (curl_context_t *) handle->data;
+  struct curl_context *context = (struct curl_context *) handle->data;
   free(context);
 }
 
-static void destroy_curl_context(curl_context_t *context)
+static void destroy_curl_context(struct curl_context *context)
 {
   uv_close((uv_handle_t *) &context->poll_handle, curl_close_cb);
 }
@@ -101,7 +101,7 @@ static void add_download(const char *url, int num, CURLM *multi)
   fprintf(stderr, "Added download %s -> %s\n", url, filename);
 }
 
-static void check_multi_info(curl_context_t *context)
+static void check_multi_info(struct curl_context *context)
 {
   char *done_url;
   CURLMsg *message;
@@ -142,7 +142,7 @@ static void on_uv_socket(uv_poll_t *req, int status, int events)
 {
   int running_handles;
   int flags = 0;
-  curl_context_t *context = (curl_context_t *) req->data;
+  struct curl_context *context = (struct curl_context *) req->data;
   (void)status;
   if(events & UV_READABLE)
     flags |= CURL_CSELECT_IN;
@@ -157,7 +157,7 @@ static void on_uv_socket(uv_poll_t *req, int status, int events)
 /* callback from libuv when timeout expires */
 static void on_uv_timeout(uv_timer_t *req)
 {
-  curl_context_t *context = (curl_context_t *) req->data;
+  struct curl_context *context = (struct curl_context *) req->data;
   if(context) {
     int running_handles;
     curl_multi_socket_action(context->uv->multi, CURL_SOCKET_TIMEOUT, 0,
@@ -188,7 +188,7 @@ static int cb_socket(CURL *easy, curl_socket_t s, int action,
                      struct datauv *uv,
                      void *socketp)
 {
-  curl_context_t *curl_context;
+  struct curl_context *curl_context;
   int events = 0;
   (void)easy;
 
@@ -197,7 +197,7 @@ static int cb_socket(CURL *easy, curl_socket_t s, int action,
   case CURL_POLL_OUT:
   case CURL_POLL_INOUT:
     curl_context = socketp ?
-      (curl_context_t *) socketp : create_curl_context(s, uv);
+      (struct curl_context *) socketp : create_curl_context(s, uv);
 
     curl_multi_assign(uv->multi, s, (void *) curl_context);
 
@@ -210,8 +210,8 @@ static int cb_socket(CURL *easy, curl_socket_t s, int action,
     break;
   case CURL_POLL_REMOVE:
     if(socketp) {
-      uv_poll_stop(&((curl_context_t*)socketp)->poll_handle);
-      destroy_curl_context((curl_context_t*) socketp);
+      uv_poll_stop(&((struct curl_context*)socketp)->poll_handle);
+      destroy_curl_context((struct curl_context*) socketp);
       curl_multi_assign(uv->multi, s, NULL);
     }
     break;
index 109ae0361b54a9495ea850396423655be2413d67..ba5f09cb075a751f0fd050cc7906ce2bc686aebb 100644 (file)
 
 #define SYNCTIME_UA "synctime/1.0"
 
-typedef struct
-{
+struct conf {
   char http_proxy[MAX_STRING1];
   char proxy_user[MAX_STRING1];
   char timeserver[MAX_STRING1];
-} conf_t;
+};
 
 static const char DefaultTimeServer[3][MAX_STRING1] =
 {
@@ -229,22 +228,22 @@ static void showUsage(void)
   return;
 }
 
-static int conf_init(conf_t *conf)
+static int conf_init(struct conf *conf)
 {
   int i;
 
-  *conf->http_proxy       = 0;
+  *conf->http_proxy = 0;
   for(i = 0; i < MAX_STRING1; i++)
-    conf->proxy_user[i]     = 0;    /* Clean up password from memory */
-  *conf->timeserver       = 0;
+    conf->proxy_user[i] = 0;    /* Clean up password from memory */
+  *conf->timeserver = 0;
   return 1;
 }
 
 int main(int argc, char *argv[])
 {
-  CURL    *curl;
-  conf_t  conf[1];
-  int     RetValue;
+  CURL *curl;
+  struct conf conf[1];
+  int RetValue;
 
   ShowAllHeader   = 0;    /* Do not show HTTP Header */
   AutoSyncTime    = 0;    /* Do not synchronise computer clock */
@@ -299,8 +298,10 @@ int main(int argc, char *argv[])
 
     /* Calculating time diff between GMT and localtime */
     tt       = time(0);
+    /* !checksrc! disable BANNEDFUNC 1 */
     lt       = localtime(&tt);
     tt_local = mktime(lt);
+    /* !checksrc! disable BANNEDFUNC 1 */
     gmt      = gmtime(&tt);
     tt_gmt   = mktime(gmt);
     tzonediffFloat = difftime(tt_local, tt_gmt);
index 208682ef0dc25eba4a22310b76d0300e338cb274..91c5387888c0d929cd64684749e1dc485666c1f6 100644 (file)
@@ -122,7 +122,7 @@ int main(void)
   struct ParserStruct state;
 
   /* Initialize the state structure for parsing. */
-  memset(&state, 0, sizeof(struct ParserStruct));
+  memset(&state, 0, sizeof(state));
   state.ok = 1;
 
   /* Initialize a namespace-aware parser. */
index 3c6aa6920513f8f49544a74218c16cdee2714ed2..22ca8e0b53702d3b36b57427046caefc5892e81e 100644 (file)
@@ -1,8 +1,5 @@
-banfunc strerror
-banfunc strncpy
-banfunc sscanf
 banfunc snprintf
-banfunc vsnprint
-banfunc strtoul
+banfunc sscanf
+banfunc strerror
 banfunc strtol
-banfunc strtok_r
+banfunc vsnprint
index 41889c955bc850e5987f819a71bd4a94fbc254de..d43d54979a39f9e6543552c32832aba1b85bd0f8 100644 (file)
@@ -28,8 +28,8 @@ include Makefile.inc
 
 CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
 
-CHECKSRC_DIST = .checksrc vauth/.checksrc vquic/.checksrc vssh/.checksrc \
-  vtls/.checksrc
+CHECKSRC_DIST = .checksrc \
+  curlx/.checksrc vauth/.checksrc vquic/.checksrc vssh/.checksrc vtls/.checksrc
 
 EXTRA_DIST = config-mac.h config-os400.h config-plan9.h config-riscos.h \
   config-win32.h curl_config.h.in $(LIB_RCFILES) libcurl.def            \
diff --git a/lib/curlx/.checksrc b/lib/curlx/.checksrc
new file mode 100644 (file)
index 0000000..22ca8e0
--- /dev/null
@@ -0,0 +1,5 @@
+banfunc snprintf
+banfunc sscanf
+banfunc strerror
+banfunc strtol
+banfunc vsnprint
index eff4bc0a3f72c5bba440cf9b9eebff2ae4bd7df9..22ca8e0b53702d3b36b57427046caefc5892e81e 100644 (file)
@@ -1,3 +1,5 @@
-banfunc strerror
-banfunc strncpy
+banfunc snprintf
 banfunc sscanf
+banfunc strerror
+banfunc strtol
+banfunc vsnprint
index 770fad0dfcead92e7b4b09fefa07dc383f3c3fae..22ca8e0b53702d3b36b57427046caefc5892e81e 100644 (file)
@@ -1,5 +1,5 @@
-banfunc strerror
-banfunc strncpy
+banfunc snprintf
 banfunc sscanf
-banfunc strtoul
+banfunc strerror
 banfunc strtol
+banfunc vsnprint
index eff4bc0a3f72c5bba440cf9b9eebff2ae4bd7df9..22ca8e0b53702d3b36b57427046caefc5892e81e 100644 (file)
@@ -1,3 +1,5 @@
-banfunc strerror
-banfunc strncpy
+banfunc snprintf
 banfunc sscanf
+banfunc strerror
+banfunc strtol
+banfunc vsnprint
index 770fad0dfcead92e7b4b09fefa07dc383f3c3fae..22ca8e0b53702d3b36b57427046caefc5892e81e 100644 (file)
@@ -1,5 +1,5 @@
-banfunc strerror
-banfunc strncpy
+banfunc snprintf
 banfunc sscanf
-banfunc strtoul
+banfunc strerror
 banfunc strtol
+banfunc vsnprint
index f62962ff1aca37221328e2853dbc566bfa68220c..47ea1cf54af7cd982890971804ef4bbd76d55620 100755 (executable)
@@ -56,6 +56,9 @@ my %banfunc = (
     "vsprintf" => 1,
     "strcat" => 1,
     "strncat" => 1,
+    "strncpy" => 1,
+    "strtok_r" => 1,
+    "strtoul" => 1,
     "_mbscat" => 1,
     "_mbsncat" => 1,
     "_tcscat" => 1,
index 486670ca99f14276761665615753daf851a50adc..7b71afb23689b17583825311cc38973f6d0fa67d 100644 (file)
@@ -1,5 +1,5 @@
 enable STDERR
-banfunc strncpy
+banfunc snprintf
 banfunc sscanf
 banfunc strtol
-banfunc strtoul
+banfunc vsnprint
diff --git a/tests/libtest/.checksrc b/tests/libtest/.checksrc
deleted file mode 100644 (file)
index d3d3aa4..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-disable TYPEDEFSTRUCT
-allowfunc localtime
index 3d3f66d1251bbf414bd07f3946ca7f820e6f4ca4..5d1646b8747983bca8864b4136832265e0c430b8 100644 (file)
@@ -42,7 +42,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include        \
 # Get BUNDLE, FIRST_C, FIRST_H, UTILS_C, UTILS_H, CURLX_C, TESTS_C, STUB_GSS_C, STUB_GSS_H variables
 include Makefile.inc
 
-EXTRA_DIST = CMakeLists.txt .checksrc $(FIRST_C) $(FIRST_H) $(UTILS_C) $(UTILS_H) $(TESTS_C) \
+EXTRA_DIST = CMakeLists.txt $(FIRST_C) $(FIRST_H) $(UTILS_C) $(UTILS_H) $(TESTS_C) \
   test307.pl test610.pl test613.pl test1013.pl test1022.pl mk-lib1521.pl
 
 CFLAGS += @CURL_CFLAG_EXTRAS@
index d29c69e8a16bde65000c659f8d7ddaabca58a12e..f02ec819293fe63eaa153448fea01e19b0c0909f 100644 (file)
@@ -26,6 +26,8 @@
 
 /* Roughly based on Heimdal's gssapi.h */
 
+/* !checksrc! disable TYPEDEFSTRUCT all */
+
 #include <stdint.h>
 #include <stddef.h>
 
index 95e7e0d5ea494b6c73cb5b8887e27db008797230..e6ea57587cda49a30f32e3a60153d30d54746afc 100644 (file)
@@ -108,6 +108,7 @@ int libtest_debug_cb(CURL *handle, curl_infotype type,
       known_offset = 1;
     }
     secs = epoch_offset + tv.tv_sec;
+    /* !checksrc! disable BANNEDFUNC 1 */
     now = localtime(&secs);  /* not thread safe but we don't care */
     curl_msnprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld ",
                    now->tm_hour, now->tm_min, now->tm_sec, (long)tv.tv_usec);
index fef8744a510f42ee495925f5e0d2528352ca1744..8b1bcabe7789b5ec1659c3ba156e877278c865a8 100644 (file)
@@ -1 +1 @@
-banfunc strncpy
+allowfunc strtoul