From 3905f6ccd0700b98046015c37cdd9af9eb2550cb Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Tue, 16 Jun 2015 21:27:59 +0200 Subject: account: add doxygen group and check return value --- modules/account/account.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'modules/account/account.c') diff --git a/modules/account/account.c b/modules/account/account.c index 9a9f282..46a6861 100644 --- a/modules/account/account.c +++ b/modules/account/account.c @@ -1,16 +1,37 @@ /** * @file account/account.c Load SIP accounts from file * - * Copyright (C) 2010 Creytiv.com + * Copyright (C) 2010 - 2015 Creytiv.com */ #include #include +/** + * @defgroup account account + * + * Load SIP accounts from a file + * + * This module is loading SIP accounts from file ~/.baresip/accounts. + * If the file exist and is readable, all SIP accounts will be populated + * from this file. If the file does not exist, a template file will be + * created. + * + * Examples: + \verbatim + "User 1 with password prompt" + "User 2 with stored password" + "User 2 with ICE" ;medianat=ice + "User 3 with IPv6" + \endverbatim + */ + + static int account_write_template(const char *file) { FILE *f = NULL; const char *login, *pass, *domain; + int r, err = 0; info("account: creating accounts template %s\n", file); @@ -28,7 +49,7 @@ static int account_write_template(const char *file) if (!domain) domain = "domain"; - (void)re_fprintf(f, + r = re_fprintf(f, "#\n" "# SIP accounts - one account per line\n" "#\n" @@ -66,11 +87,13 @@ static int account_write_template(const char *file) ";transport=tcp>\n" "#\n" "#\n", login, pass, domain); + if (r < 0) + err = ENOMEM; if (f) (void)fclose(f); - return 0; + return err; } -- cgit v1.2.3