Bug 899135 - Drop buffers in ScriptProcessorNode instead of buffering them when the...
[gecko.git] / storage / src / mozStorageSQLFunctions.h
blobf35eb1e69c95d62e5272670436f1f5850b4deed2
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozStorageSQLFunctions_h
8 #define mozStorageSQLFunctions_h
10 #include "sqlite3.h"
11 #include "nscore.h"
13 namespace mozilla {
14 namespace storage {
16 /**
17 * Registers the functions declared here with the specified database.
19 * @param aDB
20 * The database we'll be registering the functions with.
21 * @return the SQLite status code indicating success or failure.
23 NS_HIDDEN_(int) registerFunctions(sqlite3 *aDB);
25 ////////////////////////////////////////////////////////////////////////////////
26 //// Predefined Functions
28 /**
29 * Overridden function to perform the SQL functions UPPER and LOWER. These
30 * support unicode, which the default implementations do not do.
32 * @param aCtx
33 * The sqlite_context that this function is being called on.
34 * @param aArgc
35 * The number of arguments the function is being called with.
36 * @param aArgv
37 * An array of the arguments the functions is being called with.
39 NS_HIDDEN_(void) caseFunction(sqlite3_context *aCtx,
40 int aArgc,
41 sqlite3_value **aArgv);
43 /**
44 * Overridden function to perform the SQL function LIKE. This supports unicode,
45 * which the default implementation does not do.
47 * @param aCtx
48 * The sqlite_context that this function is being called on.
49 * @param aArgc
50 * The number of arguments the function is being called with.
51 * @param aArgv
52 * An array of the arguments the functions is being called with.
54 NS_HIDDEN_(void) likeFunction(sqlite3_context *aCtx,
55 int aArgc,
56 sqlite3_value **aArgv);
58 /**
59 * An implementation of the Levenshtein Edit Distance algorithm for use in
60 * Sqlite queries.
62 * @param aCtx
63 * The sqlite_context that this function is being called on.
64 * @param aArgc
65 * The number of arguments the function is being called with.
66 * @param aArgv
67 * An array of the arguments the functions is being called with.
69 NS_HIDDEN_(void) levenshteinDistanceFunction(sqlite3_context *aCtx,
70 int aArgc,
71 sqlite3_value **aArgv);
73 } // namespace storage
74 } // namespace mozilla
76 #endif // mozStorageSQLFunctions_h