• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ enif_make_resource函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ex_slp_open

static ERL_NIF_TERM
ex_slp_open(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) {
  char         *lang;
  char         *ret_code;
  int           isasync;
  unsigned int  term_len;
  SLPHandle    *hslp;
  SLPEXP SLPError SLPAPI error;

  if (enif_get_atom_length(env, argv[0], &term_len, ERL_NIF_LATIN1) < 0) {
    return enif_make_badarg(env);
  }

  if (enif_get_atom(env, argv[0], lang, term_len, ERL_NIF_LATIN1) < 0) {
    return enif_make_badarg(env);
  }

  if ( ! enif_get_int(env, argv[1], &isasync)) return enif_make_badarg(env);

  hslp = enif_alloc_resource(NIF_SLP_HANDLE, sizeof(SLPHandle));

  if (hslp == NULL) return enif_make_badarg(env);

  //error = SLPOpen(lang, isasync > 0 ? SLP_TRUE : SLP_FALSE, hslp);
  error = SLPOpen(lang, isasync > 0 ? SLP_TRUE : SLP_FALSE, hslp);

  ERL_NIF_TERM term = enif_make_resource(env, hslp);

  enif_release_resource(hslp);

  return enif_make_tuple2(env, enif_make_int(env, error), term);
}
开发者ID:icanhazbroccoli,项目名称:ex_slp,代码行数:32,代码来源:ex_slp.c


示例2: create

static ERL_NIF_TERM
create(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
    Example* res;
    ERL_NIF_TERM ret;
    unsigned int id;
    Tracker* tracker;

    if(argc != 1)
    {
        return enif_make_badarg(env);
    }

    if(!enif_get_uint(env, argv[0], &id))
    {
        return enif_make_badarg(env);
    }

    res = enif_alloc_resource(RES_TYPE, sizeof(Example));
    if(res == NULL) return enif_make_badarg(env);

    ret = enif_make_resource(env, res);
    enif_release_resource(res);

    res->id = id;

    tracker = (Tracker*) enif_priv_data(env);
    tracker->count += 1;

    return enif_make_tuple2(env, atom_ok, ret);
}
开发者ID:szpzs,项目名称:nif-examples,代码行数:31,代码来源:resources.c


示例3: nif_open

    static ERL_NIF_TERM
nif_open(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
{
    ErlNifBinary dev;
    SRLY_STATE *sp = NULL;

    if (!enif_inspect_iolist_as_binary(env, argv[0], (ErlNifBinary *)&dev))
        return enif_make_badarg(env);

    sp = enif_alloc_resource(SRLY_STATE_RESOURCE, sizeof(SRLY_STATE));
    if (sp == NULL)
        return error_tuple(env, ENOMEM);

    if (!enif_realloc_binary(&dev, dev.size+1))
        return enif_make_badarg(env);

    dev.data[dev.size-1] = '\0';

    sp->fd = open((char *)dev.data, O_RDWR|O_NOCTTY|O_NONBLOCK);

    if (sp->fd < 0 || isatty(sp->fd) != 1) {
        int err = errno;
        enif_release_resource(sp);
        return error_tuple(env, err);
    }

    return enif_make_tuple2(env,
            atom_ok,
            enif_make_resource(env, sp));
}
开发者ID:jj1bdx,项目名称:srly,代码行数:30,代码来源:serctl.c


示例4: enif_make_handle

ERL_NIF_TERM enif_make_handle(ErlNifEnv* env, void* obj)
{
  ERL_NIF_TERM handle;
  handle = enif_make_resource(env, obj);
  enif_release_resource(obj);     
  return handle;
}
开发者ID:FlowerWrong,项目名称:mblog,代码行数:7,代码来源:darray.c


示例5: _open

static ERL_NIF_TERM
_open(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
  CAN_handle*  handle;
  ERL_NIF_TERM result;
  char        dev_path[512];
  if (!enif_get_string(env, argv[0], dev_path, 512, ERL_NIF_LATIN1))
    return enif_make_int(env, -2000);
  handle = enif_alloc_resource(CAN_handle_type, sizeof(CAN_handle));
  memset(handle, 0, sizeof(CAN_handle));
  handle->device = open((const char*)dev_path,  O_RDWR | O_SYNC);
  if (!enif_get_int(env, argv[1], &handle->raw))
    return enif_make_int(env, -2001);
  handle->threaded = 0;
  if (handle->device >= 0)
    {
      int len = strlen(dev_path);
      result = enif_make_resource(env, handle);
      handle->devpath = enif_alloc(len);
      memcpy(handle->devpath, dev_path, len);
      handle->devpath_bin = enif_make_resource_binary(env, handle, handle->devpath, len);
    }
  else
    {
      result = enif_make_int(env, errno);
    }
  enif_release_resource(handle);
  return result;
}
开发者ID:qoocku,项目名称:erleos,代码行数:29,代码来源:CAN_nif.c


示例6: open_nif

static ERL_NIF_TERM open_nif(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
    posix_errno_t posix_errno;
    efile_data_t *d;

    ErlNifPid controlling_process;
    enum efile_modes_t modes;
    ERL_NIF_TERM result;
    efile_path_t path;

    ASSERT(argc == 2);
    if(!enif_is_list(env, argv[1])) {
        return enif_make_badarg(env);
    }

    modes = efile_translate_modelist(env, argv[1]);

    if((posix_errno = efile_marshal_path(env, argv[0], &path))) {
        return posix_error_to_tuple(env, posix_errno);
    } else if((posix_errno = efile_open(&path, modes, efile_resource_type, &d))) {
        return posix_error_to_tuple(env, posix_errno);
    }

    result = enif_make_resource(env, d);
    enif_release_resource(d);

    enif_self(env, &controlling_process);

    if(enif_monitor_process(env, d, &controlling_process, &d->monitor)) {
        return posix_error_to_tuple(env, EINVAL);
    }

    return enif_make_tuple2(env, am_ok, result);
}
开发者ID:RaimoNiskanen,项目名称:otp,代码行数:33,代码来源:prim_file_nif.c


示例7: _hi_open

ERL_NIF_TERM _hi_open(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
    uint32_t iterator_type = 0;

    if (argc != 1 ||
        !enif_get_uint(env, argv[0], &iterator_type))
    {
        return enif_make_badarg(env);
    }

    if (iterator_type != HDR_ITER_REC &&
        iterator_type != HDR_ITER_LIN &&
        iterator_type != HDR_ITER_LOG &&
        iterator_type != HDR_ITER_PCT)
    {
        return make_error(env, "bad_iterator_type");
    }

    ErlNifResourceType* ctx_type = get_hi_ctx_type(env);
    hi_ctx_t* ctx = (hi_ctx_t*)enif_alloc_resource(ctx_type, sizeof(hi_ctx_t));

    ctx->type = iterator_type;
    ctx->opts = NULL;
    ctx->iter = NULL;

    ERL_NIF_TERM result = enif_make_resource(env, ctx);
    enif_release_resource(ctx);

    return enif_make_tuple2(env, ATOM_OK, result);
}
开发者ID:jlouis,项目名称:hdr_histogram_erl,代码行数:30,代码来源:hdr_histogram_nif.c


示例8: get_driver

/* OGRSFDriverH CPL_DLL OGRGetDriver( int );

{ok, Driver} = lgeo_ogr:get_driver(0),

*/
static ERL_NIF_TERM
get_driver(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
    int driver_idx;
    ERL_NIF_TERM eterm;

    if (argc != 1) {
        return enif_make_badarg(env);
    }

    if (!enif_get_int(env, argv[0], &driver_idx)) {
        return enif_make_badarg(env);
    }

    OGRSFDriverH drv = OGRGetDriver(driver_idx);

    if (!drv) {
        return enif_make_tuple2(env,
            enif_make_atom(env, "error"),
            enif_make_string(env, "Driver not found", ERL_NIF_LATIN1));
    }

    OGRSFDriverH **driver = \
        enif_alloc_resource(OGR_D_RESOURCE, sizeof(OGRSFDriverH*));
    *driver = drv;

    eterm = enif_make_resource(env, driver);
    enif_release_resource(driver);
    return enif_make_tuple2(env, enif_make_atom(env, "ok"), eterm);
}
开发者ID:namjae,项目名称:lgeo,代码行数:35,代码来源:lgeo_ogr.c


示例9: l_get_layer_defn

/* OGRFeatureDefnH OGR_L_GetLayerDefn(OGRLayerH hLayer)

{ok, DataSource} = lgeo_ogr:open("test/polygon.shp"),
{ok, Layer} = lgeo_ogr:ds_get_layer(DataSource, 0),
{ok, FeatureDefn} = lgeo_ogr:l_get_layer_defn(Layer).

*/
static ERL_NIF_TERM
l_get_layer_defn(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
    EnvLayer_t **layer;
    ERL_NIF_TERM eterm;

    if (argc != 1) {
        return enif_make_badarg(env);
    }

    if(!enif_get_resource(env, argv[0], OGR_L_RESOURCE, (void**)&layer)) {
        return enif_make_badarg(env);
    }

    OGRFeatureDefnH feat_defn = OGR_L_GetLayerDefn((**layer).obj);

    EnvFeatureDefn_t **feature_defn = \
        enif_alloc_resource(OGR_FD_RESOURCE, sizeof(EnvFeatureDefn_t*));

    ErlNifEnv *feature_defn_env = enif_alloc_env();

    *feature_defn = (EnvFeatureDefn_t*) enif_alloc(sizeof(EnvFeatureDefn_t));
    (**feature_defn).env = feature_defn_env;
    (**feature_defn).obj = feat_defn;

    // Save copy of layer so is not garbage collected
    enif_make_copy(feature_defn_env, argv[0]);

    eterm = enif_make_resource(env, feature_defn);
    enif_release_resource(feature_defn);
    return enif_make_tuple2(env, enif_make_atom(env, "ok"), eterm);
}
开发者ID:namjae,项目名称:lgeo,代码行数:39,代码来源:lgeo_ogr.c


示例10: zdoor_cb

static struct zdoor_result *
zdoor_cb(struct zdoor_cookie *cookie, char *argp, size_t argp_sz)
{
	struct door *d;
	struct req *r;
	ErlNifEnv *env = enif_alloc_env();

	/* we kept the struct door in the biscuit */
	d = (struct door *)cookie->zdc_biscuit;

	/* this request */
	r = req_alloc();

	/* take the rlist lock first, then the req lock */
	enif_rwlock_rwlock(d->rlock);
	enif_mutex_lock(r->lock);

	req_insert(d, r);

	enif_rwlock_rwunlock(d->rlock);

	/* make the request into a binary term to put it into enif_send() */
	ErlNifBinary bin;
	enif_alloc_binary(argp_sz, &bin);
	memcpy(bin.data, argp, argp_sz);
	ERL_NIF_TERM binTerm = enif_make_binary(env, &bin);

	/* send a message back to the session owner */
	enif_send(NULL, &d->owner, env,
		enif_make_tuple3(env,
			enif_make_atom(env, "zdoor"),
			enif_make_resource(env, r),
			binTerm));

	/* now wait until the request has been replied to */
	enif_cond_wait(r->cond, r->lock);

	/* convert the reply into a zdoor_result */
	/* we have to use naked malloc() since libzdoor will use free() */
	struct zdoor_result *res = malloc(sizeof(struct zdoor_result));
	res->zdr_size = r->replen;
	res->zdr_data = r->rep;

	r->rep = NULL;
	r->replen = 0;

	/* yes, we have to unlock and re-lock to avoid lock inversion here */
	enif_mutex_unlock(r->lock);

	/* remove and free the struct req */
	enif_rwlock_rwlock(d->rlock);
	enif_mutex_lock(r->lock);
	req_remove(d, r);
	enif_rwlock_rwunlock(d->rlock);
	req_free(r);

	enif_free_env(env);

	return res;
}
开发者ID:arekinath,项目名称:erlzdoor,代码行数:60,代码来源:jobs.c


示例11: f_get_geometry

/*
{ok, DataSource} = lgeo_ogr:open("test/polygon.shp"),
{ok, Layer} = lgeo_ogr:ds_get_layer(DataSource, 0),
{ok, Feature} = lgeo_ogr:l_get_feature(Layer, 0),
{ok, Geometry} = lgeo_ogr:f_get_geometry(Feature).

*/
static ERL_NIF_TERM
f_get_geometry(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
    EnvFeature_t **feature;
    ERL_NIF_TERM eterm;

    if (argc != 1) {
        return enif_make_badarg(env);
    }

    if(!enif_get_resource(env, argv[0], OGR_F_RESOURCE, (void**)&feature)) {
        return enif_make_badarg(env);
    }

    OGRGeometryH geom = OGR_F_GetGeometryRef((**feature).obj);
    if(geom == NULL) {
        return enif_make_atom(env, "undefined");
    }

    OGRGeometryH geom_clone = OGR_G_Clone(geom);

    EnvGeometry_t **geometry = \
        enif_alloc_resource(OGR_G_RESOURCE, sizeof(EnvGeometry_t*));

    *geometry = (EnvGeometry_t*) enif_alloc(sizeof(EnvGeometry_t));
    (**geometry).env = NULL;
    (**geometry).obj = geom_clone;

    eterm = enif_make_resource(env, geometry);
    enif_release_resource(geometry);
    return enif_make_tuple2(env, enif_make_atom(env, "ok"), eterm);
}
开发者ID:namjae,项目名称:lgeo,代码行数:39,代码来源:lgeo_ogr.c


示例12: exmagick_init_handle

static
ERL_NIF_TERM exmagick_init_handle (ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
{
  ERL_NIF_TERM result;

  EXM_INIT;
  ErlNifResourceType *type = (ErlNifResourceType *) enif_priv_data(env);
  exm_resource_t *resource = enif_alloc_resource(type, sizeof(exm_resource_t));
  if (resource == NULL)
  { EXM_FAIL(ehandler, "enif_alloc_resource"); }

  /* initializes exception to default values (badly named function) */
  GetExceptionInfo(&resource->e_info);

  resource->image  = NULL;
  resource->i_info = CloneImageInfo(0);
  if (resource->i_info == NULL)
  { EXM_FAIL(ehandler, "CloneImageInfo"); }

  result = enif_make_resource(env, (void *) resource);
  enif_release_resource(resource);
  return(enif_make_tuple2(env, enif_make_atom(env, "ok"), result));

ehandler:
  if (resource != NULL)
  {
    if (resource->i_info != NULL)
    { DestroyImageInfo(resource->i_info); }
    enif_release_resource(resource);
  }
  return(enif_make_tuple2(env, enif_make_atom(env, "error"), exmagick_make_utf8str(env, errmsg)));
}
开发者ID:Xerpa,项目名称:exmagick,代码行数:32,代码来源:exmagick.c


示例13: compile

static ERL_NIF_TERM compile(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
{
    ErlNifBinary patternbin;

    if (enif_inspect_iolist_as_binary(env, argv[0], &patternbin)) {
        ERL_NIF_TERM ret;
        xmlRegexpPtr xre;
        char *patternstr = enif_alloc(patternbin.size + 1);
        patternstr[patternbin.size] = 0;
        memcpy(patternstr, patternbin.data, patternbin.size);

        if ((xre = xmlRegexpCompile((xmlChar *)patternstr)) != NULL) {
            struct regexp *r;
            r = enif_alloc_resource(regexp_type, sizeof(struct regexp));
            memset(r, 0, sizeof(*r));
            r->xre = xre;
            r->string = patternstr;

            /* transfer ownership to calling process */
            ret = enif_make_tuple2(env, am_ok(env),
                                   enif_make_resource(env, r));
            enif_release_resource(r);
        } else {
            enif_free(patternstr);
            ret = last_error(env, "Bad Pattern");
        }

        return ret;
    }

    return enif_make_badarg(env);
}
开发者ID:tail-f-systems,项目名称:xsdre,代码行数:32,代码来源:xsdre.c


示例14: _hh_from_binary

ERL_NIF_TERM _hh_from_binary(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
    ErlNifBinary source;

    if (!enif_inspect_binary(env, argv[0], &source))
    {
      return enif_make_badarg(env);
    }

    hdr_histogram_t* target = NULL;
    int success = hdr_decode(source.data, source.size, &target);

    if (success != 0)
    {
        return make_error(env, "bad_hdr_binary");
    }

    ErlNifResourceType* ctx_type = get_hh_ctx_type(env);
    hh_ctx_t* ctx = (hh_ctx_t*)enif_alloc_resource(ctx_type, sizeof(hh_ctx_t));

    ctx->data = (hdr_histogram_t*)target;
    ctx->highest_trackable_value = target->highest_trackable_value;
    ctx->significant_figures = target->significant_figures;

    ERL_NIF_TERM result = enif_make_resource(env, ctx);
    enif_release_resource(ctx);

    return enif_make_tuple2(env, ATOM_OK, result);
}
开发者ID:jlouis,项目名称:hdr_histogram_erl,代码行数:29,代码来源:hdr_histogram_nif.c


示例15: add

static ERL_NIF_TERM add(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
    /* add(Matrix_A, Matrix_B) -> Matrix_Sum */
    unsigned i, j;
    ERL_NIF_TERM ret;
    mx_t mxA, mxB, mxS;
    mxA.p = NULL;
    mxB.p = NULL;
    mxS.p = NULL;

    if (!enif_get_resource(env, argv[0], resource_type, &mxA.vp) ||
	!enif_get_resource(env, argv[1], resource_type, &mxB.vp) ||
	mxA.p->nrows != mxB.p->nrows ||
	mxB.p->ncols != mxB.p->ncols) {

    	return enif_make_badarg(env);
    }
    mxS.p = alloc_matrix(env, mxA.p->nrows, mxA.p->ncols);
    for (i = 0; i < mxA.p->nrows; i++) {
	for (j = 0; j < mxA.p->ncols; j++) {
	    POS(mxS.p, i, j) = POS(mxA.p, i, j) + POS(mxB.p, i, j);
	}
    }
    ret = enif_make_resource(env, mxS.p);
    enif_release_resource(mxS.p);
    return ret;
}
开发者ID:0x00evil,项目名称:otp,代码行数:27,代码来源:matrix_nif.c


示例16: new_parser

static ERL_NIF_TERM new_parser(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
{
    XML_Parser parser;
    expat_parser *parser_data = (expat_parser *)enif_alloc(sizeof(expat_parser));
    ERL_NIF_TERM parser_resource;

    // this is the variant from esl/exml:208d5e17e547b303b310627e3e525b57b2843e83
    /*parser = XML_ParserCreate_MM("UTF-8", &ms, "\n");*/

    // this makes the tests pass, but according to expat documentation it turns namespace support off
    /*parser = XML_ParserCreate_MM("UTF-8", &ms, NULL);*/

    // this is a try to preserve namespace support but make the tests pass;
    // this is the character defined as a macro in xmlwf sources for namespace-enabled parser
    /*XML_Char namespaceSeparator = '\001';*/
    /*parser = XML_ParserCreate_MM("UTF-8", &ms, &namespaceSeparator);*/
    parser = XML_ParserCreate_MM("UTF-8", &ms, ":");

    parser_data->env = env;
    parser_data->xmlns = (ERL_NIF_TERM)NULL;

    init_parser(parser, parser_data);

    XML_Parser *xml_parser = (XML_Parser *)enif_alloc_resource(PARSER_POINTER, sizeof(XML_Parser));
    *xml_parser = parser;
    parser_resource = enif_make_resource(env, (void *)xml_parser);
    enif_release_resource(xml_parser);

    return enif_make_tuple(env, 2, OK, parser_resource);
};
开发者ID:erszcz,项目名称:exml,代码行数:30,代码来源:exml_event.c


示例17: open_nif

static ERL_NIF_TERM
open_nif(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
{
	ks_returner_t	*ret;
	ks_handle_t	*handle;
	ERL_NIF_TERM	term;

	ret = new_returner(env);

	handle = (ks_handle_t *)(enif_alloc_resource(kstat_handle, sizeof(ks_handle_t)));
	handle->ks_id = -1;
	list_create(&handle->instances_list, sizeof (ks_instance_t), offsetof(ks_instance_t, ks_next));
	term = enif_make_resource(env, handle);
	enif_release_resource(handle);

	while ((handle->ks_ctl = kstat_open()) == NULL) {
		if (errno == EAGAIN) {
			(void) poll(NULL, 0, 200);
		} else {
			return EKSTAT_RETURN(EKSTAT_ERROR("kstat_open failed"));
		}
	}

	return EKSTAT_RETURN(EKSTAT_OK(term));
}
开发者ID:potatosalad,项目名称:ekstat,代码行数:25,代码来源:ekstat.c


示例18: wrap_pointer

static ERL_NIF_TERM wrap_pointer(ErlNifEnv* env,ErlNifResourceType* type,void* ptr) {
    void** resource = (void**) enif_alloc_resource(env,type,sizeof(void*));
    *resource = ptr;
    ERL_NIF_TERM term = enif_make_resource(env,resource);
    enif_release_resource(env,(void*)resource);
    return term;
}
开发者ID:BigDwarf,项目名称:ennui,代码行数:7,代码来源:bullet.cpp


示例19: esqlite_start

/* 
 * Start the processing thread
 */
static ERL_NIF_TERM 
esqlite_start(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
    esqlite_connection *conn;
    ERL_NIF_TERM db_conn;

    /* Initialize the resource */
    conn = enif_alloc_resource(esqlite_connection_type, sizeof(esqlite_connection));
    if(!conn) 
	    return make_error_tuple(env, "no_memory");
	  
    conn->db = NULL;

    /* Create command queue */
    conn->commands = queue_create();
    if(!conn->commands) {
	    enif_release_resource(conn);
	    return make_error_tuple(env, "command_queue_create_failed");
    }

    /* Start command processing thread */
    conn->opts = enif_thread_opts_create("esqldb_thread_opts");
    if(enif_thread_create("esqlite_connection", &conn->tid, esqlite_connection_run, conn, conn->opts) != 0) {
	    enif_release_resource(conn);
	    return make_error_tuple(env, "thread_create_failed");
    }

    db_conn = enif_make_resource(env, conn);
    enif_release_resource(conn);
  
    return make_ok_tuple(env, db_conn);
}
开发者ID:alepharchives,项目名称:esqlite,代码行数:35,代码来源:esqlite3_nif.c


示例20: do_prepare

static ERL_NIF_TERM
do_prepare(ErlNifEnv *env, esqlite_connection *conn, const ERL_NIF_TERM arg)
{
    ErlNifBinary bin;
    esqlite_statement *stmt;
    ERL_NIF_TERM esqlite_stmt;
    const char *tail;
    int rc;

    enif_inspect_iolist_as_binary(env, arg, &bin);

    stmt = enif_alloc_resource(esqlite_statement_type, sizeof(esqlite_statement));
    if(!stmt) 
	    return make_error_tuple(env, "no_memory");

    rc = sqlite3_prepare_v2(conn->db, (char *) bin.data, bin.size, &(stmt->statement), &tail);
    if(rc != SQLITE_OK)
	    return make_sqlite3_error_tuple(env, rc, conn->db);

    enif_keep_resource(conn);
    stmt->connection = conn;

    esqlite_stmt = enif_make_resource(env, stmt);
    enif_release_resource(stmt);

    return make_ok_tuple(env, esqlite_stmt);
}
开发者ID:alepharchives,项目名称:esqlite,代码行数:27,代码来源:esqlite3_nif.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ enif_make_string函数代码示例发布时间:2022-05-30
下一篇:
C++ enif_make_list函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap