Back to index

lightning-sunbird  0.9+nobinonly
mozStorageConnection.cpp File Reference
#include <stdio.h>
#include "nsError.h"
#include "nsIFile.h"
#include "mozIStorageFunction.h"
#include "mozStorageConnection.h"
#include "mozStorageService.h"
#include "mozStorageStatement.h"
#include "mozStorageValueArray.h"
#include "prlog.h"
#include "prprf.h"

Go to the source code of this file.


static nsresult ConvertResultCode (int srv)
static void mozStorageSqlFuncHelper (sqlite3_context *ctx, int argc, sqlite3_value **argv)

Function Documentation

static nsresult ConvertResultCode ( int  srv) [static]

Definition at line 83 of file mozStorageConnection.cpp.

    switch (srv) {
        case SQLITE_OK:
            return NS_OK;
        case SQLITE_CORRUPT:
        case SQLITE_NOTADB:
            return NS_ERROR_FILE_CORRUPTED;
        case SQLITE_PERM:
        case SQLITE_CANTOPEN:
            return NS_ERROR_FILE_ACCESS_DENIED;
        case SQLITE_BUSY:
            return NS_ERROR_FILE_IS_LOCKED;

    // generic error
    return NS_ERROR_FAILURE;

Here is the caller graph for this function:

static void mozStorageSqlFuncHelper ( sqlite3_context ctx,
int  argc,
sqlite3_value **  argv 
) [static]


Definition at line 444 of file mozStorageConnection.cpp.

    void *userData = sqlite3_user_data (ctx);
    // We don't want to QI here, because this will be called a -lot-
    mozIStorageFunction *userFunction = NS_STATIC_CAST(mozIStorageFunction *, userData);

    nsCOMPtr<mozStorageArgvValueArray> ava = new mozStorageArgvValueArray (argc, argv);
    nsresult rv = userFunction->OnFunctionCall (ava);
    if (NS_FAILED(rv)) {
        NS_WARNING("mozIStorageConnection: User function returned error code!\n");

Here is the call graph for this function: