]> git.notmuchmail.org Git - notmuch/commitdiff
lib: replace deprecated n_q_search_messages with status returning version
authorDavid Bremner <david@tethera.net>
Sun, 26 Feb 2017 21:21:32 +0000 (17:21 -0400)
committerDavid Bremner <david@tethera.net>
Wed, 22 Mar 2017 11:35:07 +0000 (08:35 -0300)
This function was deprecated in notmuch 0.21.  We re-use the name for
a status returning version, and deprecate the _st name.

14 files changed:
bindings/python/notmuch/query.py
bindings/ruby/query.c
lib/database.cc
lib/notmuch.h
lib/query.cc
lib/thread.cc
notmuch-count.c
notmuch-dump.c
notmuch-reply.c
notmuch-search.c
notmuch-show.c
notmuch-tag.c
test/T560-lib-error.sh
test/T640-database-modified.sh

index 3419f6265d2a14c8114f963403ad91d6270f8687..a91bb74091c3392e3fe8f92f7641cf770f521bc9 100644 (file)
@@ -164,9 +164,9 @@ class Query(object):
         return Threads(threads_p, self)
 
     """notmuch_query_search_messages_st"""
-    _search_messages_st = nmlib.notmuch_query_search_messages_st
-    _search_messages_st.argtypes = [NotmuchQueryP, POINTER(NotmuchMessagesP)]
-    _search_messages_st.restype = c_uint
+    _search_messages = nmlib.notmuch_query_search_messages
+    _search_messages.argtypes = [NotmuchQueryP, POINTER(NotmuchMessagesP)]
+    _search_messages.restype = c_uint
 
     def search_messages(self):
         """Filter messages according to the query and return
@@ -177,7 +177,7 @@ class Query(object):
         """
         self._assert_query_is_initialized()
         msgs_p = NotmuchMessagesP() # == NULL
-        status = Query._search_messages_st(self._query, byref(msgs_p))
+        status = Query._search_messages(self._query, byref(msgs_p))
         if status != 0:
             raise NotmuchError(status)
 
index 4b3f1c4f761a3c32f5101d299ed53bb1b3fea52e..2e36df6a05814a7feb18baef5f2e025fa021c1c8 100644 (file)
@@ -159,7 +159,7 @@ notmuch_rb_query_search_messages (VALUE self)
 
     Data_Get_Notmuch_Query (self, query);
 
-    status = notmuch_query_search_messages_st (query, &messages);
+    status = notmuch_query_search_messages (query, &messages);
     if (status)
        notmuch_rb_status_raise (status);
 
index a679cbabbac95a2d39885292341370e1d040d8c0..125c4b92baab446e3c7faff5a01fc10232f4fe84 100644 (file)
@@ -1531,7 +1531,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,
 
        query = notmuch_query_create (notmuch, "");
 
-       status = notmuch_query_search_messages_st (query, &messages);
+       status = notmuch_query_search_messages (query, &messages);
        if (status)
            goto DONE;
        for (;
index 601b2e3e8550616c2deac5fad7870287f3634eeb..4b01e3ad88cf0dfacc71023c22fb60816c534081 100644 (file)
@@ -911,23 +911,23 @@ notmuch_query_search_threads_st (notmuch_query_t *query, notmuch_threads_t **out
  *
  * If a Xapian exception occurs this function will return NULL.
  *
- * @since libnotmuch 4.2 (notmuch 0.20)
+ * @since libnotmuch 5 (notmuch 0.25)
  */
 notmuch_status_t
-notmuch_query_search_messages_st (notmuch_query_t *query,
-                                 notmuch_messages_t **out);
+notmuch_query_search_messages (notmuch_query_t *query,
+                              notmuch_messages_t **out);
 /**
- * Like notmuch_query_search_messages, but without a status return.
- *
- * If a Xapian exception occurs this function will return NULL.
+ * Deprecated alias for notmuch_query_search_messages
  *
- * @deprecated Deprecated as of libnotmuch 4.3 (notmuch 0.21). Please use
- * notmuch_query_search_messages_st instead.
+ * @deprecated Deprecated as of libnotmuch 5 (notmuch 0.25). Please use
+ * notmuch_query_search_messages instead.
  *
  */
-NOTMUCH_DEPRECATED(4,3)
-notmuch_messages_t *
-notmuch_query_search_messages (notmuch_query_t *query);
+
+NOTMUCH_DEPRECATED(5,0)
+notmuch_status_t
+notmuch_query_search_messages_st (notmuch_query_t *query,
+                                 notmuch_messages_t **out);
 
 /**
  * Destroy a notmuch_query_t along with any associated resources.
index 2581ee64a4932726307f68657ffcc1f889a27cee..7192e7f049ddbb678d55ab07219aefa491ea74e3 100644 (file)
@@ -233,20 +233,16 @@ _notmuch_exclude_tags (notmuch_query_t *query)
     return exclude_query;
 }
 
-notmuch_messages_t *
-notmuch_query_search_messages (notmuch_query_t *query)
+
+notmuch_status_t
+notmuch_query_search_messages_st (notmuch_query_t *query,
+                                 notmuch_messages_t **out)
 {
-    notmuch_status_t status;
-    notmuch_messages_t *messages;
-    status = notmuch_query_search_messages_st (query, &messages);
-    if (status)
-       return NULL;
-    else
-       return messages;
+    return notmuch_query_search_messages (query, out);
 }
 
 notmuch_status_t
-notmuch_query_search_messages_st (notmuch_query_t *query,
+notmuch_query_search_messages (notmuch_query_t *query,
                                  notmuch_messages_t **out)
 {
     return _notmuch_query_search_documents (query, "mail", out);
@@ -519,7 +515,7 @@ notmuch_query_search_threads (notmuch_query_t *query,
 
     threads->query = query;
 
-    status = notmuch_query_search_messages_st (query, &messages);
+    status = notmuch_query_search_messages (query, &messages);
     if (status) {
        talloc_free (threads);
        return status;
@@ -708,7 +704,7 @@ notmuch_query_count_threads_st (notmuch_query_t *query, unsigned *count)
 
     sort = query->sort;
     query->sort = NOTMUCH_SORT_UNSORTED;
-    ret = notmuch_query_search_messages_st (query, &messages);
+    ret = notmuch_query_search_messages (query, &messages);
     if (ret)
        return ret;
     query->sort = sort;
index 84ee52980df6130948b7c2fd8c64bbb4c03d242f..561ca5bec783cd9a014563412acac76f5205dac0 100644 (file)
@@ -505,7 +505,7 @@ _notmuch_thread_create (void *ctx,
      * oldest or newest subject is desired. */
     notmuch_query_set_sort (thread_id_query, NOTMUCH_SORT_OLDEST_FIRST);
 
-    status = notmuch_query_search_messages_st (thread_id_query, &messages);
+    status = notmuch_query_search_messages (thread_id_query, &messages);
     if (status)
        goto DONE;
 
index 35a2aa707b4d88e62a357b6e123a0e19e2decaa0..d3457bbe91bd07747ddee2c86e3fe1392cac80d3 100644 (file)
@@ -43,7 +43,7 @@ count_files (notmuch_query_t *query)
     notmuch_status_t status;
     int count = 0;
 
-    status = notmuch_query_search_messages_st (query, &messages);
+    status = notmuch_query_search_messages (query, &messages);
     if (print_status_query ("notmuch count", query, status))
        return -1;
 
index e7965ceab1c55fb9347b6657df45fa62330b4839..0cbcdc16695c3686ff6d1058da913be336a8ad63 100644 (file)
@@ -240,7 +240,7 @@ database_dump_file (notmuch_database_t *notmuch, gzFile output,
      */
     notmuch_query_set_sort (query, NOTMUCH_SORT_UNSORTED);
 
-    status = notmuch_query_search_messages_st (query, &messages);
+    status = notmuch_query_search_messages (query, &messages);
     if (print_status_query ("notmuch dump", query, status))
        return EXIT_FAILURE;
 
index 166a59467eec711ac8fb9b5d22f3e6b6027818da..85efc70243e2b12c6cfc919c935f5566df434b11 100644 (file)
@@ -645,7 +645,7 @@ static int do_reply(notmuch_config_t *config,
            sp = sprinter_sexp_create (config, stdout);
     }
 
-    status = notmuch_query_search_messages_st (query, &messages);
+    status = notmuch_query_search_messages (query, &messages);
     if (print_status_query ("notmuch reply", query, status))
        return 1;
 
index c6899ffa34cb6079aeb1ee37425cb7548e32ac16..1c4d52053a73cd42092b6e7a1470ab71aca00e69 100644 (file)
@@ -538,7 +538,7 @@ do_search_messages (search_context_t *ctx)
            ctx->offset = 0;
     }
 
-    status = notmuch_query_search_messages_st (ctx->query, &messages);
+    status = notmuch_query_search_messages (ctx->query, &messages);
     if (print_status_query ("notmuch search", ctx->query, status))
        return 1;
 
@@ -629,7 +629,7 @@ do_search_tags (const search_context_t *ctx)
        tags = notmuch_database_get_all_tags (notmuch);
     } else {
        notmuch_status_t status;
-       status = notmuch_query_search_messages_st (query, &messages);
+       status = notmuch_query_search_messages (query, &messages);
        if (print_status_query ("notmuch search", query, status))
            return 1;
 
index 75fb284986eb068548a4b957afe96675cda63d3f..ff8228fed1ef220a2e54e251f65849ce2615e0a8 100644 (file)
@@ -917,7 +917,7 @@ do_show_single (void *ctx,
        return 1;
     }
 
-    status = notmuch_query_search_messages_st (query, &messages);
+    status = notmuch_query_search_messages (query, &messages);
     if (print_status_query ("notmuch show", query, status))
        return 1;
 
index 18d78ddd1ad7a2391e9f66b7f5c6c2eb905c42a1..9c03754d58568a04f9a7971d2296ab014c19f054 100644 (file)
@@ -121,7 +121,7 @@ tag_query (void *ctx, notmuch_database_t *notmuch, const char *query_string,
     /* tagging is not interested in any special sort order */
     notmuch_query_set_sort (query, NOTMUCH_SORT_UNSORTED);
 
-    status = notmuch_query_search_messages_st (query, &messages);
+    status = notmuch_query_search_messages (query, &messages);
     if (print_status_query ("notmuch tag", query, status))
        return status;
 
index e775216ee29bd47ff55f31fa03a202580c663eea..f18c88132252c87a4f2e92fd2340018fc8c264d1 100755 (executable)
@@ -286,7 +286,7 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
    {
        notmuch_messages_t *messages = NULL;
        notmuch_query_t *query=notmuch_query_create (db, "*");
-       stat = notmuch_query_search_messages_st (query, &messages);
+       stat = notmuch_query_search_messages (query, &messages);
    }
 EOF
 sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' < OUTPUT > OUTPUT.clean
index 92758e19f65a2770a96199f32e395db1a3e22074..e35e35f64289d5b84c11b5c0d244e7d3f6e09728 100755 (executable)
@@ -35,7 +35,7 @@ main (int argc, char **argv)
 
     EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &rw_db));
     query = notmuch_query_create(rw_db, "");
-    EXPECT0 (notmuch_query_search_messages_st (query, &messages));
+    EXPECT0 (notmuch_query_search_messages (query, &messages));
 
     for (;
         notmuch_messages_valid (messages);