mapistore: Use __FUNCTION__ macro instead of the literal function name for talloc_named()
authorbradh <bradh@71d39326-ef09-db11-b2a4-00e04c779ad1>
Wed, 16 Feb 2011 04:30:31 +0000 (04:30 +0000)
committerbradh <bradh@71d39326-ef09-db11-b2a4-00e04c779ad1>
Wed, 16 Feb 2011 04:30:31 +0000 (04:30 +0000)
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

trunk/mapiproxy/libmapistore/backends/mapistore_fsocpf.c
trunk/mapiproxy/libmapistore/backends/mapistore_mstoredb.c
trunk/mapiproxy/libmapistore/database/mapistoredb.c
trunk/mapiproxy/libmapistore/database/mapistoredb_namedprops.c
trunk/mapiproxy/libmapistore/indexing/mapistore_indexing.c
trunk/mapiproxy/libmapistore/mapistore_indexing.c
trunk/mapiproxy/libmapistore/mapistore_interface.c
trunk/mapiproxy/libmapistore/mapistore_namedprops.c
trunk/mapiproxy/libmapistore/mapistore_processing.c

index 915f0de1283b7d7b2072de894bc2b03567da2d91..5df57994178e6124c0714b2e001f0471cfb79def 100644 (file)
@@ -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);
index d9de23c95a79e00875aaf87d132d5b24faf433d6..eee795ee1e39c8d3a988fafc201249529018dcb2 100644 (file)
@@ -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);
index e889a13c54d85e609eab105d17594d70a023e235..8a67a406cdb8081bec2b414bb87319f28b94ab34 100644 (file)
@@ -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) {
index 83590b965f82973203dc0eec4b9faf21f17e9b63..8a8430c2c4aad9089f2eb033e2fbb7fbc030f136 100644 (file)
@@ -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);
index 6db79e8bf9e693a6ac0802fab218e7b9b371d36f..0471bd8bcb221acc7d2b9069c4574dfcd5c75383 100644 (file)
@@ -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,
index 2365251548a4ae5c315f6cdb31949d0cd4b7e548..ace74d098f35f0211028de6fee390461ed45d0a8 100644 (file)
@@ -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 */
index 4230e9122f6acbf4cdd4f19b68fd313688555ff1..b8ecad3184293a5a39845505f168553c90b3aecf 100644 (file)
@@ -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, ':');
index 2061cb50d33a555e89e9e177582656354cba52c8..2636ce5af41ca3ccc100ea9dfe9977a930ce9dde 100644 (file)
@@ -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),
index 2f696735d9bf7c89b3854aef7113277f9dc983d3..cc7575e07155d7a5ea2aae597b5927472db38f2e 100644 (file)
@@ -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;