当前位置: 首页>>代码示例>>C++>>正文


C++ SCM_SMOB_DATA函数代码示例

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


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

示例1: frscm_free_frame_smob

static size_t
frscm_free_frame_smob (SCM self)
{
  frame_smob *f_smob = (frame_smob *) SCM_SMOB_DATA (self);

  if (f_smob->inferior != NULL)
    {
      htab_t htab = frscm_inferior_frame_map (f_smob->inferior);

      gdbscm_clear_eqable_gsmob_ptr_slot (htab, &f_smob->base);
    }

  /* Not necessary, done to catch bugs.  */
  f_smob->inferior = NULL;

  return 0;
}
开发者ID:cupertinomiranda,项目名称:binutils,代码行数:17,代码来源:scm-frame.c

示例2: ragnarok_print_epoll_event_set

static int ragnarok_print_epoll_event_set(SCM ees_smob ,SCM port,
					  scm_print_state *pstate)
{
  scm_rag_epoll_event_set *ees = (scm_rag_epoll_event_set *)SCM_SMOB_DATA(ees_smob);
  
  scm_puts("#<rag_epoll_event_set_smob 0x" ,port);
  scm_intprint((long)ees ,16 ,port);
  scm_puts(" epfd:" ,port);
  scm_intprint((int)ees->epfd ,10 ,port);
  scm_puts(" size:" ,port);
  scm_intprint((unsigned int)ees->size ,10 ,port);
  scm_puts(" count:" ,port);
  scm_intprint((unsigned int)ees->count ,10 ,port);
  scm_puts(" >" ,port);

  return 1;
}
开发者ID:NalaGinrut,项目名称:ragnarok,代码行数:17,代码来源:rag_epoll.c

示例3: syscm_free_symbol_smob

static size_t
syscm_free_symbol_smob (SCM self)
{
  symbol_smob *s_smob = (symbol_smob *) SCM_SMOB_DATA (self);

  if (s_smob->symbol != NULL)
    {
      htab_t htab = syscm_get_symbol_map (s_smob->symbol);

      gdbscm_clear_eqable_gsmob_ptr_slot (htab, &s_smob->base);
    }

  /* Not necessary, done to catch bugs.  */
  s_smob->symbol = NULL;

  return 0;
}
开发者ID:cupertinomiranda,项目名称:binutils,代码行数:17,代码来源:scm-symbol.c

示例4: scm_focus_client

static SCM scm_focus_client(SCM client_smob)
{
    client_t *client = NULL;
    if (scm_is_eq(client_smob, SCM_UNSPECIFIED))
        client = client_list;  // Use first client in list if we aren't given a good client_smob
    else
        client = (client_t *)SCM_SMOB_DATA(client_smob);

    if (!client)
        return SCM_UNSPECIFIED;

    if (!is_mapped(client))
        return SCM_UNSPECIFIED;

    set_focus_client(client);
    return SCM_UNSPECIFIED;
}
开发者ID:nizmic,项目名称:nwm,代码行数:17,代码来源:scheme.c

示例5: stscm_print_symtab_smob

static int
stscm_print_symtab_smob (SCM self, SCM port, scm_print_state *pstate)
{
  symtab_smob *st_smob = (symtab_smob *) SCM_SMOB_DATA (self);

  gdbscm_printf (port, "#<%s ", symtab_smob_name);
  gdbscm_printf (port, "%s",
		 st_smob->symtab != NULL
		 ? symtab_to_filename_for_display (st_smob->symtab)
		 : "<invalid>");
  scm_puts (">", port);

  scm_remember_upto_here_1 (self);

  /* Non-zero means success.  */
  return 1;
}
开发者ID:Winter3un,项目名称:ctf_task,代码行数:17,代码来源:scm-symtab.c

示例6: stscm_scm_from_sal

SCM
stscm_scm_from_sal (struct symtab_and_line sal)
{
  SCM st_scm, s_scm;
  sal_smob *s_smob;

  st_scm = SCM_BOOL_F;
  if (sal.symtab != NULL)
    st_scm = stscm_scm_from_symtab (sal.symtab);

  s_scm = stscm_make_sal_smob ();
  s_smob = (sal_smob *) SCM_SMOB_DATA (s_scm);
  s_smob->symtab_scm = st_scm;
  s_smob->sal = sal;

  return s_scm;
}
开发者ID:embecosm,项目名称:binutils-gdb,代码行数:17,代码来源:scm-symtab.c

示例7: guile_sock_send_buffer_size

static SCM
guile_sock_send_buffer_size (SCM sock, SCM size)
{
    svz_socket_t *xsock;
    int len;

    scm_assert_smob_type (guile_svz_socket_tag, sock);
    xsock = (svz_socket_t *) SCM_SMOB_DATA (sock);
    if (!SCM_UNBNDP (size))
    {
        SCM_ASSERT (scm_is_integer (size), size, SCM_ARG2, FUNC_NAME);
        len = scm_to_int (size);
        svz_sock_resize_buffers (xsock, len, xsock->recv_buffer_size);
    }
    return scm_cons (scm_from_int (xsock->send_buffer_size),
                     scm_from_int (xsock->send_buffer_fill));
}
开发者ID:spk121,项目名称:serveez-mg,代码行数:17,代码来源:guile-api.c

示例8: stscm_free_symtab_smob

static size_t
stscm_free_symtab_smob (SCM self)
{
  symtab_smob *st_smob = (symtab_smob *) SCM_SMOB_DATA (self);

  if (st_smob->symtab != NULL)
    {
      htab_t htab = stscm_objfile_symtab_map (st_smob->symtab);

      gdbscm_clear_eqable_gsmob_ptr_slot (htab, &st_smob->base);
    }

  /* Not necessary, done to catch bugs.  */
  st_smob->symtab = NULL;

  return 0;
}
开发者ID:Winter3un,项目名称:ctf_task,代码行数:17,代码来源:scm-symtab.c

示例9: free_plotter

size_t
free_plotter (SCM x)
{
  plPlotter *plotter;

  assert (SCM_SMOB_PREDICATE (plotter_tag, x));

  plotter = (plPlotter *) SCM_SMOB_DATA (x);
  /* Plotters should already be null if delwin has been called on them */
  if (plotter != NULL)
    {
      pl_deletepl_r (plotter);
      SCM_SET_SMOB_DATA (x, 0);
    }

  return 0;
}
开发者ID:spk121,项目名称:guile-plotutils,代码行数:17,代码来源:guile_plot.c

示例10: scm_print_rag_select_event_set

static int scm_print_rag_select_event_set(SCM event_set_smob ,SCM port,
					  scm_print_state *pstate)
{
  scm_rag_select_event_set *ses =
    (scm_rag_select_event_set*)SCM_SMOB_DATA(event_set_smob);
  
  scm_puts("#<rag_select_event_set_smob 0x" ,port);
  scm_intprint((long)ses ,16 ,port)					;
  scm_puts(" nfds:");
  scm_intprint((int)ses->nfds ,10 ,port);
  scm_puts(" size:");
  scm_intprint((unsigned int)ses->size ,10 ,port);
  scm_puts(" count:");
  scm_intprint((unsigned int)ses->count ,10 ,port);
  scm_puts(" >", port);
  
  return 1;
}
开发者ID:NalaGinrut,项目名称:ragnarok,代码行数:18,代码来源:rag_select.c

示例11: gdbscm_lazy_string_to_value

static SCM
gdbscm_lazy_string_to_value (SCM self)
{
    SCM ls_scm = lsscm_get_lazy_string_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
    lazy_string_smob *ls_smob = (lazy_string_smob *) SCM_SMOB_DATA (ls_scm);
    struct value *value = NULL;
    volatile struct gdb_exception except;

    if (ls_smob->address == 0)
    {
        gdbscm_throw (gdbscm_make_out_of_range_error (FUNC_NAME, SCM_ARG1, self,
                      _("cannot create a value from NULL")));
    }

    TRY_CATCH (except, RETURN_MASK_ALL)
    {
        value = value_at_lazy (ls_smob->type, ls_smob->address);
    }
开发者ID:mbref,项目名称:binutils-gdb-microblaze,代码行数:18,代码来源:scm-lazy-string.c

示例12: smob_print

/*! \brief Print a representation of a #GschemToplevel smob.
 * \par Function Description
 * Outputs a string representing the \a smob to a Scheme output
 * \a port. The format used is "#<gschem-window b7ef65d0>".
 *
 * Used internally to Guile.
 */
static int
smob_print (SCM smob, SCM port, scm_print_state *pstate)
{
    gchar *hexstring;

    scm_puts ("#<gschem-window", port);

    scm_dynwind_begin (0);
    hexstring = g_strdup_printf (" %zx", SCM_SMOB_DATA (smob));
    scm_dynwind_unwind_handler (g_free, hexstring, SCM_F_WIND_EXPLICITLY);
    scm_puts (hexstring, port);
    scm_dynwind_end ();

    scm_puts (">", port);

    /* Non-zero means success */
    return 1;
}
开发者ID:vzh,项目名称:geda-gaf,代码行数:25,代码来源:g_window.c

示例13: lsscm_print_lazy_string_smob

static int
lsscm_print_lazy_string_smob (SCM self, SCM port, scm_print_state *pstate)
{
    lazy_string_smob *ls_smob = (lazy_string_smob *) SCM_SMOB_DATA (self);

    gdbscm_printf (port, "#<%s", lazy_string_smob_name);
    gdbscm_printf (port, " @%s", hex_string (ls_smob->address));
    if (ls_smob->length >= 0)
        gdbscm_printf (port, " length %d", ls_smob->length);
    if (ls_smob->encoding != NULL)
        gdbscm_printf (port, " encoding %s", ls_smob->encoding);
    scm_puts (">", port);

    scm_remember_upto_here_1 (self);

    /* Non-zero means success.  */
    return 1;
}
开发者ID:mbref,项目名称:binutils-gdb-microblaze,代码行数:18,代码来源:scm-lazy-string.c

示例14: apply_rule

SCM apply_rule (SCM board_smob, SCM rule_func) {
	SCM cell;
	struct board *board;
	int i; 
	int j;

	scm_assert_smob_type(board_tag, board_smob);
	board = (struct board *) SCM_SMOB_DATA(board_smob);

	for (i = 0; i < board->height; i++) {
		for (j = 0; j < board->width; j++) {
			cell = scm_list_ref(scm_list_ref(board->cell_list, scm_from_int(j)), scm_from_int(i));
			scm_call_2(rule_func, cell, get_living_neighbors(board_smob, cell));
		}
	}

	return SCM_UNSPECIFIED;
}
开发者ID:bradfordbarr,项目名称:Flatland,代码行数:18,代码来源:board.c

示例15: ppscm_pretty_print_one_value

static SCM
ppscm_pretty_print_one_value (SCM printer, struct value **out_value,
			      struct gdbarch *gdbarch,
			      const struct language_defn *language)
{
  volatile struct gdb_exception except;
  SCM result = SCM_BOOL_F;

  *out_value = NULL;
  TRY_CATCH (except, RETURN_MASK_ALL)
    {
      int rc;
      pretty_printer_worker_smob *w_smob
	= (pretty_printer_worker_smob *) SCM_SMOB_DATA (printer);

      result = gdbscm_safe_call_1 (w_smob->to_string, printer,
				   gdbscm_memory_error_p);
      if (gdbscm_is_false (result))
	; /* Done.  */
      else if (scm_is_string (result)
	       || lsscm_is_lazy_string (result))
	; /* Done.  */
      else if (vlscm_is_value (result))
	{
	  SCM except_scm;

	  *out_value
	    = vlscm_convert_value_from_scheme (FUNC_NAME, GDBSCM_ARG_NONE,
					       result, &except_scm,
					       gdbarch, language);
	  if (*out_value != NULL)
	    result = SCM_BOOL_T;
	  else
	    result = except_scm;
	}
      else if (gdbscm_is_exception (result))
	; /* Done.  */
      else
	{
	  /* Invalid result from to-string.  */
	  result = ppscm_make_pp_type_error_exception
	    (_("invalid result from pretty-printer to-string"), result);
	}
    }
开发者ID:atgreen,项目名称:binutils-gdb,代码行数:44,代码来源:scm-pretty-print.c


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