From 90ba7bdb2cb2a49b05555d83e7dbe5952ba42124 Mon Sep 17 00:00:00 2001 From: bradh Date: Wed, 16 Feb 2011 04:30:31 +0000 Subject: [PATCH] mapistore: Use __FUNCTION__ macro instead of the literal function name for talloc_named() Just makes it easier to update / harder to forget to change the name. git-svn-id: https://svn.openchange.org/openchange@2667 71d39326-ef09-db11-b2a4-00e04c779ad1 --- .../mapiproxy/libmapistore/backends/mapistore_fsocpf.c | 10 +++++----- .../libmapistore/backends/mapistore_mstoredb.c | 2 +- trunk/mapiproxy/libmapistore/database/mapistoredb.c | 2 +- .../libmapistore/database/mapistoredb_namedprops.c | 6 +++--- .../libmapistore/indexing/mapistore_indexing.c | 2 +- trunk/mapiproxy/libmapistore/mapistore_indexing.c | 2 +- trunk/mapiproxy/libmapistore/mapistore_interface.c | 2 +- trunk/mapiproxy/libmapistore/mapistore_namedprops.c | 8 ++++---- trunk/mapiproxy/libmapistore/mapistore_processing.c | 8 ++++---- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/trunk/mapiproxy/libmapistore/backends/mapistore_fsocpf.c b/trunk/mapiproxy/libmapistore/backends/mapistore_fsocpf.c index 915f0de1..5df57994 100644 --- a/trunk/mapiproxy/libmapistore/backends/mapistore_fsocpf.c +++ b/trunk/mapiproxy/libmapistore/backends/mapistore_fsocpf.c @@ -510,7 +510,7 @@ static enum MAPISTORE_ERROR fsocpf_op_get_fid_by_name(void *private_data, return MAPISTORE_ERROR; } - mem_ctx = talloc_named(NULL, 0, "fsocpf_op_get_fid_by_name"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); /* Step 2. Iterate over the contents of the parent folder, searching for a matching name */ rewinddir(folder->dir); @@ -565,7 +565,7 @@ static void fsocpf_set_folder_props(const char *folder_uri, struct SRow *aRow) char *propfile; uint32_t i; - mem_ctx = talloc_named(NULL, 0, "fsocpf_set_folder_props"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); /* Create the array of mapi properties */ mapi_lpProps.lpProps = talloc_array(mem_ctx, struct mapi_SPropValue, aRow->cValues); @@ -642,7 +642,7 @@ static enum MAPISTORE_ERROR fsocpf_op_mkdir(void *private_data, return MAPISTORE_ERR_NO_DIRECTORY; } - mem_ctx = talloc_named(NULL, 0, "fsocpf_op_mkdir"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); /* Step 2. Stringify fid and create directory */ newfolder = talloc_asprintf(mem_ctx, "%s/%s", folder->uri, folder_name); @@ -725,7 +725,7 @@ static enum MAPISTORE_ERROR fsocpf_op_rmdir(void *private_data, const char *pare el = fsocpf_find_folder(fsocpf_ctx, folder_uri); MAPISTORE_RETVAL_IF(!el, MAPISTORE_ERR_NO_DIRECTORY, NULL); - mem_ctx = talloc_named(NULL, 0, "fsocpf_op_mkdir"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); /* Step 3. Remove .properties file */ propertiespath = talloc_asprintf(mem_ctx, "%s/.properties", folder_uri); @@ -794,7 +794,7 @@ static enum MAPISTORE_ERROR fsocpf_op_opendir(void *private_data, const char *pa MAPISTORE_RETVAL_IF(!folder, MAPISTORE_ERR_NO_DIRECTORY, NULL); } - mem_ctx = talloc_named(NULL, 0, "fsocpf_op_opendir"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); /* Read the directory and search for the fid to open */ MSTORE_DEBUG_INFO(MSTORE_LEVEL_DEBUG, "Looking for '%s'\n", folder_uri); diff --git a/trunk/mapiproxy/libmapistore/backends/mapistore_mstoredb.c b/trunk/mapiproxy/libmapistore/backends/mapistore_mstoredb.c index d9de23c9..eee795ee 100644 --- a/trunk/mapiproxy/libmapistore/backends/mapistore_mstoredb.c +++ b/trunk/mapiproxy/libmapistore/backends/mapistore_mstoredb.c @@ -298,7 +298,7 @@ static enum MAPISTORE_ERROR mstoredb_op_mkdir(void *private_data, return retval; } - mem_ctx = talloc_named(NULL, 0, "mstoredb_op_mkdir"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); /* Step 2. Generate the URI for the folder */ retval = mapistore_strip_ns_from_uri(parent_uri, &stripped_uri); diff --git a/trunk/mapiproxy/libmapistore/database/mapistoredb.c b/trunk/mapiproxy/libmapistore/database/mapistoredb.c index e889a13c..8a67a406 100644 --- a/trunk/mapiproxy/libmapistore/database/mapistoredb.c +++ b/trunk/mapiproxy/libmapistore/database/mapistoredb.c @@ -343,7 +343,7 @@ enum MAPISTORE_ERROR mapistoredb_register_new_mailbox(struct mapistoredb_context } /* Step 2. Create the user store entry within the mapistore database */ - mem_ctx = talloc_named(NULL, 0, "mapistoredb_register_new_mailbox"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); user_store_ldif = talloc_asprintf(mem_ctx, MDB_USER_STORE_LDIF_TMPL, username, firstorgdn, username); if (write_ldif_string_to_store(mdb_ctx, user_store_ldif) == false) { diff --git a/trunk/mapiproxy/libmapistore/database/mapistoredb_namedprops.c b/trunk/mapiproxy/libmapistore/database/mapistoredb_namedprops.c index 83590b96..8a8430c2 100644 --- a/trunk/mapiproxy/libmapistore/database/mapistoredb_namedprops.c +++ b/trunk/mapiproxy/libmapistore/database/mapistoredb_namedprops.c @@ -53,7 +53,7 @@ enum MAPISTORE_ERROR mapistoredb_namedprops_provision(struct mapistoredb_context ret = stat(mapistore_get_named_properties_database_path(), &sb); MAPISTORE_RETVAL_IF(ret == -1, MAPISTORE_ERR_DATABASE_INIT, NULL); - mem_ctx = talloc_named(NULL, 0, "mapistoredb_namedprops_provision"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); MAPISTORE_RETVAL_IF(!mem_ctx, MAPISTORE_ERR_NO_MEMORY, NULL); /* Step 1. Retrieve the path to the LDIF file */ @@ -375,7 +375,7 @@ static enum MAPISTORE_ERROR mapistoredb_namedprops_provision_backend(struct mapi retval = mapistore_namedprops_get_default_id(mdb_ctx->mstore_ctx, MAPISTORE_NAMEDPROPS_EXTERNAL, &ext_index); MAPISTORE_RETVAL_IF(retval, retval, NULL); - mem_ctx = talloc_named(NULL, 0, "mapistoredb_namedprops_provision_backend"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); MAPISTORE_RETVAL_IF(!mem_ctx, MAPISTORE_ERR_NO_MEMORY, NULL); /* Step 2. Process and retrieved updated LDIF data */ @@ -528,7 +528,7 @@ enum MAPISTORE_ERROR mapistoredb_namedprops_provision_user(struct mapistoredb_co MAPISTORE_RETVAL_IF(retval, retval, NULL); /* Step 3. Create the LDIF */ - mem_ctx = talloc_named(NULL, 0, "mapistore_namedprops_provision_user"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); MAPISTORE_RETVAL_IF(!mem_ctx, MAPISTORE_ERR_NO_MEMORY, NULL); ldif = talloc_asprintf(mem_ctx, MDB_NPROPS_USER_LDIF, username, mapped_index, username); diff --git a/trunk/mapiproxy/libmapistore/indexing/mapistore_indexing.c b/trunk/mapiproxy/libmapistore/indexing/mapistore_indexing.c index 6db79e8b..0471bd8b 100644 --- a/trunk/mapiproxy/libmapistore/indexing/mapistore_indexing.c +++ b/trunk/mapiproxy/libmapistore/indexing/mapistore_indexing.c @@ -200,7 +200,7 @@ enum MAPISTORE_ERROR mapistore_indexing_context_add(struct mapistore_context *ms } /* Step 2. Otherwise create a new context */ - mem_ctx = talloc_named(NULL, 0, "mapistore_indexing_context_add"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); mictx = talloc_zero(mstore_ctx->mapistore_indexing_list, struct mapistore_indexing_context_list); dbpath = talloc_asprintf(mem_ctx, MAPISTORE_INDEXING_DBPATH_TMPL, diff --git a/trunk/mapiproxy/libmapistore/mapistore_indexing.c b/trunk/mapiproxy/libmapistore/mapistore_indexing.c index 23652515..ace74d09 100644 --- a/trunk/mapiproxy/libmapistore/mapistore_indexing.c +++ b/trunk/mapiproxy/libmapistore/mapistore_indexing.c @@ -92,7 +92,7 @@ _PUBLIC_ enum MAPISTORE_ERROR mapistore_indexing_add(struct mapistore_context *m ictx = mapistore_indexing_search(mstore_ctx, username); MAPISTORE_RETVAL_IF(ictx, MAPISTORE_SUCCESS, NULL); - mem_ctx = talloc_named(NULL, 0, "mapistore_indexing_init"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); ictx = talloc_zero(mstore_ctx->indexing_list, struct indexing_context_list); /* Step 1. Open/Create the indexing database */ diff --git a/trunk/mapiproxy/libmapistore/mapistore_interface.c b/trunk/mapiproxy/libmapistore/mapistore_interface.c index 4230e912..b8ecad31 100644 --- a/trunk/mapiproxy/libmapistore/mapistore_interface.c +++ b/trunk/mapiproxy/libmapistore/mapistore_interface.c @@ -183,7 +183,7 @@ _PUBLIC_ enum MAPISTORE_ERROR mapistore_add_context(struct mapistore_context *ms /* Step 1. Perform Sanity Checks on URI */ MAPISTORE_RETVAL_IF(!uri || strlen(uri) < 4, MAPISTORE_ERR_INVALID_NAMESPACE, NULL); - mem_ctx = talloc_named(NULL, 0, "mapistore_add_context"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); uri_namespace = talloc_strdup(mem_ctx, uri); namespace_start = uri_namespace; uri_namespace= strchr(uri_namespace, ':'); diff --git a/trunk/mapiproxy/libmapistore/mapistore_namedprops.c b/trunk/mapiproxy/libmapistore/mapistore_namedprops.c index 2061cb50..2636ce5a 100644 --- a/trunk/mapiproxy/libmapistore/mapistore_namedprops.c +++ b/trunk/mapiproxy/libmapistore/mapistore_namedprops.c @@ -136,7 +136,7 @@ enum MAPISTORE_ERROR mapistore_namedprops_get_default_id(struct mapistore_contex MAPISTORE_RETVAL_IF(!dflt_id, MAPISTORE_ERR_INVALID_PARAMETER, NULL); ldb_ctx = mstore_ctx->mapistore_nprops_ctx; - mem_ctx = talloc_named(NULL, 0, "mapistore_namedprops_get_default_id"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); MAPISTORE_RETVAL_IF(!mem_ctx, MAPISTORE_ERR_NO_MEMORY, NULL); /* Step 1. Retrieve the internal/external record */ @@ -182,7 +182,7 @@ enum MAPISTORE_ERROR mapistore_namedprops_check_id(struct mapistore_context *mst MAPISTORE_RETVAL_IF(!mstore_ctx->mapistore_nprops_ctx, MAPISTORE_ERR_NOT_INITIALIZED, NULL); ldb_ctx = mstore_ctx->mapistore_nprops_ctx; - mem_ctx = talloc_named(NULL, 0, "mapistore_namedprops_check_id"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); MAPISTORE_RETVAL_IF(!mem_ctx, MAPISTORE_ERR_NO_MEMORY, NULL); /* Step 1. Retrieve the internal/external record */ @@ -240,7 +240,7 @@ _PUBLIC_ int mapistore_namedprops_get_mapped_id(void *_ldb_ctx, MAPISTORE_RETVAL_IF(!propID, MAPISTORE_ERROR, NULL); *propID = 0; - mem_ctx = talloc_named(NULL, 0, "mapistore_namedprops_get_mapped_propID"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); guid = GUID_string(mem_ctx, (const struct GUID *)&nameid.lpguid); switch (nameid.ulKind) { @@ -292,7 +292,7 @@ enum MAPISTORE_ERROR mapistore_namedprops_user_exist(struct mapistore_context *m MAPISTORE_RETVAL_IF(!mstore_ctx->mapistore_nprops_ctx, MAPISTORE_ERR_NOT_INITIALIZED, NULL); MAPISTORE_RETVAL_IF(!username, MAPISTORE_ERR_INVALID_PARAMETER, NULL); - mem_ctx = talloc_named(NULL, 0, "mapistore_namedprops_user_exist"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); ldb_ctx = mstore_ctx->mapistore_nprops_ctx; ret = ldb_search(ldb_ctx, mem_ctx, &res, ldb_get_default_basedn(ldb_ctx), diff --git a/trunk/mapiproxy/libmapistore/mapistore_processing.c b/trunk/mapiproxy/libmapistore/mapistore_processing.c index 2f696735..cc7575e0 100644 --- a/trunk/mapiproxy/libmapistore/mapistore_processing.c +++ b/trunk/mapiproxy/libmapistore/mapistore_processing.c @@ -253,7 +253,7 @@ enum MAPISTORE_ERROR mapistore_init_mapping_context(struct processing_context *p pctx->mapping_ctx = talloc_zero(pctx, struct id_mapping_context); MAPISTORE_RETVAL_IF(!pctx->mapping_ctx, MAPISTORE_ERR_NO_MEMORY, NULL); - mem_ctx = talloc_named(NULL, 0, "mapistore_init_mapping_context"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); /* Step 1. Retrieve the mapistore database path */ db_path = mapistore_get_database_path(); @@ -384,7 +384,7 @@ enum MAPISTORE_ERROR mapistore_ldb_write_ldif_file_to_store(struct ldb_context * f = fopen(ldif_path, "r"); MAPISTORE_RETVAL_IF(!f, MAPISTORE_ERR_DATABASE_INIT, NULL); - mem_ctx = talloc_named(NULL, 0, "mapistore_ldb_write_ldif_file_to_store"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); while ((ldif = ldb_ldif_read_file(ldb_ctx, f))) { struct ldb_message *normalized_msg; @@ -437,7 +437,7 @@ enum MAPISTORE_ERROR mapistore_get_new_fmid(struct processing_context *pctx, MAPISTORE_RETVAL_IF(!username, MAPISTORE_ERR_INVALID_PARAMETER, NULL); MAPISTORE_RETVAL_IF(!fmid, MAPISTORE_ERR_INVALID_PARAMETER, NULL); - mem_ctx = talloc_named(NULL, 0, "mapistore_get_new_fmid"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); /* Step 1. Retrieve the server object */ ldb_ctx = pctx->mapping_ctx->ldb_ctx; @@ -512,7 +512,7 @@ enum MAPISTORE_ERROR mapistore_get_new_allocation_range(struct processing_contex MAPISTORE_RETVAL_IF(!pctx->mapping_ctx->ldb_ctx, MAPISTORE_ERR_NOT_INITIALIZED, NULL); MAPISTORE_RETVAL_IF(!range_start || !range_end, MAPISTORE_ERR_INVALID_PARAMETER, NULL); - mem_ctx = talloc_named(NULL, 0, "mapistore_get_next_range"); + mem_ctx = talloc_named(NULL, 0, __FUNCTION__); /* Step 1. Retrieve the user store object */ ldb_ctx = pctx->mapping_ctx->ldb_ctx; -- 2.34.1