您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ sqlite3_result_int函数代码示例

51自学网 2021-06-03 08:15:52
  C++
这篇教程C++ sqlite3_result_int函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中sqlite3_result_int函数的典型用法代码示例。如果您正苦于以下问题:C++ sqlite3_result_int函数的具体用法?C++ sqlite3_result_int怎么用?C++ sqlite3_result_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了sqlite3_result_int函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: convertRResult

intconvertRResult(SEXP ans, sqlite3_context *context){    switch(TYPEOF(ans)) {      case INTSXP:	  sqlite3_result_int(context, INTEGER(ans)[0]);	  break;      case REALSXP:	  sqlite3_result_double(context, REAL(ans)[0]);	  break;      case STRSXP: {	  const char *str = CHAR(STRING_ELT(ans, 0));	  sqlite3_result_text(context, str, -1, SQLITE_TRANSIENT);	  break;      }// Add more    default:	   PROBLEM "Unhandled conversion of result of UDF from R to SQLite"	       WARN;	   break;    }    return(0);}
开发者ID:duncantl,项目名称:RSQLiteUDF,代码行数:25,


示例2: getweight

static void getweight(sqlite3_context *context, int argc, sqlite3_value **argv){    switch (sqlite3_value_type(argv[0]) ) {    case SQLITE_TEXT: {        const unsigned char *tVal = sqlite3_value_text(argv[0]);        const guchar *p = tVal;        gint weight = 0;        while (*p) {            if (*p >= '0' && *p <= '9') {                weight = 10*weight + 1000*(*p - '0');            } else if (*p == '.' || *p == ',') {                p++;                if (*p >= '0' && *p <= '9') {                    weight += 100*(*p - '0');                    p++;                    if (*p >= '0' && *p <= '9') {                        weight += 10*(*p - '0');                    }                }                break;            } else                weight = 0;            p++;        }        sqlite3_result_int(context, weight);        break;    }    default:        sqlite3_result_null(context);        break;    }}
开发者ID:mahiso,项目名称:JudoShiai,代码行数:32,


示例3: pkgdb_regex

static voidpkgdb_regex(sqlite3_context *ctx, int argc, sqlite3_value **argv, int reg_type){	const unsigned char *regex = NULL;	const unsigned char *str;	regex_t *re;	int ret;	if (argc != 2 || (regex = sqlite3_value_text(argv[0])) == NULL ||		(str = sqlite3_value_text(argv[1])) == NULL) {		sqlite3_result_error(ctx, "SQL function regex() called with invalid arguments./n", -1);		return;	}	re = (regex_t *)sqlite3_get_auxdata(ctx, 0);	if (re == NULL) {		re = malloc(sizeof(regex_t));		if (regcomp(re, regex, reg_type | REG_NOSUB) != 0) {			sqlite3_result_error(ctx, "Invalid regex/n", -1);			free(re);			return;		}		sqlite3_set_auxdata(ctx, 0, re, pkgdb_regex_delete);	}	ret = regexec(re, str, 0, NULL, 0);	sqlite3_result_int(ctx, (ret != REG_NOMATCH));}
开发者ID:flz,项目名称:pkgng,代码行数:29,


示例4: utf8error

static void utf8error(sqlite3_context *context, int argc, sqlite3_value **argv){    switch (sqlite3_value_type(argv[0]) ) {    case SQLITE_TEXT: {        const unsigned char *tVal = sqlite3_value_text(argv[0]);        if (g_utf8_validate((gchar *)tVal, -1, NULL))            sqlite3_result_int(context, 0);        else            sqlite3_result_int(context, 1);        break;    }    default:        sqlite3_result_null(context);        break;    }}
开发者ID:mahiso,项目名称:JudoShiai,代码行数:16,


示例5: sql_regexp

/** * REGEXP function for sqlite3. Takes two arguments; the first is the value and * the second the pattern. If the pattern is invalid, errors out. Otherwise, * returns true if the value matches the pattern and false otherwise. * * This function is made available in sqlite3 as the REGEXP operator. * * @param [in] context sqlite3-defined structure * @param [in] argc    number of arguments - always 2 and hence unused * @param [in] argv    0: value to match; 1: pattern to match against */static void sql_regexp(sqlite3_context* context, int argc UNUSED,        sqlite3_value** argv) {    const char* value = (const char*)sqlite3_value_text(argv[0]);    const char* pattern = (const char*)sqlite3_value_text(argv[1]);    switch (Tcl_RegExpMatch(NULL, value, pattern)) {        case 0:            sqlite3_result_int(context, 0);            break;        case 1:            sqlite3_result_int(context, 1);            break;        case -1:            sqlite3_result_error(context, "invalid pattern", -1);            break;    }}
开发者ID:Brucegx,项目名称:Appstore719,代码行数:27,


示例6: sqlite_checksum_int4

static void sqlite_checksum_int4(  sqlite3_context * ctx,  int argc,  sqlite3_value ** argv){  assert(argc==1);  const unsigned char * txt;  size_t len;  switch (sqlite3_value_type(argv[0])) {  case SQLITE_NULL:    txt = NULL;    len = 0;    break;  case SQLITE_TEXT:    txt = sqlite3_value_text(argv[0]);    len = sqlite3_value_bytes(argv[0]);    break;    // hmmm... should I do something else?  case SQLITE_INTEGER:  case SQLITE_FLOAT:  case SQLITE_BLOB:  default:    sqlite3_result_error(ctx, "expecting TEXT or NULL", -1);    return;  }  sqlite3_result_int(ctx, checksum_int4(txt, len));}
开发者ID:adzhou,项目名称:integration,代码行数:27,


示例7: UdfInsertFunc

static void UdfInsertFunc(sqlite3_context* aCtx, int aCnt, sqlite3_value** aValues)	{	int err;  	const char* tail = 0;  	sqlite3* db = 0;  		TEST2(aCnt, 1);		db = sqlite3_context_db_handle(aCtx);/* to test that sqlite3_context_db_handle() can be called */	TEST(db != 0);		TEST(!TheStmt);	err = sqlite3_prepare(TheDb, "INSERT INTO t1(x) VALUES(:Val)", -1, &TheStmt, &tail);	if(err == SQLITE_OK)		{		err = sqlite3_bind_value(TheStmt, 1, aValues[0]);		if(err == SQLITE_OK)			{			err = sqlite3_step(TheStmt);			}		}	(void)sqlite3_finalize(TheStmt);	TheStmt = 0;		sqlite3_result_int(aCtx, err);			}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:26,


示例8: test_destructor_count

static void test_destructor_count(  sqlite3_context *pCtx,   int nArg,  sqlite3_value **argv){  sqlite3_result_int(pCtx, test_destructor_count_var);}
开发者ID:7kbird,项目名称:chrome,代码行数:7,


示例9: likeFunc

/*** Implementation of the like() SQL function.  This function implements** the build-in LIKE operator.  The first argument to the function is the** pattern and the second argument is the string.  So, the SQL statements:****       A LIKE B**** is implemented as like(B,A).**** This same function (with a different compareInfo structure) computes** the GLOB operator.*/static void likeFunc(  sqlite3_context *context,   int argc,   sqlite3_value **argv){  const unsigned char *zA = sqlite3_value_text(argv[0]);  const unsigned char *zB = sqlite3_value_text(argv[1]);  int escape = 0;  if( argc==3 ){    /* The escape character string must consist of a single UTF-8 character.    ** Otherwise, return an error.    */    const unsigned char *zEsc = sqlite3_value_text(argv[2]);    if( sqlite3utf8CharLen((char*)zEsc, -1)!=1 ){      sqlite3_result_error(context,           "ESCAPE expression must be a single character", -1);      return;    }    escape = sqlite3ReadUtf8(zEsc);  }  if( zA && zB ){    struct compareInfo *pInfo = sqlite3_user_data(context);#ifdef SQLITE_TEST    sqlite3_like_count++;#endif    sqlite3_result_int(context, patternCompare(zA, zB, pInfo, escape));  }}
开发者ID:tmarques,项目名称:waheela,代码行数:40,


示例10: cmdline_sqlite3_pid

int cmdline_sqlite3_pid(sqlite3_vtab_cursor* pCursor, sqlite3_context *ctx) {  cmdline_cursor_t *cursor = (cmdline_cursor_t*) pCursor;  cmdline_table_t *table = (cmdline_table_t*) pCursor->pVtab;  cmdline_t* cmdline = (cmdline_t*) vec_get(table->content,cursor->row);  sqlite3_result_int(ctx, cmdline->pid);  return SQLITE_OK;}
开发者ID:matthewaveryusa,项目名称:vsqlite,代码行数:7,


示例11: sqlite3_do_callback

static void sqlite3_do_callback(sqlite3_context *context, const Variant& callback,                                int argc, sqlite3_value **argv, bool is_agg) {  Array params = Array::Create();  php_sqlite3_agg_context *agg_context = NULL;  if (is_agg) {    agg_context = (php_sqlite3_agg_context *)sqlite3_aggregate_context      (context, sizeof(php_sqlite3_agg_context));    params.appendRef(agg_context->context);    params.append(agg_context->row_count);  }  for (int i = 0; i < argc; i++) {    params.append(get_value(argv[i]));  }  Variant ret = vm_call_user_func(callback, params);  if (!is_agg || !argv) {    /* only set the sqlite return value if we are a scalar function,     * or if we are finalizing an aggregate */    if (ret.isInteger()) {      sqlite3_result_int(context, ret.toInt64());    } else if (ret.isNull()) {      sqlite3_result_null(context);    } else if (ret.isDouble()) {      sqlite3_result_double(context, ret.toDouble());    } else {      String sret = ret.toString();      sqlite3_result_text(context, sret.data(), sret.size(), SQLITE_TRANSIENT);    }  } else {    /* we're stepping in an aggregate; the return value goes into     * the context */    agg_context->context = ret;  }}
开发者ID:Fininvest,项目名称:hhvm,代码行数:34,


示例12: xColumn

int xColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int col) {  BaseCursor *pCur = (BaseCursor *)cur;  const auto *pVtab = (VirtualTable *)cur->pVtab;  if (col >= static_cast<int>(pVtab->content->columns.size())) {    // Requested column index greater than column set size.    return SQLITE_ERROR;  }  const auto &column_name = pVtab->content->columns[col].first;  const auto &type = pVtab->content->columns[col].second;  if (pCur->row >= pCur->data.size()) {    // Request row index greater than row set size.    return SQLITE_ERROR;  }  // Attempt to cast each xFilter-populated row/column to the SQLite type.  const auto &value = pCur->data[pCur->row][column_name];  if (pCur->data[pCur->row].count(column_name) == 0) {    // Missing content.    VLOG(1) << "Error " << column_name << " is empty";    sqlite3_result_null(ctx);  } else if (type == TEXT_TYPE) {    sqlite3_result_text(ctx, value.c_str(), value.size(), SQLITE_STATIC);  } else if (type == INTEGER_TYPE) {    long afinite;    if (!safeStrtol(value, 10, afinite) || afinite < INT_MIN ||        afinite > INT_MAX) {      VLOG(1) << "Error casting " << column_name << " (" << value              << ") to INTEGER";      sqlite3_result_null(ctx);    } else {      sqlite3_result_int(ctx, (int)afinite);    }  } else if (type == BIGINT_TYPE || type == UNSIGNED_BIGINT_TYPE) {    long long afinite;    if (!safeStrtoll(value, 10, afinite)) {      VLOG(1) << "Error casting " << column_name << " (" << value              << ") to BIGINT";      sqlite3_result_null(ctx);    } else {      sqlite3_result_int64(ctx, afinite);    }  } else if (type == DOUBLE_TYPE) {    char *end = nullptr;    double afinite = strtod(value.c_str(), &end);    if (end == nullptr || end == value.c_str() || *end != '/0') {      afinite = 0;      VLOG(1) << "Error casting " << column_name << " (" << value              << ") to DOUBLE";      sqlite3_result_null(ctx);    } else {      sqlite3_result_double(ctx, afinite);    }  } else {    LOG(ERROR) << "Error unknown column type " << column_name;  }  return SQLITE_OK;}
开发者ID:200GAUTAM,项目名称:osquery,代码行数:59,


示例13: templatevtabColumn

/*** Return values of columns for the row at which the templatevtab_cursor** is currently pointing.*/static int templatevtabColumn(  sqlite3_vtab_cursor *cur,   /* The cursor */  sqlite3_context *ctx,       /* First argument to sqlite3_result_...() */  int i                       /* Which column to return */){  templatevtab_cursor *pCur = (templatevtab_cursor*)cur;  switch( i ){    case TEMPLATEVTAB_A:      sqlite3_result_int(ctx, 1000 + pCur->iRowid);      break;    default:      assert( i==TEMPLATEVTAB_B );      sqlite3_result_int(ctx, 2000 + pCur->iRowid);      break;  }  return SQLITE_OK;}
开发者ID:HongliYu,项目名称:firefox-ios,代码行数:21,


示例14: collisionFunctionForSqlite

void collisionFunctionForSqlite(sqlite3_context* context, int dunno, sqlite3_value** values) {  Number x(sqlite3_value_double(values[0])), z(sqlite3_value_double(values[1]));  Number distance_sq = FixedPoint::square(collider_x - x)                     + FixedPoint::square(collider_z - z);  sqlite3_result_int(context,                     distance_sq < collider_rsq ? 1 : 0);  ++collider_comparisons;}
开发者ID:karlgluck,项目名称:Evidyon,代码行数:8,


示例15: total_changes

/*** Implementation of the total_changes() SQL function.  The return value is** the same as the sqlite3_total_changes() API function.*/static void total_changes(  sqlite3_context *context,  int arg,  sqlite3_value **argv){  sqlite3 *db = sqlite3_user_data(context);  sqlite3_result_int(context, sqlite3_total_changes(db));}
开发者ID:f059074251,项目名称:interested,代码行数:12,


示例16: statColumn

static int statColumn(  sqlite3_vtab_cursor *pCursor,   sqlite3_context *ctx,   int i){  StatCursor *pCsr = (StatCursor *)pCursor;  switch( i ){    case 0:            /* name */      sqlite3_result_text(ctx, pCsr->zName, -1, SQLITE_TRANSIENT);      break;    case 1:            /* path */      sqlite3_result_text(ctx, pCsr->zPath, -1, SQLITE_TRANSIENT);      break;    case 2:            /* pageno */      sqlite3_result_int64(ctx, pCsr->iPageno);      break;    case 3:            /* pagetype */      sqlite3_result_text(ctx, pCsr->zPagetype, -1, SQLITE_STATIC);      break;    case 4:            /* ncell */      sqlite3_result_int(ctx, pCsr->nCell);      break;    case 5:            /* payload */      sqlite3_result_int(ctx, pCsr->nPayload);      break;    case 6:            /* unused */      sqlite3_result_int(ctx, pCsr->nUnused);      break;    case 7:            /* mx_payload */      sqlite3_result_int(ctx, pCsr->nMxPayload);      break;    case 8:            /* pgoffset */      sqlite3_result_int64(ctx, pCsr->iOffset);      break;    case 9:            /* pgsize */      sqlite3_result_int(ctx, pCsr->szPage);      break;    default: {          /* schema */      sqlite3 *db = sqlite3_context_db_handle(ctx);      int iDb = pCsr->iDb;      sqlite3_result_text(ctx, db->aDb[iDb].zName, -1, SQLITE_STATIC);      break;    }  }  return SQLITE_OK;}
开发者ID:1018824313,项目名称:sqlite,代码行数:46,


示例17: sql_verify_passwd

void sql_verify_passwd(sqlite3_context* context, int argc, sqlite3_value** values) {	char* passwd = (char*)sqlite3_value_text(values[0]);	if (argc != 1 || passwd == 0) {		fprintf(stderr,"SQL function VERIFY_PASSWD called with invalid arguments");		return;	}	sqlite3_result_int(context,verify_passwd(passwd));}
开发者ID:Jubei-Mitsuyoshi,项目名称:aaa-aircrack-ng-cuda,代码行数:8,


示例18: pg_bit_length

extern void pg_bit_length(sqlite3_context * context,                           int               argc,                           sqlite3_value  ** argv) {    int byte_count;            _ksu_null_if_null_param(argc, argv);    byte_count = sqlite3_value_bytes(argv[0]);    sqlite3_result_int(context, byte_count * 8);} 
开发者ID:sfaroult,项目名称:sqlite_libs,代码行数:9,


示例19: total_changes

/*** Implementation of the total_changes() SQL function.  The return value is** the same as the sqlite3_total_changes() API function.*/static void total_changes(  sqlite3_context *context,  int NotUsed,  sqlite3_value **NotUsed2){  sqlite3 *db = sqlite3_context_db_handle(context);  UNUSED_PARAMETER2(NotUsed, NotUsed2);  sqlite3_result_int(context, sqlite3_total_changes(db));}
开发者ID:kaomte,项目名称:sqlcipher,代码行数:13,


示例20: randomFunc

/*** Implementation of random().  Return a random integer.  */static void randomFunc(  sqlite3_context *context,  int argc,  sqlite3_value **argv){  int r;  sqlite3Randomness(sizeof(r), &r);  sqlite3_result_int(context, r);}
开发者ID:BackupTheBerlios,项目名称:sqlitepp-svn,代码行数:12,


示例21: ora_vsize

extern void ora_vsize(sqlite3_context * context,                      int               argc,                      sqlite3_value  ** argv) {        int sz;        _ksu_null_if_null_param(argc, argv);        sz = sqlite3_value_bytes(argv[0]);        sqlite3_result_int(context, sz);}
开发者ID:sfaroult,项目名称:sqlite_libs,代码行数:9,


示例22: sql_match

/* * Implement substring match as an application-defined SQL function. * Using the SQL LIKE or GLOB operators instead would be a bad idea * because that would require escaping metacharacters in the string * being searched for. */static voidsql_match(sqlite3_context *context, int argc, sqlite3_value **argv){	assert(2 == argc);	sqlite3_result_int(context, NULL != strcasestr(	    (const char *)sqlite3_value_text(argv[1]),	    (const char *)sqlite3_value_text(argv[0])));}
开发者ID:jashank,项目名称:freebsd,代码行数:15,


示例23: OGR2SQLITE_ogr_geocode_set_result

staticvoid OGR2SQLITE_ogr_geocode_set_result(sqlite3_context* pContext,                                       OGRLayerH hLayer,                                       const char* pszField){    if( hLayer == NULL )        sqlite3_result_null (pContext);    else    {        OGRLayer* poLayer = (OGRLayer*)hLayer;        OGRFeatureDefn* poFDefn = poLayer->GetLayerDefn();        OGRFeature* poFeature = poLayer->GetNextFeature();        int nIdx = -1;        if( poFeature == NULL )            sqlite3_result_null (pContext);        else if( strcmp(pszField, "geometry") == 0 &&                 poFeature->GetGeometryRef() != NULL )        {            GByte* pabyGeomBLOB = NULL;            int nGeomBLOBLen = 0;            if( OGRSQLiteLayer::ExportSpatiaLiteGeometry(                        poFeature->GetGeometryRef(), 4326, wkbNDR, FALSE, FALSE, FALSE,                        &pabyGeomBLOB,                        &nGeomBLOBLen ) != CE_None )            {                sqlite3_result_null (pContext);            }            else            {                sqlite3_result_blob (pContext, pabyGeomBLOB, nGeomBLOBLen, CPLFree);            }        }        else if( (nIdx = poFDefn->GetFieldIndex(pszField)) >= 0 &&                 poFeature->IsFieldSet(nIdx) )        {            OGRFieldType eType = poFDefn->GetFieldDefn(nIdx)->GetType();            if( eType == OFTInteger )                sqlite3_result_int(pContext,                                   poFeature->GetFieldAsInteger(nIdx));            else if( eType == OFTInteger64 )                sqlite3_result_int64(pContext,                                     poFeature->GetFieldAsInteger64(nIdx));            else if( eType == OFTReal )                sqlite3_result_double(pContext,                                      poFeature->GetFieldAsDouble(nIdx));            else                sqlite3_result_text(pContext,                                    poFeature->GetFieldAsString(nIdx),                                    -1, SQLITE_TRANSIENT);        }        else            sqlite3_result_null (pContext);        delete poFeature;        OGRGeocodeFreeResult(hLayer);    }}
开发者ID:rashadkm,项目名称:lib_gdal,代码行数:56,


示例24: icuRegexpFunc

/*** Implementation of SQLite REGEXP operator. This scalar function takes** two arguments. The first is a regular expression pattern to compile** the second is a string to match against that pattern. If either ** argument is an SQL NULL, then NULL Is returned. Otherwise, the result** is 1 if the string matches the pattern, or 0 otherwise.**** SQLite maps the regexp() function to the regexp() operator such** that the following two are equivalent:****     zString REGEXP zPattern**     regexp(zPattern, zString)**** Uses the following ICU regexp APIs:****     uregex_open()**     uregex_matches()**     uregex_close()*/static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){  UErrorCode status = U_ZERO_ERROR;  URegularExpression *pExpr;  UBool res;  const UChar *zString = sqlite3_value_text16(apArg[1]);  (void)nArg;  /* Unused parameter */  /* If the left hand side of the regexp operator is NULL,   ** then the result is also NULL.   */  if( !zString ){    return;  }  pExpr = sqlite3_get_auxdata(p, 0);  if( !pExpr ){    const UChar *zPattern = sqlite3_value_text16(apArg[0]);    if( !zPattern ){      return;    }    pExpr = uregex_open(zPattern, -1, 0, 0, &status);    if( U_SUCCESS(status) ){      sqlite3_set_auxdata(p, 0, pExpr, icuRegexpDelete);    }else{      assert(!pExpr);      icuFunctionError(p, "uregex_open", status);      return;    }  }  /* Configure the text that the regular expression operates on. */  uregex_setText(pExpr, zString, -1, &status);  if( !U_SUCCESS(status) ){    icuFunctionError(p, "uregex_setText", status);    return;  }  /* Attempt the match */  res = uregex_matches(pExpr, 0, &status);  if( !U_SUCCESS(status) ){    icuFunctionError(p, "uregex_matches", status);    return;  }  /* Set the text that the regular expression operates on to a NULL  ** pointer. This is not really necessary, but it is tidier than   ** leaving the regular expression object configured with an invalid  ** pointer after this function returns.  */  uregex_setText(pExpr, 0, 0, &status);  /* Return 1 or 0. */  sqlite3_result_int(p, res ? 1 : 0);}
开发者ID:520060628,项目名称:Sqlite3.07.14,代码行数:75,


示例25: vtxt_column

static intvtxt_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext,	     int column){/* fetching value for the Nth column */    int nCol = 1;    int i;    char buf[4096];    int type;    const char *value;    VirtualTextCursorPtr cursor = (VirtualTextCursorPtr) pCursor;    gaiaTextReaderPtr text = cursor->pVtab->reader;    if (column == 0)      {	  /* the ROWNO column */	  sqlite3_result_int (pContext, cursor->current_row);	  return SQLITE_OK;      }    if (text->current_line_ready == 0)	return SQLITE_ERROR;    for (i = 0; i < text->max_fields; i++)      {	  if (nCol == column)	    {		if (!gaiaTextReaderFetchField (text, i, &type, &value))		    sqlite3_result_null (pContext);		else		  {		      if (type == VRTTXT_INTEGER)			{			    strcpy (buf, value);			    text_clean_integer (buf);#if defined(_WIN32) || defined(__MINGW32__)/* CAVEAT - M$ runtime has non-standard functions for 64 bits */			    sqlite3_result_int64 (pContext, _atoi64 (buf));#else			    sqlite3_result_int64 (pContext, atoll (buf));#endif			}		      else if (type == VRTTXT_DOUBLE)			{			    strcpy (buf, value);			    text_clean_double (buf);			    sqlite3_result_double (pContext, atof (buf));			}		      else if (type == VRTTXT_TEXT)			  sqlite3_result_text (pContext, value, strlen (value),					       free);		      else			  sqlite3_result_null (pContext);		  }	    }	  nCol++;      }    return SQLITE_OK;}
开发者ID:kochizufan,项目名称:spatiasql.js,代码行数:56,


示例26: my_strcmp

extern void my_strcmp(sqlite3_context * context,                       int               argc,                       sqlite3_value  ** argv) {    int cmp;    _ksu_null_if_null_param(argc, argv);    cmp = strcmp((const char *)sqlite3_value_text(argv[0]),                 (const char *)sqlite3_value_text(argv[1]));    sqlite3_result_int(context, (cmp>0?1:(cmp<0?-1:0)));}
开发者ID:sfaroult,项目名称:sqlite_libs,代码行数:10,


示例27: sqlite3_lessthan

/** * sqlite3 custom function for comparison of uint64_t values * since it is not supported by default */voidsqlite3_lessthan (sqlite3_context * ctx, int dummy, sqlite3_value ** values){  uint64_t v1;  uint64_t v2;  v1 = (uint64_t) sqlite3_value_int64 (values[0]);  v2 = (uint64_t) sqlite3_value_int64 (values[1]);  sqlite3_result_int (ctx, v1 < v2);}
开发者ID:muggenhor,项目名称:GNUnet,代码行数:14,


示例28: BFileSizeFunc

/* * Get File size of a BFILE */static void BFileSizeFunc(    sqlite3_context *context,    int argc,    sqlite3_value **argv){    int rc;    sqlite3 *db;    int loc_size;    off_t size;    char *pLoc, *full_path;    assert(context != NULL && argc == 1 && argv != NULL);    full_path = NULL;    loc_size = sqlite3_value_bytes(argv[0]);    if (loc_size <= strlen(BFILE_PREFIX)) {        sqlite3_result_int(context, -1);        return;    }    db = (sqlite3 *)sqlite3_user_data(context);    pLoc = (char *)sqlite3_value_text(argv[0]);    assert(db != NULL && pLoc != NULL);    rc = get_full_path(db, pLoc, loc_size, &full_path);    if (rc) {        if (rc == SQLITE_NOMEM)            sqlite3_result_error_nomem(context);        else            sqlite3_result_error(context, "internal error", -1);        return;    }    /* check existence, if not exits at at set size as -1 */    if (access(full_path, F_OK))        sqlite3_result_int(context, -1);    else if (__bfile_get_size(full_path, &size) == SQLITE_OK)        sqlite3_result_int(context, size);    else        sqlite3_result_error(context, "internal error", -1);    sqlite3_free(full_path);}
开发者ID:rohitlodha,项目名称:DenverDB,代码行数:46,


示例29: sql_regexp

/* * Implement regular expression match * as an application-defined SQL function. */static voidsql_regexp(sqlite3_context *context, int argc, sqlite3_value **argv){	assert(2 == argc);	sqlite3_result_int(context, !regexec(	    (regex_t *)sqlite3_value_blob(argv[0]),	    (const char *)sqlite3_value_text(argv[1]),	    0, NULL, 0));}
开发者ID:jashank,项目名称:freebsd,代码行数:14,


示例30: total_changes

/*** Implementation of the total_changes() SQL function.  The return value is** the same as the sqlite3_total_changes() API function.*/static void total_changes(  sqlite3_context *context,  int NotUsed,  sqlite3_value **NotUsed2){  sqlite3 *db = sqlite3_context_db_handle(context);  UNUSED_PARAMETER2(NotUsed, NotUsed2);  /* IMP: R-52756-41993 This function is a wrapper around the  ** sqlite3_total_changes() C/C++ interface. */  sqlite3_result_int(context, sqlite3_total_changes(db));}
开发者ID:blingstorm,项目名称:sqlcipher,代码行数:15,



注:本文中的sqlite3_result_int函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ sqlite3_result_int64函数代码示例
C++ sqlite3_result_error函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。