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

C++ caml_leave_blocking_section函数代码示例

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

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



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

示例1: caml_seek_in

CAMLexport void caml_seek_in(struct channel *channel, file_offset dest)
{
  if (dest >= channel->offset - (channel->max - channel->buff) &&
      dest <= channel->offset) {
    channel->curr = channel->max - (channel->offset - dest);
  } else {
    caml_sys_error(NO_ARG);
    caml_leave_blocking_section();
    channel->offset = dest;
    channel->curr = channel->max = channel->buff;
  }
}
开发者ID:pgj,项目名称:mirage-platform,代码行数:12,代码来源:io.c


示例2: ocaml_ssl_set_client_SNI_hostname

CAMLprim value ocaml_ssl_set_client_SNI_hostname(value socket, value vhostname)
{
  CAMLparam2(socket, vhostname);
  SSL *ssl       = SSL_val(socket);
  char *hostname = String_val(vhostname);

  caml_enter_blocking_section();
  SSL_set_tlsext_host_name(ssl, hostname);
  caml_leave_blocking_section();

  CAMLreturn(Val_unit);
}
开发者ID:marcolinoas,项目名称:libres3,代码行数:12,代码来源:ssl_stubs.c


示例3: ocaml_ssl_get_issuer

CAMLprim value ocaml_ssl_get_issuer(value certificate)
{
  CAMLparam1(certificate);
  X509 *cert = Cert_val(certificate);

  caml_enter_blocking_section();
  char *issuer = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0);
  caml_leave_blocking_section();
  if (!issuer) caml_raise_not_found ();

  CAMLreturn(caml_copy_string(issuer));
}
开发者ID:marcolinoas,项目名称:libres3,代码行数:12,代码来源:ssl_stubs.c


示例4: ocaml_ssl_get_file_descr

CAMLprim value ocaml_ssl_get_file_descr(value socket)
{
  CAMLparam1(socket);
  SSL *ssl = SSL_val(socket);
  int fd;

  caml_enter_blocking_section();
  fd = SSL_get_fd(ssl);
  caml_leave_blocking_section();

  CAMLreturn(Val_int(fd));
}
开发者ID:marcolinoas,项目名称:libres3,代码行数:12,代码来源:ssl_stubs.c


示例5: ocaml_ssl_get_subject

CAMLprim value ocaml_ssl_get_subject(value certificate)
{
  CAMLparam1(certificate);
  X509 *cert = Cert_val(certificate);

  caml_enter_blocking_section();
  char *subject = X509_NAME_oneline(X509_get_subject_name(cert), 0, 0);
  caml_leave_blocking_section();
  if (subject == NULL) caml_raise_not_found ();

  CAMLreturn(caml_copy_string(subject));
}
开发者ID:marcolinoas,项目名称:libres3,代码行数:12,代码来源:ssl_stubs.c


示例6: ocaml_ssl_get_verify_result

CAMLprim value ocaml_ssl_get_verify_result(value socket)
{
  CAMLparam1(socket);
  int ans;
  SSL *ssl = SSL_val(socket);

  caml_enter_blocking_section();
  ans = SSL_get_verify_result(ssl);
  caml_leave_blocking_section();

  CAMLreturn(Val_int(ans));
}
开发者ID:marcolinoas,项目名称:libres3,代码行数:12,代码来源:ssl_stubs.c


示例7: caml_do_read

/* caml_do_read is exported for Cash */
CAMLexport int caml_do_read(int fd, char *p, unsigned int n)
{
  int retcode;

  do {
    caml_enter_blocking_section();
    retcode = read(fd, p, n);
    caml_leave_blocking_section();
  } while (retcode == -1 && errno == EINTR);
  if (retcode == -1) caml_sys_io_error(NO_ARG);
  return retcode;
}
开发者ID:joechenq,项目名称:multi-script,代码行数:13,代码来源:ocaml_io.c


示例8: unix_fstat

CAMLprim value unix_fstat(value fd)
{
  int ret;
  struct stat buf;
  caml_enter_blocking_section();
  ret = fstat(Int_val(fd), &buf);
  caml_leave_blocking_section();
  if (ret == -1) uerror("fstat", Nothing);
  if (buf.st_size > Max_long && (buf.st_mode & S_IFMT) == S_IFREG)
    unix_error(EOVERFLOW, "fstat", Nothing);
  return stat_aux(0, &buf);
}
开发者ID:bluddy,项目名称:ocaml-multicore,代码行数:12,代码来源:stat.c


示例9: bigstring_write_stub

CAMLprim value bigstring_write_stub(
  value v_fd, value v_pos, value v_len, value v_bstr)
{
  CAMLparam1(v_bstr);
  char *bstr = get_bstr(v_bstr, v_pos);
  size_t len = Long_val(v_len);
  ssize_t written;
  caml_enter_blocking_section();
    written = write(Int_val(v_fd), bstr, len);
  caml_leave_blocking_section();
  if (written == -1) uerror("write", Nothing);
  CAMLreturn(Val_long(written));
}
开发者ID:commonlisp,项目名称:core,代码行数:13,代码来源:bigstring_stubs.c


示例10: lo_write_ba_stub

CAMLprim value lo_write_ba_stub(value v_conn, value v_fd,
                                value v_buf, value v_pos, value v_len)
{
  CAMLparam2(v_conn, v_buf);
  PGconn *conn = get_conn(v_conn);
  value v_res;
  size_t len = Long_val(v_len);
  char *buf = ((char *) Caml_ba_data_val(v_buf)) + Long_val(v_pos);
  caml_enter_blocking_section();
    v_res = Val_long(lo_write(conn, Int_val(v_fd), buf, len));
  caml_leave_blocking_section();
  CAMLreturn(v_res);
}
开发者ID:Nevor,项目名称:postgresql-ocaml,代码行数:13,代码来源:postgresql_stubs.c


示例11: svn_pool_create

apr_array_header_t *svn_support_diff(char *rep_path, 
                                    char *filename, 
                                    int revision1, 
                                    int revision2)
{
  apr_pool_t *subpool = svn_pool_create(pool);
  svn_stringbuf_t * rep = svn_stringbuf_create(rep_path, subpool);
  svn_stringbuf_t * file = svn_stringbuf_create(filename, subpool);
  caml_enter_blocking_section ();
  apr_array_header_t *res = svn_support_diff_call(rep->data,file->data,revision1,revision2,subpool); 
  caml_leave_blocking_section ();
  return res;
}
开发者ID:aryx,项目名称:fork-ocsigen,代码行数:13,代码来源:swig_svn.c


示例12: ocaml_ssl_ctx_load_verify_locations

CAMLprim value ocaml_ssl_ctx_load_verify_locations(value context, value ca_file, value ca_path)
{
  CAMLparam3(context, ca_file, ca_path);
  SSL_CTX *ctx = Ctx_val(context);
  char *CAfile = String_val(ca_file);
  char *CApath = String_val(ca_path);

  if(*CAfile == 0)
    CAfile = NULL;
  if(*CApath == 0)
    CApath = NULL;

  caml_enter_blocking_section();
  if(SSL_CTX_load_verify_locations(ctx, CAfile, CApath) != 1)
  {
    caml_leave_blocking_section();
    caml_invalid_argument("cafile or capath");
  }
  caml_leave_blocking_section();

  CAMLreturn(Val_unit);
}
开发者ID:marcolinoas,项目名称:libres3,代码行数:22,代码来源:ssl_stubs.c


示例13: ocaml_ssl_write_certificate

CAMLprim value ocaml_ssl_write_certificate(value vfilename, value certificate)
{
  CAMLparam2(vfilename, certificate);
  char *filename = String_val(vfilename);
  X509 *cert = Cert_val(certificate);
  FILE *fh = NULL;

  if((fh = fopen(filename, "w")) == NULL)
    caml_raise_constant(*caml_named_value("ssl_exn_certificate_error"));

  caml_enter_blocking_section();
  if(PEM_write_X509(fh, cert) == 0)
  {
    fclose(fh);
    caml_leave_blocking_section();
    caml_raise_constant(*caml_named_value("ssl_exn_certificate_error"));
  }
  fclose(fh);
  caml_leave_blocking_section();

  CAMLreturn(Val_unit);
}
开发者ID:marcolinoas,项目名称:libres3,代码行数:22,代码来源:ssl_stubs.c


示例14: ocaml_ssl_get_current_cipher

CAMLprim value ocaml_ssl_get_current_cipher(value socket)
{
  CAMLparam1(socket);
  SSL *ssl = SSL_val(socket);

  caml_enter_blocking_section();
  SSL_CIPHER *cipher = (SSL_CIPHER*)SSL_get_current_cipher(ssl);
  caml_leave_blocking_section();
  if (!cipher)
    caml_raise_constant(*caml_named_value("ssl_exn_cipher_error"));

  CAMLreturn((value)cipher);
}
开发者ID:marcolinoas,项目名称:libres3,代码行数:13,代码来源:ssl_stubs.c


示例15: unix_unlink

CAMLprim value unix_unlink(value path)
{
  CAMLparam1(path);
  char * p;
  int ret;
  p = caml_strdup(String_val(path));
  caml_enter_blocking_section();
  ret = unlink(p);
  caml_leave_blocking_section();
  caml_stat_free(p);
  if (ret == -1) uerror("unlink", path);
  CAMLreturn(Val_unit);
}
开发者ID:BrianMulhall,项目名称:ocaml,代码行数:13,代码来源:unlink.c


示例16: unix_chmod

CAMLprim value unix_chmod(value path, value perm)
{
  CAMLparam2(path, perm);
  char * p;
  int ret;
  p = caml_strdup(String_val(path));
  caml_enter_blocking_section();
  ret = chmod(p, Int_val(perm));
  caml_leave_blocking_section();
  caml_stat_free(p);
  if (ret == -1) uerror("chmod", path);
  CAMLreturn(Val_unit);
}
开发者ID:BrianMulhall,项目名称:ocaml,代码行数:13,代码来源:chmod.c


示例17: caml_sys_remove

CAMLprim value caml_sys_remove(value name)
{
  CAMLparam1(name);
  char * p;
  int ret;
  p = caml_strdup(String_val(name));
  caml_enter_blocking_section();
  ret = unlink(p);
  caml_leave_blocking_section();
  caml_stat_free(p);
  if (ret != 0) caml_sys_error(name);
  CAMLreturn(Val_unit);
}
开发者ID:BrianMulhall,项目名称:ocaml,代码行数:13,代码来源:sys.c


示例18: unix_chown

CAMLprim value unix_chown(value path, value uid, value gid)
{
    CAMLparam1(path);
    char * p;
    int ret;
    p = caml_strdup(String_val(path));
    caml_enter_blocking_section();
    ret = chown(p, Int_val(uid), Int_val(gid));
    caml_leave_blocking_section();
    caml_stat_free(p);
    if (ret == -1) uerror("chown", path);
    CAMLreturn(Val_unit);
}
开发者ID:bobzhang,项目名称:ocaml,代码行数:13,代码来源:chown.c


示例19: unix_lseek_64

CAMLprim value unix_lseek_64(value fd, value ofs, value cmd)
{
  file_offset ret;
  /* [ofs] is an Int64, which is stored as a custom block; we must therefore
     extract its contents before dropping the runtime lock, or it might be
     moved. */
  file_offset ofs_c = File_offset_val(ofs);
  caml_enter_blocking_section();
  ret = lseek(Int_val(fd), ofs_c, seek_command_table[Int_val(cmd)]);
  caml_leave_blocking_section();
  if (ret == -1) uerror("lseek", Nothing);
  return Val_file_offset(ret);
}
开发者ID:BrianMulhall,项目名称:ocaml,代码行数:13,代码来源:lseek.c


示例20: caml_sys_chdir

CAMLprim value caml_sys_chdir(value dirname)
{
  CAMLparam1(dirname);
  char * p;
  int ret;
  p = caml_strdup(String_val(dirname));
  caml_enter_blocking_section();
  ret = chdir(p);
  caml_leave_blocking_section();
  caml_stat_free(p);
  if (ret != 0) caml_sys_error(dirname);
  CAMLreturn(Val_unit);
}
开发者ID:BrianMulhall,项目名称:ocaml,代码行数:13,代码来源:sys.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ caml_named_value函数代码示例发布时间:2022-05-30
下一篇:
C++ caml_invalid_argument函数代码示例发布时间: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