本文整理汇总了C++中CAMLparam3函数的典型用法代码示例。如果您正苦于以下问题:C++ CAMLparam3函数的具体用法?C++ CAMLparam3怎么用?C++ CAMLparam3使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CAMLparam3函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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)));
}
示例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);
}
示例4: caml_gnttab_read
CAMLprim value
caml_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);
}
示例5: v2v_xml_node_ptr_set_prop
value
v2v_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);
}
示例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);
}
示例7: create_tuple
value
create_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);
}
示例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));
}
示例9: sankoff_CAML_dist_2
value
sankoff_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));
}
示例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);
}
示例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);
};
示例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));
}
示例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);
}
示例14: sankoff_CAML_init_beta
value
sankoff_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);
}
示例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);
}