From: Ralph Corderoy Date: Sat, 11 Nov 2017 23:42:31 +0000 (+0000) Subject: ruserpass.c: Move interface to own file. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/4dc0666a89a99a2c3b4335c5b5e5993a94d76d1e?ds=sidebyside;hp=cc2c28876306b7b24eb3a5272a7ce14b03e7db46 ruserpass.c: Move interface to own file. --- diff --git a/Makefile.am b/Makefile.am index 5909e423..a86102a0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -418,6 +418,7 @@ noinst_HEADERS = \ sbr/read_line.h \ sbr/readconfig.h \ sbr/remdir.h \ + sbr/ruserpass.h \ sbr/seq_add.h \ sbr/seq_bits.h \ sbr/seq_del.h \ diff --git a/h/prototypes.h b/h/prototypes.h index 9e4a98fa..ee38ef16 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -67,22 +67,6 @@ int pidwait (pid_t, int); char *r1bindex(char *, int) PURE; int refile (char **, char *); -/* - * Read our credentials file and (optionally) ask the user for anything - * missing. - * - * Arguments: - * - * host - Hostname (to scan credentials file) - * aname - Pointer to filled-in username - * apass - Pointer to filled-in password - * flags - One or more of RUSERPASS_NO_PROMPT_USER, - * RUSERPASS_NO_PROMPT_PASSWORD - */ -void ruserpass (const char *host, char **aname, char **apass, int flags); -#define RUSERPASS_NO_PROMPT_USER 0x01 -#define RUSERPASS_NO_PROMPT_PASSWORD 0x02 - void scan_detect_mbox_style (FILE *); void scan_finished(void); diff --git a/sbr/credentials.c b/sbr/credentials.c index bf2ab603..b7eda96a 100644 --- a/sbr/credentials.c +++ b/sbr/credentials.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "ruserpass.h" #include "credentials.h" #include "context_find.h" #include "error.h" diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index cbdab4b9..dc94d900 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -22,6 +22,7 @@ */ #include "h/mh.h" +#include "ruserpass.h" #include "credentials.h" #include "error.h" #include "h/utils.h" diff --git a/sbr/ruserpass.h b/sbr/ruserpass.h new file mode 100644 index 00000000..b2da6b55 --- /dev/null +++ b/sbr/ruserpass.h @@ -0,0 +1,38 @@ +/* ruserpass.h -- parse .netrc-format file. + * + * Portions of this code are + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Portions of this code are Copyright (c) 2017, by the authors of + * nmh. See the COPYRIGHT file in the root directory of the nmh + * distribution for complete copyright information. */ + +/* + * Read our credentials file and (optionally) ask the user for anything + * missing. + * + * Arguments: + * + * host - Hostname (to scan credentials file) + * aname - Pointer to filled-in username + * apass - Pointer to filled-in password + * flags - One or more of RUSERPASS_NO_PROMPT_USER, + * RUSERPASS_NO_PROMPT_PASSWORD + */ +void ruserpass(const char *, char **, char **, int); + +#define RUSERPASS_NO_PROMPT_USER 0x01 +#define RUSERPASS_NO_PROMPT_PASSWORD 0x02 diff --git a/uip/mhparse.c b/uip/mhparse.c index 110ed4e7..7a8e88de 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/ruserpass.h" #include "sbr/fmt_rfc2047.h" #include "sbr/uprf.h" #include "sbr/check_charset.h"