File: overview.rst

package info (click to toggle)
groonga 9.0.0-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 101,496 kB
  • sloc: ansic: 608,707; ruby: 35,042; xml: 23,643; cpp: 10,319; sh: 7,453; yacc: 5,968; python: 3,033; makefile: 2,609; perl: 133
file content (54 lines) | stat: -rw-r--r-- 1,355 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
.. -*- rst -*-

.. highlightlang:: none

Overview
========

Summary
-------

You can use Groonga as a library. You need to use the following APIs to
initialize and finalize Groonga.

:c:func:`grn_init()` initializes Groonga.
In contrast, :c:func:`grn_fin()` finalizes Groonga.

You must call :c:func:`grn_init()` only once before you use APIs which
are provided by Groonga. You must call :c:func:`grn_fin()` only once
after you finish to use APIs which are provided by Groonga.

Example
-------

Here is an example that uses Groonga as a full-text search library.

.. code-block :: c

   grn_rc rc;
   /* It initializes resources used by Groonga. */
   rc = grn_init();
   if (rc != GRN_SUCCESS) {
     return EXIT_FAILURE;
   }
   /* Some Groonga API calling codes... */
   /* It releases resources used by Groonga. */
   grn_fin();
   return EXIT_SUCCESS;

Reference
---------

.. c:function:: grn_rc grn_init(void)

  ``grn_init()`` initializes resources that are used by Groonga. You
  must call it just once before you call other Groonga APIs.

  :return: ``GRN_SUCCESS`` on success, not ``GRN_SUCCESS`` on error.

.. c:function:: grn_rc grn_fin(void)

  ``grn_fin()`` releases resources that are used by Groonga. You can't
  call other Groonga APIs after you call ``grn_fin()``.

  :return: ``GRN_SUCCESS`` on success, not ``GRN_SUCCESS`` on error.