docs/examples: remove spurious white spaces all over
... to please the new, slightly picker, checksrc.pl
This commit is contained in:
Родитель
3d94a113e9
Коммит
6ddab23fb1
|
@ -28,7 +28,7 @@
|
|||
#include <curl/curl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
size_t writefunction( void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
size_t writefunction(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
fwrite(ptr, size, nmemb, stream);
|
||||
return (nmemb*size);
|
||||
|
|
|
@ -415,7 +415,7 @@ int main(int argc, char **argv)
|
|||
goto err;
|
||||
}
|
||||
|
||||
if(!(p12bio = BIO_new_file(p.p12file , "rb"))) {
|
||||
if(!(p12bio = BIO_new_file(p.p12file, "rb"))) {
|
||||
BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file);
|
||||
goto err;
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ int main(int argc, char **argv)
|
|||
|
||||
{
|
||||
int lu; int i=0;
|
||||
while((lu = BIO_read (in, &binaryptr[i], tabLength-i)) >0 ) {
|
||||
while((lu = BIO_read (in, &binaryptr[i], tabLength-i)) >0) {
|
||||
i+=lu;
|
||||
if(i== tabLength) {
|
||||
tabLength+=100;
|
||||
|
|
|
@ -329,7 +329,7 @@ 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(char *url, GlobalInfo *g )
|
||||
static void new_conn(char *url, GlobalInfo *g)
|
||||
{
|
||||
ConnInfo *conn;
|
||||
CURLMcode rc;
|
||||
|
|
|
@ -107,7 +107,7 @@ int main(void)
|
|||
curl_easy_setopt(curl, CURLOPT_URL, "http://99.99.99.99:9999");
|
||||
|
||||
/* Create the socket "manually" */
|
||||
if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD ) {
|
||||
if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD) {
|
||||
printf("Error creating listening socket.\n");
|
||||
return 3;
|
||||
}
|
||||
|
|
|
@ -247,7 +247,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
|||
if(!fdp) {
|
||||
MSG_OUT("Adding data: %s%s\n",
|
||||
what&CURL_POLL_IN?"READ":"",
|
||||
what&CURL_POLL_OUT?"WRITE":"" );
|
||||
what&CURL_POLL_OUT?"WRITE":"");
|
||||
addsock(s, e, what, g);
|
||||
}
|
||||
else {
|
||||
|
@ -279,7 +279,7 @@ 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(char *url, GlobalInfo *g )
|
||||
static void new_conn(char *url, GlobalInfo *g)
|
||||
{
|
||||
ConnInfo *conn;
|
||||
CURLMcode rc;
|
||||
|
|
|
@ -191,7 +191,7 @@ static void event_cb(int fd, short kind, void *userp)
|
|||
mcode_or_die("event_cb: curl_multi_socket_action", rc);
|
||||
|
||||
check_multi_info(g);
|
||||
if(g->still_running <= 0 ) {
|
||||
if(g->still_running <= 0) {
|
||||
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
|
||||
if(evtimer_pending(g->timer_event, NULL)) {
|
||||
evtimer_del(g->timer_event);
|
||||
|
@ -312,7 +312,7 @@ 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(char *url, GlobalInfo *g )
|
||||
static void new_conn(char *url, GlobalInfo *g)
|
||||
{
|
||||
ConnInfo *conn;
|
||||
CURLMcode rc;
|
||||
|
@ -360,7 +360,7 @@ static void fifo_cb(int fd, short event, void *arg)
|
|||
s[0]='\0';
|
||||
rv=fscanf(g->input, "%1023s%n", s, &n);
|
||||
s[n]='\0';
|
||||
if(n && s[0] ) {
|
||||
if(n && s[0]) {
|
||||
new_conn(s, arg); /* if we read a URL, go get it! */
|
||||
}
|
||||
else
|
||||
|
|
|
@ -37,27 +37,27 @@ uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out)
|
|||
{
|
||||
uint r;
|
||||
r = size * nmemb;
|
||||
tidyBufAppend( out, in, r );
|
||||
tidyBufAppend(out, in, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Traverse the document tree */
|
||||
void dumpNode(TidyDoc doc, TidyNode tnod, int indent )
|
||||
void dumpNode(TidyDoc doc, TidyNode tnod, int indent)
|
||||
{
|
||||
TidyNode child;
|
||||
for(child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) {
|
||||
ctmbstr name = tidyNodeGetName( child );
|
||||
ctmbstr name = tidyNodeGetName(child);
|
||||
if(name) {
|
||||
/* if it has a name, then it's an HTML tag ... */
|
||||
TidyAttr attr;
|
||||
printf( "%*.*s%s ", indent, indent, "<", name);
|
||||
printf("%*.*s%s ", indent, indent, "<", name);
|
||||
/* walk the attribute list */
|
||||
for(attr=tidyAttrFirst(child); attr; attr=tidyAttrNext(attr) ) {
|
||||
printf(tidyAttrName(attr));
|
||||
tidyAttrValue(attr)?printf("=\"%s\" ",
|
||||
tidyAttrValue(attr)):printf(" ");
|
||||
}
|
||||
printf( ">\n");
|
||||
printf(">\n");
|
||||
}
|
||||
else {
|
||||
/* if it doesn't have a name, then it's probably text, cdata, etc... */
|
||||
|
@ -67,12 +67,12 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent )
|
|||
printf("%*.*s\n", indent, indent, buf.bp?(char *)buf.bp:"");
|
||||
tidyBufFree(&buf);
|
||||
}
|
||||
dumpNode( doc, child, indent + 4 ); /* recursive */
|
||||
dumpNode(doc, child, indent + 4); /* recursive */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv )
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CURL *curl;
|
||||
char curl_errbuf[CURL_ERROR_SIZE];
|
||||
|
@ -91,7 +91,7 @@ int main(int argc, char **argv )
|
|||
tdoc = tidyCreate();
|
||||
tidyOptSetBool(tdoc, TidyForceOutput, yes); /* try harder */
|
||||
tidyOptSetInt(tdoc, TidyWrapLen, 4096);
|
||||
tidySetErrorBuffer( tdoc, &tidy_errbuf );
|
||||
tidySetErrorBuffer(tdoc, &tidy_errbuf);
|
||||
tidyBufInit(&docbuf);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &docbuf);
|
||||
|
@ -103,7 +103,7 @@ int main(int argc, char **argv )
|
|||
if(err >= 0) {
|
||||
err = tidyRunDiagnostics(tdoc); /* load tidy error buffer */
|
||||
if(err >= 0) {
|
||||
dumpNode( tdoc, tidyGetRoot(tdoc), 0 ); /* walk the tree */
|
||||
dumpNode(tdoc, tidyGetRoot(tdoc), 0); /* walk the tree */
|
||||
fprintf(stderr, "%s\n", tidy_errbuf.bp); /* show errors */
|
||||
}
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ int main(int argc, char **argv )
|
|||
|
||||
}
|
||||
else
|
||||
printf( "usage: %s <url>\n", argv[0] );
|
||||
printf("usage: %s <url>\n", argv[0]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ static int server_push_callback(CURL *parent,
|
|||
|
||||
headp = curl_pushheader_byname(headers, ":path");
|
||||
if(headp) {
|
||||
fprintf(stderr, "**** The PATH is %s\n", headp /* skip :path + colon */ );
|
||||
fprintf(stderr, "**** The PATH is %s\n", headp /* skip :path + colon */);
|
||||
}
|
||||
|
||||
(*transfers)++; /* one more */
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#define MUTEX_CLEANUP(x) pthread_mutex_destroy(&(x))
|
||||
#define MUTEX_LOCK(x) pthread_mutex_lock(&(x))
|
||||
#define MUTEX_UNLOCK(x) pthread_mutex_unlock(&(x))
|
||||
#define THREAD_ID pthread_self( )
|
||||
#define THREAD_ID pthread_self()
|
||||
|
||||
|
||||
void handle_error(const char *file, int lineno, const char *msg)
|
||||
|
@ -69,10 +69,10 @@ int thread_setup(void)
|
|||
{
|
||||
int i;
|
||||
|
||||
mutex_buf = malloc(CRYPTO_num_locks( ) * sizeof(MUTEX_TYPE));
|
||||
mutex_buf = malloc(CRYPTO_num_locks() * sizeof(MUTEX_TYPE));
|
||||
if(!mutex_buf)
|
||||
return 0;
|
||||
for(i = 0; i < CRYPTO_num_locks( ); i++)
|
||||
for(i = 0; i < CRYPTO_num_locks(); i++)
|
||||
MUTEX_SETUP(mutex_buf[i]);
|
||||
CRYPTO_set_id_callback(id_function);
|
||||
CRYPTO_set_locking_callback(locking_function);
|
||||
|
@ -87,7 +87,7 @@ int thread_cleanup(void)
|
|||
return 0;
|
||||
CRYPTO_set_id_callback(NULL);
|
||||
CRYPTO_set_locking_callback(NULL);
|
||||
for(i = 0; i < CRYPTO_num_locks( ); i++)
|
||||
for(i = 0; i < CRYPTO_num_locks(); i++)
|
||||
MUTEX_CLEANUP(mutex_buf[i]);
|
||||
free(mutex_buf);
|
||||
mutex_buf = NULL;
|
||||
|
|
|
@ -46,12 +46,12 @@ static int _getch(void)
|
|||
{
|
||||
struct termios oldt, newt;
|
||||
int ch;
|
||||
tcgetattr( STDIN_FILENO, &oldt );
|
||||
tcgetattr(STDIN_FILENO, &oldt);
|
||||
newt = oldt;
|
||||
newt.c_lflag &= ~( ICANON | ECHO );
|
||||
tcsetattr( STDIN_FILENO, TCSANOW, &newt );
|
||||
newt.c_lflag &= ~( ICANON | ECHO);
|
||||
tcsetattr(STDIN_FILENO, TCSANOW, &newt);
|
||||
ch = getchar();
|
||||
tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
|
||||
tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
|
||||
return ch;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -81,7 +81,7 @@ void *pull_one_url(void *NaN)
|
|||
g_strdup_printf("xoap.weather.com/weather/local/%s?cc=*&dayf=5&unit=i\n",
|
||||
urls[j]);
|
||||
|
||||
printf( "http %s", http );
|
||||
printf("http %s", http);
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
|
|
|
@ -41,7 +41,7 @@ int main(int argc, char *argv[])
|
|||
static const char *pagefilename = "page.out";
|
||||
FILE *pagefile;
|
||||
|
||||
if(argc < 2 ) {
|
||||
if(argc < 2) {
|
||||
printf("Usage: %s <URL>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче