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

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

51自学网 2021-06-01 19:56:44
  C++
这篇教程C++ CAMLparam3函数代码示例写得很实用,希望能帮到您。

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

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

示例1: stub_asl_set

CAMLprim value stub_asl_set(value m, value key, value val) {  CAMLparam3(m, key, val);  const char *c_key = strdup(String_val(key));  const char *c_val = strdup(String_val(val));  caml_release_runtime_system();  asl_set(Msg_val(m), c_key, c_val);  caml_acquire_runtime_system();  free((void*)c_key);  free((void*)c_val);  CAMLreturn(0);}
开发者ID:samoht,项目名称:ocaml-asl,代码行数:11,


示例2: stub_atomic_fetch_and_uint8

CAMLprim value stub_atomic_fetch_and_uint8(value buf, value idx, value val){  CAMLparam3(buf, idx, val);  uint8_t c_val = (uint8_t)Int_val(val);  uint8_t *ptr = Caml_ba_data_val(buf) + Int_val(idx);  if (Int_val(idx) >= Caml_ba_array_val(buf)->dim[0])    caml_invalid_argument("idx");  CAMLreturn(Val_int((uint8_t)__sync_fetch_and_and(ptr, c_val)));}
开发者ID:GaloisInc,项目名称:mirage-platform,代码行数:11,


示例3: caml_curses_wmove

value caml_curses_wmove(value mlwindow, value y, value x) {   CAMLparam3(mlwindow, y, x);   WINDOW *window = window_of_ml(mlwindow);      /* Move the cursor in the indicated window */   wmove(window, Int_val(y), Int_val(x));      CAMLreturn(Val_unit);}
开发者ID:camlspotter,项目名称:my-ocaml-win,代码行数:11,


示例4: caml_gnttab_read

CAMLprim valuecaml_gnttab_read(value v_gw, value v_off, value v_size){    CAMLparam3(v_gw, v_off, v_size);    CAMLlocal1(v_ret);    gnttab_wrap *gw = Gnttab_wrap_val(v_gw);    BUG_ON(gw->page == NULL);    v_ret = caml_alloc_string(Int_val(v_size));    memcpy(String_val(v_ret), gw->page + Int_val(v_off), Int_val(v_size));    CAMLreturn(v_ret);}
开发者ID:d5nguyenvan,项目名称:mirage,代码行数:11,


示例5: v2v_xml_node_ptr_set_prop

valuev2v_xml_node_ptr_set_prop (value nodev, value namev, value valv){  CAMLparam3 (nodev, namev, valv);  xmlNodePtr node = (xmlNodePtr) nodev;  if (xmlSetProp (node, BAD_CAST String_val (namev), BAD_CAST String_val (valv))      == NULL)    caml_invalid_argument ("node_ptr_set_prop: failed to set property");  CAMLreturn (Val_unit);}
开发者ID:kelledge,项目名称:libguestfs,代码行数:12,


示例6: win_putenv

CAMLprim value win_putenv(value var, value wvar, value v){  BOOL res;  CAMLparam3(var, wvar, v);  res = SetEnvironmentVariableW((LPCWSTR) String_val(wvar), (LPCWSTR) v);  if (res == 0) {    win32_maperr (GetLastError ());    uerror("putenv", var);  }  CAMLreturn (Val_unit);}
开发者ID:Phylliade,项目名称:Unison,代码行数:12,


示例7: create_tuple

valuecreate_tuple(value a, value b, value c){  CAMLparam3(a,b,c);  CAMLlocal1(tmp);  tmp=caml_alloc(3,0); // allocate 3 tag 0 on ocaml heap  Store_field(tmp,1,a);  Store_field(tmp,2,a);  Store_field(tmp,3,a);  CAMLreturn(tmp);}
开发者ID:TranslateBabelJapan,项目名称:ocaml-book,代码行数:12,


示例8: ml_gtk_text_buffer_get_iter_at_line_index

CAMLprim value ml_gtk_text_buffer_get_iter_at_line_index(value tb, 							 value l,							 value c){  CAMLparam3(tb,l,c);  GtkTextIter res;  gtk_text_buffer_get_iter_at_line_offset(GtkTextBuffer_val(tb),					  &res,					  Int_val(l),					  Int_val(c));  CAMLreturn(Val_GtkTextIter(&res));}
开发者ID:knuton,项目名称:lablgtk,代码行数:12,


示例9: sankoff_CAML_dist_2

valuesankoff_CAML_dist_2(value a, value b,value c) {   CAMLparam3(a,b,c);   eltarr_p eapD;   eltarr_p eapA;   eltarr_p eapR;   eapD = Sankoff_return_eltarr(a);   eapA = Sankoff_return_eltarr(b);   eapR = Sankoff_return_eltarr(c);   int res = sankoff_dist_2(eapD,eapA,eapR);   CAMLreturn(Val_int(res));}
开发者ID:amnh,项目名称:poy5,代码行数:12,


示例10: ml_evas_object_smart_callback_add

PREFIX value ml_evas_object_smart_callback_add(        value v_obj, value v_event, value v_func){        CAMLparam3(v_obj, v_event, v_func);        value* data = caml_stat_alloc(sizeof(value));        *data = v_func;        caml_register_global_root(data);        const char* event = String_val(v_event);        evas_object_smart_callback_add((Evas_Object*) v_obj, event,	ml_Evas_Smart_Cb, data);        CAMLreturn(Val_unit);}
开发者ID:PawelMarc,项目名称:ocaml-efl,代码行数:12,


示例11: Wrapper_FT_Load_Glyph

CAMLprim value Wrapper_FT_Load_Glyph(value face, value glyph_index, value load_flags){  CAMLparam3(face, glyph_index, load_flags);  FT_Face f;  f = *(FT_Face *)Data_custom_val(face);  if (FT_Load_Glyph(f, Int_val(glyph_index), Int_val(load_flags)))    failwith("FT_Load_Glyph");  CAMLreturn(Val_unit);};
开发者ID:BackupTheBerlios,项目名称:ant,代码行数:12,


示例12: ocamlyices_type_tuple3

CAMLprim value ocamlyices_type_tuple3(value v_tau1, value v_tau2,                                      value v_tau3) {  CAMLparam3(v_tau1, v_tau2, v_tau3);  type_t res;  res = yices_tuple_type3(Type_val(v_tau1), Type_val(v_tau2), Type_val(v_tau3));  if (res == NULL_TYPE) {    _oy_error();  }  CAMLreturn(Val_type(res));}
开发者ID:polazarus,项目名称:ocamlyices2,代码行数:12,


示例13: ml_glgetactiveattrib

t_value ml_glgetactiveattrib (value program, value index, value bufsize){	CAMLparam3 (program, index, bufsize);	CAMLlocal1 (name);	GLsizei len;	GLint size;	GLenum type;	char *buffer = (char *)malloc (sizeof(char) * bufsize);	glGetActiveAttrib (Long_val(program), Int_val(index), Int_val(bufsize), &len, &size, &type, buffer);	name = caml_copy_string (buffer);	CAMLreturn (name);}
开发者ID:jianguo90hou,项目名称:GI-LPV,代码行数:12,


示例14: sankoff_CAML_init_beta

valuesankoff_CAML_init_beta (value this_elt, value position, value cost){    CAMLparam3(this_elt,position,cost);    elt_p ep;    Sankoff_elt_custom_val(ep,this_elt);    int pos, c;    pos = Int_val(position);    c = Int_val(cost);    sankoff_set_beta(ep,pos,c);    CAMLreturn (Val_unit);}
开发者ID:amnh,项目名称:poy5,代码行数:12,


示例15: spoc_cuda_set_block_shape

CAMLprim value spoc_cuda_set_block_shape(value ker, value block, value gi){	CAMLparam3(ker, block, gi);	CUfunction *kernel;	CUDA_GET_CONTEXT;	kernel = (CUfunction*) ker;	CUDA_CHECK_CALL(cuFuncSetBlockShape(*kernel, Int_val(Field(block,0)),Int_val(Field(block,1)),Int_val(Field(block,2))));	CUDA_RESTORE_CONTEXT;	CAMLreturn(Val_unit);}
开发者ID:archonSTB,项目名称:SPOC,代码行数:12,


示例16: sunml_lsolver_call_atimes

CAMLprim value sunml_lsolver_call_atimes(value vcptr, value vv, value vz){    CAMLparam3(vcptr, vv, vz);    int r;    r = ATIMES_WITH_DATA(vcptr)->atimes_func(	    ATIMES_WITH_DATA(vcptr)->atimes_data, NVEC_VAL(vv), NVEC_VAL(vz));    if (r != 0)	caml_raise_with_arg(LSOLVER_EXN(ATimesFailure), Val_bool(r > 0));    CAMLreturn(Val_unit);}
开发者ID:inria-parkas,项目名称:sundialsml,代码行数:12,


示例17: spoc_cuda_load_param_int64

CAMLprim value spoc_cuda_load_param_int64(value off, value ex, value val){	CAMLparam3(off, ex, val);	int offset;	char *extra;	long long i;	extra = (char*)ex;	offset = Int_val(Field(off, 0));	i = (long long) Int_val(val);	ADD_TO_PARAM_BUFFER(i, __alignof(i));	Store_field(off, 0, Val_int(offset));	CAMLreturn(Val_unit);}
开发者ID:archonSTB,项目名称:SPOC,代码行数:12,


示例18: spoc_cuda_load_param_float64

CAMLprim value spoc_cuda_load_param_float64(value off, value ex, value val){	CAMLparam3(off, ex, val);	int offset;	char *extra;	double f;	extra = (char*)ex;	offset = Int_val(Field(off, 0));	f = Double_val(val);	ADD_TO_PARAM_BUFFER(f, __alignof(f));	Store_field(off, 0, Val_int(offset));	CAMLreturn(Val_unit);}
开发者ID:archonSTB,项目名称:SPOC,代码行数:12,


示例19: ml_gsl_multimin_fminimizer_set

CAMLprim value ml_gsl_multimin_fminimizer_set(value S, value fun, 				     value X, value step_size){  CAMLparam3(S, X, step_size);  struct callback_params *p=CALLBACKPARAMS_VAL(S);  _DECLARE_VECTOR2(X,step_size);  _CONVERT_VECTOR2(X,step_size);  p->closure = fun;  gsl_multimin_fminimizer_set(GSLMULTIMINFMINIMIZER_VAL(S), 			      &(p->gslfun.mmf), &v_X, &v_step_size);  CAMLreturn(Val_unit);}
开发者ID:oandrieu,项目名称:ocamlgsl,代码行数:12,


示例20: Wrapper_FT_Set_Char_Size

CAMLprim value Wrapper_FT_Set_Char_Size(value face, value size, value dpi){  CAMLparam3(face, size, dpi);  FT_Face f;  f = *(FT_Face *)Data_custom_val(face);  if (FT_Set_Char_Size(f, 0, Int_val(size), Int_val(dpi), Int_val(dpi)))    failwith("FT_Set_Char_Size");  CAMLreturn(Val_unit);};
开发者ID:BackupTheBerlios,项目名称:ant,代码行数:12,


示例21: caml_SDL_TTF_OpenFontIndex

CAMLprim valuecaml_SDL_TTF_OpenFontIndex(value file, value ptsize, value index){    CAMLparam3(file, ptsize, index);    TTF_Font *font =        TTF_OpenFontIndex(                String_val(file), Int_val(ptsize), Int_val(index));    if (!font) error("Sdlttf.open_font_index");    CAMLreturn(Val_TTF_Font(font));}
开发者ID:codename68,项目名称:OCamlSDL2_TTF,代码行数:12,


示例22: cstring_of_binary_array

CAMLprim value cstring_of_binary_array (value src_arr, value src_idx, value src_len){	CAMLparam3 (src_arr, src_idx, src_len);	CAMLlocal1 (retval);	int len = Long_val(src_len);	char *retstr = (char *) calloc (len + 1, 1);	if (retstr == NULL) failwith ("unable to allocate internal buffer");	memcpy (retstr, (char *) Data_bigarray_val(src_arr) + (Long_val(src_idx)), len);	retval = copy_string (retstr);	free (retstr);	CAMLreturn (retval);}
开发者ID:AyanamiRei,项目名称:chinesize,代码行数:12,


示例23: setsockopt_stub

CAMLprim value setsockopt_stub(value sock, value sockopt, value val) {    CAMLparam3 (sock, sockopt, val);    int native_sockopt = Int_val(sockopt);    struct wrap *socket = Socket_val(sock);    int result = -1;    switch (native_sockopt) {        case ZMQ_SNDHWM:        case ZMQ_RCVHWM:        case ZMQ_RATE:        case ZMQ_RECOVERY_IVL:        case ZMQ_SNDBUF:        case ZMQ_RCVBUF:        case ZMQ_LINGER:        case ZMQ_RECONNECT_IVL_MAX:        case ZMQ_BACKLOG:        case ZMQ_MULTICAST_HOPS:        case ZMQ_RCVTIMEO:        case ZMQ_SNDTIMEO:        {            int optval = Int_val(val);            result = zmq_setsockopt(socket->wrapped, native_sockopt, &optval, sizeof(optval));        }        break;                case ZMQ_IDENTITY:        case ZMQ_SUBSCRIBE:        case ZMQ_UNSUBSCRIBE:        {            result = zmq_setsockopt(socket->wrapped,                                    native_sockopt,                                    String_val(val),                                    caml_string_length(val));        }        break;        case ZMQ_AFFINITY:        case ZMQ_MAXMSGSIZE:        {            int64 optval = Int64_val(val);            result = zmq_setsockopt(socket->wrapped, native_sockopt, &optval, sizeof(optval));        }        break;        default:            caml_failwith("Bidings error");    }    stub_raise_if (result == -1);    CAMLreturn (Val_unit);}
开发者ID:hcarty,项目名称:ocaml-zmq3,代码行数:52,


示例24: sankoff_CAML_filter_character

value sankoff_CAML_filter_character(value this_eltarr, value ecode_bigarr, value get_comp) {    CAMLparam3(this_eltarr,ecode_bigarr,get_comp);    CAMLlocal1(res);    int get_complementary = Int_val(get_comp);    int * ecode_arr = (int*) Data_bigarray_val(ecode_bigarr);    eltarr_p eap;    Sankoff_eltarr_custom_val(eap,this_eltarr);    int num_elts=eap->num_elts;     int res_num_elts=0;//must init to 0    int i;    elt_p ep;    int * sign_arr = (int*)calloc(num_elts,sizeof(int));    for (i=0;i<num_elts;i++) {        ep = &((eap->elts)[i]);        if(get_complementary) {            if( int_array_is_mem(ecode_arr,num_elts,ep->ecode) )            {  sign_arr[i]=0;  }            else { sign_arr[i]=1; res_num_elts++; }        }        else {            if( int_array_is_mem(ecode_arr,num_elts,ep->ecode) )            {  sign_arr[i]=1; res_num_elts++; }            else sign_arr[i]=0;        }            }    eltarr_p res_eap;    res_eap = (eltarr_p)calloc(1,sizeof(struct elt_arr));    int num_states = eap->num_states;    res_eap->code = eap->code;    res_eap->num_states = eap->num_states;    res_eap->num_elts = res_num_elts;    res_eap->tcm = (int*)calloc(num_states*num_states,sizeof(int));    res_eap->is_identity = eap->is_identity;    memcpy (res_eap->tcm,eap->tcm,sizeof(int)*num_states*num_states);    res_eap->elts = (elt_p)calloc(res_num_elts,sizeof(struct elt));    elt_p res_elts = res_eap->elts;    int j=0;    for (i=0;i<num_elts;i++) {        if(sign_arr[i]==1) {         sankoff_create_empty_elt(&(res_elts[j]),num_states,-1);         sankoff_clone_elt(&(res_elts[j]),&((eap->elts)[i]));         j++;        }    }    free(sign_arr);    assert(j==res_num_elts);    res = caml_alloc_custom(&sankoff_custom_operations_eltarr,sizeof(eltarr_p),1,alloc_custom_max);    Sankoff_return_eltarr(res) = res_eap;    CAMLreturn(res);}
开发者ID:amnh,项目名称:poy5,代码行数:52,


示例25: caml_mdb_dbi_open

CAMLprim value caml_mdb_dbi_open(value txn,value name,value flags){  CAMLparam3(txn,name,flags);  MDB_dbi dbi;  char*str=NULL;  if(caml_string_length(name))    str=String_val(name);  if(mdb_dbi_open((MDB_txn*)txn,str,Int_val(flags),&dbi)){    caml_failwith("error in mdb_dbi_open");  }  CAMLreturn(Val_int(dbi));}
开发者ID:8l,项目名称:pijul,代码行数:13,


示例26: iocp_ml_write

CAMLprim value iocp_ml_write(value fd, value vbuf, value vlen){  CAMLparam3(fd, vbuf, vlen);  CAMLlocal1(res);  intnat len = Long_val(vlen);  SOCKET s = Socket_val(fd);  char *buf = String_val(vbuf);  assert(Descr_kind_val(fd) == KIND_SOCKET);  res =  Val_int(async_write(s, buf, len));  CAMLreturn(res);  /* async_write(s, buf, len); */  /* return Val_unit; */}
开发者ID:AltGr,项目名称:opalang,代码行数:13,


示例27: ocamlyices_type_function2

CAMLprim value ocamlyices_type_function2(value v_dom1, value v_dom2,    value v_range) {  CAMLparam3(v_dom1, v_dom2, v_range);  type_t res;  res = yices_function_type2(Type_val(v_dom1), Type_val(v_dom2),                             Type_val(v_range));  if (res == NULL_TYPE) {    _oy_error();  }  CAMLreturn(Val_type(res));}
开发者ID:polazarus,项目名称:ocamlyices2,代码行数:13,


示例28: caml_SDL_BlitSurfs

CAMLprim valuecaml_SDL_BlitSurfs(        value src, value dst, value _dstrect){    CAMLparam3(src, dst, _dstrect);    SDL_Rect dstrect;    SDL_Rect_val(&dstrect, _dstrect);    int r = SDL_BlitSurface(        SDL_Surface_val(src), NULL,        SDL_Surface_val(dst), &dstrect);    if (r) caml_failwith("Sdlsurface.blit_surfs");    CAMLreturn(Val_unit);}
开发者ID:fccm,项目名称:OCamlSDL2,代码行数:13,


示例29: lwt_unix_socketpair_stub

CAMLprim value lwt_unix_socketpair_stub(value domain, value type,                                        value protocol) {  CAMLparam3(domain, type, protocol);  CAMLlocal1(result);  SOCKET sockets[2];  lwt_unix_socketpair(socket_domain_table[Int_val(domain)],                      socket_type_table[Int_val(type)], Int_val(protocol),                      sockets);  result = caml_alloc_tuple(2);  Store_field(result, 0, win_alloc_socket(sockets[0]));  Store_field(result, 1, win_alloc_socket(sockets[1]));  CAMLreturn(result);}
开发者ID:copy,项目名称:lwt,代码行数:13,


示例30: sundials_ml_fvector_scale

CAMLprim value sundials_ml_fvector_scale(value s, value x, value z) {  CAMLparam3(s,x,z);  const double ds = Double_val(s);  struct caml_ba_array* ba_x = Caml_ba_array_val(x);  struct caml_ba_array* ba_z = Caml_ba_array_val(z);  double* dx = (double*) ba_x -> data;  double* dz = (double*) ba_z -> data;  for(int i = 0; i < ba_x->dim[0]; i++)    dz[i] = dx[i] * ds;  CAMLreturn(Val_unit);}
开发者ID:AMSUN-Berlin,项目名称:sundials-ocaml,代码行数:13,



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


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