{"thread":{"id":"6068","subject":"[PATCH 1/3] Rename imap-send's internal info/warn functions.","startedAt":"2006-12-22T00:48:12Z","lastAt":"2006-12-22T00:48:12Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"29981","messageId":"20061222004812.GA14789@spearce.org","threadId":"6068","inReplyTo":null,"subject":"[PATCH 1/3] Rename imap-send's internal info/warn functions.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-12-22T00:48:12Z","receivedAt":"2006-12-22T00:48:12Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Because I am about to introduce a global warn() function (much\nlike the global error function) this global declaration would\nconflict with the one supplied by imap-send.  Further since\nimap-send's warn function output depends on its Quiet setting\nwe cannot simply remove its internal definition and use the\nforthcoming global one.\n\nSo refactor warn() -> imap_warn() and info() -> imap_info()\n(the latter was done just to be consistent in naming).\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n imap-send.c |   24 ++++++++++++------------\n 1 files changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/imap-send.c b/imap-send.c\nindex 894cbbd..ad91858 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -96,8 +96,8 @@ typedef struct {\n \n static int Verbose, Quiet;\n \n-static void info( const char *, ... );\n-static void warn( const char *, ... );\n+static void imap_info( const char *, ... );\n+static void imap_warn( const char *, ... );\n \n static char *next_arg( char ** );\n \n@@ -297,7 +297,7 @@ buffer_gets( buffer_t * b, char **s )\n }\n \n static void\n-info( const char *msg, ... )\n+imap_info( const char *msg, ... )\n {\n \tva_list va;\n \n@@ -310,7 +310,7 @@ info( const char *msg, ... )\n }\n \n static void\n-warn( const char *msg, ... )\n+imap_warn( const char *msg, ... )\n {\n \tva_list va;\n \n@@ -903,7 +903,7 @@ imap_open_store( imap_server_conf_t *srvc )\n \t/* open connection to IMAP server */\n \n \tif (srvc->tunnel) {\n-\t\tinfo( \"Starting tunnel '%s'... \", srvc->tunnel );\n+\t\timap_info( \"Starting tunnel '%s'... \", srvc->tunnel );\n \n \t\tif (socketpair( PF_UNIX, SOCK_STREAM, 0, a )) {\n \t\t\tperror( \"socketpair\" );\n@@ -926,31 +926,31 @@ imap_open_store( imap_server_conf_t *srvc )\n \n \t\timap->buf.sock.fd = a[1];\n \n-\t\tinfo( \"ok\\n\" );\n+\t\timap_info( \"ok\\n\" );\n \t} else {\n \t\tmemset( &addr, 0, sizeof(addr) );\n \t\taddr.sin_port = htons( srvc->port );\n \t\taddr.sin_family = AF_INET;\n \n-\t\tinfo( \"Resolving %s... \", srvc->host );\n+\t\timap_info( \"Resolving %s... \", srvc->host );\n \t\the = gethostbyname( srvc->host );\n \t\tif (!he) {\n \t\t\tperror( \"gethostbyname\" );\n \t\t\tgoto bail;\n \t\t}\n-\t\tinfo( \"ok\\n\" );\n+\t\timap_info( \"ok\\n\" );\n \n \t\taddr.sin_addr.s_addr = *((int *) he->h_addr_list[0]);\n \n \t\ts = socket( PF_INET, SOCK_STREAM, 0 );\n \n-\t\tinfo( \"Connecting to %s:%hu... \", inet_ntoa( addr.sin_addr ), ntohs( addr.sin_port ) );\n+\t\timap_info( \"Connecting to %s:%hu... \", inet_ntoa( addr.sin_addr ), ntohs( addr.sin_port ) );\n \t\tif (connect( s, (struct sockaddr *)&addr, sizeof(addr) )) {\n \t\t\tclose( s );\n \t\t\tperror( \"connect\" );\n \t\t\tgoto bail;\n \t\t}\n-\t\tinfo( \"ok\\n\" );\n+\t\timap_info( \"ok\\n\" );\n \n \t\timap->buf.sock.fd = s;\n \n@@ -979,7 +979,7 @@ imap_open_store( imap_server_conf_t *srvc )\n \n \tif (!preauth) {\n \n-\t\tinfo (\"Logging in...\\n\");\n+\t\timap_info (\"Logging in...\\n\");\n \t\tif (!srvc->user) {\n \t\t\tfprintf( stderr, \"Skipping server %s, no user\\n\", srvc->host );\n \t\t\tgoto bail;\n@@ -1006,7 +1006,7 @@ imap_open_store( imap_server_conf_t *srvc )\n \t\t\tfprintf( stderr, \"Skipping account %s@%s, server forbids LOGIN\\n\", srvc->user, srvc->host );\n \t\t\tgoto bail;\n \t\t}\n-\t\twarn( \"*** IMAP Warning *** Password is being sent in the clear\\n\" );\n+\t\timap_warn( \"*** IMAP Warning *** Password is being sent in the clear\\n\" );\n \t\tif (imap_exec( ctx, NULL, \"LOGIN \\\"%s\\\" \\\"%s\\\"\", srvc->user, srvc->pass ) != RESP_OK) {\n \t\t\tfprintf( stderr, \"IMAP error: LOGIN failed\\n\" );\n \t\t\tgoto bail;\n-- \n1.4.4.3.ga78a1\n"}]}