コード例 #1
0
ファイル: libbfd_stubs.c プロジェクト: JaonLin/ropc
value camlidl_libbfd_bfd_get_section_contents(
	value _v_abfd,
	value _v_section,
	value _v_offset,
	value _v_count)
{
  bfdp abfd; /*in*/
  section_ptr section; /*in*/
  char *location; /*out*/
  file_ptr offset; /*in*/
  bfd_size_type count; /*in*/
  bfd_boolean _res;
  struct camlidl_ctx_struct _ctxs = { CAMLIDL_TRANSIENT, NULL };
  camlidl_ctx _ctx = &_ctxs;
  value _vresult;
  value _vres[2] = { 0, 0, };

  camlidl_ml2c_libbfd_bfdp(_v_abfd, &abfd, _ctx);
  camlidl_ml2c_libbfd_section_ptr(_v_section, &section, _ctx);
  camlidl_ml2c_libbfd_file_ptr(_v_offset, &offset, _ctx);
  camlidl_ml2c_libbfd_bfd_size_type(_v_count, &count, _ctx);
  location = stat_alloc(count * sizeof(char ));
  _res = bfd_get_section_contents(abfd, section, location, offset, count);
  Begin_roots_block(_vres, 2)
    _vres[0] = camlidl_c2ml_libbfd_bfd_boolean(&_res, _ctx);
    _vres[1] = alloc_bigarray_dims(
            BIGARRAY_UINT8 | BIGARRAY_C_LAYOUT | BIGARRAY_MANAGED,
            1, location, count);
    _vresult = camlidl_alloc_small(2, 0);
    Field(_vresult, 0) = _vres[0];
    Field(_vresult, 1) = _vres[1];
  End_roots()
  camlidl_free(_ctx);
  return _vresult;
}
コード例 #2
0
ファイル: shape_caml.c プロジェクト: mihasighi/celia-tools
value camlidl_shape_shape_manager_alloc(value _unit)
{
  ap_manager_ptr _res;
  value _vres;

  struct camlidl_ctx_struct _ctxs = { CAMLIDL_TRANSIENT, NULL };
  camlidl_ctx _ctx = &_ctxs;
  _res = shape_manager_alloc();
  _vres = camlidl_c2ml_manager_ap_manager_ptr(&_res, _ctx);
  camlidl_free(_ctx);
  return _vres;
}
コード例 #3
0
ファイル: libbfd_stubs.c プロジェクト: JaonLin/ropc
value camlidl_libbfd_bfd_section_get_flags(
	value _v_s)
{
  section_ptr s; /*in*/
  long long _res;
  value _vres;

  struct camlidl_ctx_struct _ctxs = { CAMLIDL_TRANSIENT, NULL };
  camlidl_ctx _ctx = &_ctxs;
  camlidl_ml2c_libbfd_section_ptr(_v_s, &s, _ctx);
  _res = bfd_section_get_flags(s);
  _vres = copy_int64(_res);
  camlidl_free(_ctx);
  return _vres;
}
コード例 #4
0
ファイル: libbfd_stubs.c プロジェクト: JaonLin/ropc
value camlidl_libbfd_bfd_section_get_name(
	value _v_s)
{
  section_ptr s; /*in*/
  char const *_res;
  value _vres;

  struct camlidl_ctx_struct _ctxs = { CAMLIDL_TRANSIENT, NULL };
  camlidl_ctx _ctx = &_ctxs;
  camlidl_ml2c_libbfd_section_ptr(_v_s, &s, _ctx);
  _res = bfd_section_get_name(s);
  _vres = copy_string(_res);
  camlidl_free(_ctx);
  return _vres;
}
コード例 #5
0
ファイル: libbfd_stubs.c プロジェクト: JaonLin/ropc
value camlidl_libbfd_bfd_section_get_size(
	value _v_s)
{
  section_ptr s; /*in*/
  bfd_size_type _res;
  value _vres;

  struct camlidl_ctx_struct _ctxs = { CAMLIDL_TRANSIENT, NULL };
  camlidl_ctx _ctx = &_ctxs;
  camlidl_ml2c_libbfd_section_ptr(_v_s, &s, _ctx);
  _res = bfd_section_get_size(s);
  _vres = camlidl_c2ml_libbfd_bfd_size_type(&_res, _ctx);
  camlidl_free(_ctx);
  return _vres;
}