summaryrefslogtreecommitdiff
path: root/lib/smbconf
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-04-11 13:50:53 +0200
committerMichael Adam <obnox@samba.org>2011-05-10 19:13:21 +0200
commitff5838d97aad5b283073726052456b06ecf410b2 (patch)
tree17758bb35392865491bba9ad6a4fb8a4b69046dc /lib/smbconf
parentddc28a683fcf036a279a0d3d7b23504364316fa6 (diff)
downloadsamba-ff5838d97aad5b283073726052456b06ecf410b2.tar.gz
samba-ff5838d97aad5b283073726052456b06ecf410b2.tar.bz2
samba-ff5838d97aad5b283073726052456b06ecf410b2.zip
libsmbconf: Convert smbconf_get_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib/smbconf')
-rw-r--r--lib/smbconf/smbconf.c15
-rw-r--r--lib/smbconf/smbconf.h5
-rw-r--r--lib/smbconf/smbconf_private.h2
-rw-r--r--lib/smbconf/smbconf_txt.c12
4 files changed, 17 insertions, 17 deletions
diff --git a/lib/smbconf/smbconf.c b/lib/smbconf/smbconf.c
index 786f4d32d1..02c49cc877 100644
--- a/lib/smbconf/smbconf.c
+++ b/lib/smbconf/smbconf.c
@@ -291,14 +291,14 @@ sbcErr smbconf_set_global_parameter(struct smbconf_ctx *ctx,
/**
* get the value of a configuration parameter as a string
*/
-WERROR smbconf_get_parameter(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_parameter(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *service,
const char *param,
char **valstr)
{
if (valstr == NULL) {
- return WERR_INVALID_PARAM;
+ return SBC_ERR_INVALID_PARAM;
}
return ctx->ops->get_parameter(ctx, mem_ctx, service, param, valstr);
@@ -309,23 +309,22 @@ WERROR smbconf_get_parameter(struct smbconf_ctx *ctx,
*
* Create [global] if it does not exist.
*/
-WERROR smbconf_get_global_parameter(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_global_parameter(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *param,
char **valstr)
{
- WERROR werr;
sbcErr err;
err = smbconf_global_check(ctx);
if (!SBC_ERROR_IS_OK(err)) {
- return WERR_GENERAL_FAILURE;
+ return err;
}
- werr = smbconf_get_parameter(ctx, mem_ctx, GLOBAL_NAME, param,
- valstr);
+ err = smbconf_get_parameter(ctx, mem_ctx, GLOBAL_NAME, param,
+ valstr);
- return werr;
+ return err;
}
/**
diff --git a/lib/smbconf/smbconf.h b/lib/smbconf/smbconf.h
index 1471ceca1d..15476f1460 100644
--- a/lib/smbconf/smbconf.h
+++ b/lib/smbconf/smbconf.h
@@ -42,6 +42,7 @@ enum _sbcErrType {
typedef enum _sbcErrType sbcErr;
#define SBC_ERROR_IS_OK(x) ((x) == SBC_ERR_OK)
+#define SBC_ERROR_EQUAL(x,y) ((x) == (y))
struct smbconf_ctx;
@@ -97,12 +98,12 @@ sbcErr smbconf_set_parameter(struct smbconf_ctx *ctx,
const char *valstr);
sbcErr smbconf_set_global_parameter(struct smbconf_ctx *ctx,
const char *param, const char *val);
-WERROR smbconf_get_parameter(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_parameter(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *service,
const char *param,
char **valstr);
-WERROR smbconf_get_global_parameter(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_global_parameter(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *param,
char **valstr);
diff --git a/lib/smbconf/smbconf_private.h b/lib/smbconf/smbconf_private.h
index b11a1420ae..9bfcbe097a 100644
--- a/lib/smbconf/smbconf_private.h
+++ b/lib/smbconf/smbconf_private.h
@@ -52,7 +52,7 @@ struct smbconf_ops {
const char *service,
const char *param,
const char *valstr);
- WERROR (*get_parameter)(struct smbconf_ctx *ctx,
+ sbcErr (*get_parameter)(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *service,
const char *param,
diff --git a/lib/smbconf/smbconf_txt.c b/lib/smbconf/smbconf_txt.c
index 0f77254d38..e31009e7b2 100644
--- a/lib/smbconf/smbconf_txt.c
+++ b/lib/smbconf/smbconf_txt.c
@@ -482,7 +482,7 @@ static sbcErr smbconf_txt_set_parameter(struct smbconf_ctx *ctx,
/**
* get the value of a configuration parameter as a string
*/
-static WERROR smbconf_txt_get_parameter(struct smbconf_ctx *ctx,
+static sbcErr smbconf_txt_get_parameter(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *service,
const char *param,
@@ -494,7 +494,7 @@ static WERROR smbconf_txt_get_parameter(struct smbconf_ctx *ctx,
err = smbconf_txt_load_file(ctx);
if (!SBC_ERROR_IS_OK(err)) {
- return WERR_GENERAL_FAILURE;
+ return err;
}
found = smbconf_find_in_array(service,
@@ -502,7 +502,7 @@ static WERROR smbconf_txt_get_parameter(struct smbconf_ctx *ctx,
pd(ctx)->cache->num_shares,
&share_index);
if (!found) {
- return WERR_NO_SUCH_SERVICE;
+ return SBC_ERR_NO_SUCH_SERVICE;
}
found = smbconf_reverse_find_in_array(param,
@@ -510,17 +510,17 @@ static WERROR smbconf_txt_get_parameter(struct smbconf_ctx *ctx,
pd(ctx)->cache->num_params[share_index],
&param_index);
if (!found) {
- return WERR_INVALID_PARAM;
+ return SBC_ERR_INVALID_PARAM;
}
*valstr = talloc_strdup(mem_ctx,
pd(ctx)->cache->param_values[share_index][param_index]);
if (*valstr == NULL) {
- return WERR_NOMEM;
+ return SBC_ERR_NOMEM;
}
- return WERR_OK;
+ return SBC_ERR_OK;
}
/**