Skip to content

Commit 51dcaa9

Browse files
spearceJunio C Hamano
authored andcommitted
Rename imap-send's internal info/warn functions.
Because I am about to introduce a global warn() function (much like the global error function) this global declaration would conflict with the one supplied by imap-send. Further since imap-send's warn function output depends on its Quiet setting we cannot simply remove its internal definition and use the forthcoming global one. So refactor warn() -> imap_warn() and info() -> imap_info() (the latter was done just to be consistent in naming). Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent a01c9c2 commit 51dcaa9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

imap-send.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ typedef struct {
9696

9797
static int Verbose, Quiet;
9898

99-
static void info( const char *, ... );
100-
static void warn( const char *, ... );
99+
static void imap_info( const char *, ... );
100+
static void imap_warn( const char *, ... );
101101

102102
static char *next_arg( char ** );
103103

@@ -297,7 +297,7 @@ buffer_gets( buffer_t * b, char **s )
297297
}
298298

299299
static void
300-
info( const char *msg, ... )
300+
imap_info( const char *msg, ... )
301301
{
302302
va_list va;
303303

@@ -310,7 +310,7 @@ info( const char *msg, ... )
310310
}
311311

312312
static void
313-
warn( const char *msg, ... )
313+
imap_warn( const char *msg, ... )
314314
{
315315
va_list va;
316316

@@ -903,7 +903,7 @@ imap_open_store( imap_server_conf_t *srvc )
903903
/* open connection to IMAP server */
904904

905905
if (srvc->tunnel) {
906-
info( "Starting tunnel '%s'... ", srvc->tunnel );
906+
imap_info( "Starting tunnel '%s'... ", srvc->tunnel );
907907

908908
if (socketpair( PF_UNIX, SOCK_STREAM, 0, a )) {
909909
perror( "socketpair" );
@@ -926,31 +926,31 @@ imap_open_store( imap_server_conf_t *srvc )
926926

927927
imap->buf.sock.fd = a[1];
928928

929-
info( "ok\n" );
929+
imap_info( "ok\n" );
930930
} else {
931931
memset( &addr, 0, sizeof(addr) );
932932
addr.sin_port = htons( srvc->port );
933933
addr.sin_family = AF_INET;
934934

935-
info( "Resolving %s... ", srvc->host );
935+
imap_info( "Resolving %s... ", srvc->host );
936936
he = gethostbyname( srvc->host );
937937
if (!he) {
938938
perror( "gethostbyname" );
939939
goto bail;
940940
}
941-
info( "ok\n" );
941+
imap_info( "ok\n" );
942942

943943
addr.sin_addr.s_addr = *((int *) he->h_addr_list[0]);
944944

945945
s = socket( PF_INET, SOCK_STREAM, 0 );
946946

947-
info( "Connecting to %s:%hu... ", inet_ntoa( addr.sin_addr ), ntohs( addr.sin_port ) );
947+
imap_info( "Connecting to %s:%hu... ", inet_ntoa( addr.sin_addr ), ntohs( addr.sin_port ) );
948948
if (connect( s, (struct sockaddr *)&addr, sizeof(addr) )) {
949949
close( s );
950950
perror( "connect" );
951951
goto bail;
952952
}
953-
info( "ok\n" );
953+
imap_info( "ok\n" );
954954

955955
imap->buf.sock.fd = s;
956956

@@ -979,7 +979,7 @@ imap_open_store( imap_server_conf_t *srvc )
979979

980980
if (!preauth) {
981981

982-
info ("Logging in...\n");
982+
imap_info ("Logging in...\n");
983983
if (!srvc->user) {
984984
fprintf( stderr, "Skipping server %s, no user\n", srvc->host );
985985
goto bail;
@@ -1006,7 +1006,7 @@ imap_open_store( imap_server_conf_t *srvc )
10061006
fprintf( stderr, "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host );
10071007
goto bail;
10081008
}
1009-
warn( "*** IMAP Warning *** Password is being sent in the clear\n" );
1009+
imap_warn( "*** IMAP Warning *** Password is being sent in the clear\n" );
10101010
if (imap_exec( ctx, NULL, "LOGIN \"%s\" \"%s\"", srvc->user, srvc->pass ) != RESP_OK) {
10111011
fprintf( stderr, "IMAP error: LOGIN failed\n" );
10121012
goto bail;

0 commit comments

Comments
 (0)