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
17 * Registers the functions declared here with the specified database.
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
29 * Overridden function to perform the SQL functions UPPER and LOWER. These
30 * support unicode, which the default implementations do not do.
33 * The sqlite_context that this function is being called on.
35 * The number of arguments the function is being called with.
37 * An array of the arguments the functions is being called with.
39 NS_HIDDEN_(void) caseFunction(sqlite3_context
*aCtx
,
41 sqlite3_value
**aArgv
);
44 * Overridden function to perform the SQL function LIKE. This supports unicode,
45 * which the default implementation does not do.
48 * The sqlite_context that this function is being called on.
50 * The number of arguments the function is being called with.
52 * An array of the arguments the functions is being called with.
54 NS_HIDDEN_(void) likeFunction(sqlite3_context
*aCtx
,
56 sqlite3_value
**aArgv
);
59 * An implementation of the Levenshtein Edit Distance algorithm for use in
63 * The sqlite_context that this function is being called on.
65 * The number of arguments the function is being called with.
67 * An array of the arguments the functions is being called with.
69 NS_HIDDEN_(void) levenshteinDistanceFunction(sqlite3_context
*aCtx
,
71 sqlite3_value
**aArgv
);
73 } // namespace storage
74 } // namespace mozilla
76 #endif // mozStorageSQLFunctions_h