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


C++ scm_from_bool函数代码示例

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


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

示例1: call_guile_keypress

bool call_guile_keypress(char key, bool ctrl, bool mod1) {
  return scm_to_bool (scm_eval (scm_list_n (scm_from_locale_symbol ("on-key-press"),
                                            scm_from_char(key),
                                            scm_from_bool(ctrl),
                                            scm_from_bool(mod1),
                                            SCM_UNDEFINED
                                            ), scm_interaction_environment()));
}
开发者ID:pimp-my-code,项目名称:sxiv,代码行数:8,代码来源:scripting.c

示例2: game_fullscreen

static SCM
game_fullscreen (SCM game_smob)
{
    Game *game = check_game (game_smob);

    return scm_from_bool (al_get_display_flags (game->display) &  ALLEGRO_FULLSCREEN);
}
开发者ID:davidgomes,项目名称:gnumaku,代码行数:7,代码来源:game.c

示例3: gdbscm_stdio_port_p

static SCM
gdbscm_stdio_port_p (SCM scm)
{
  /* This is copied from SCM_FPORTP.  */
  return scm_from_bool (!SCM_IMP (scm)
			&& (SCM_TYP16 (scm) == stdio_port_desc));
}
开发者ID:freebsd-riscv,项目名称:riscv-binutils-gdb,代码行数:7,代码来源:scm-ports.c

示例4: tortoise_penup

static SCM tortoise_penup()
{
	SCM result = scm_from_bool(pendown);
	pendown = 0;

	return result;
}
开发者ID:vmlinz,项目名称:scheme_examples,代码行数:7,代码来源:tortoise.c

示例5: gdbscm_sal_valid_p

static SCM
gdbscm_sal_valid_p (SCM self)
{
  sal_smob *s_smob = stscm_get_sal_smob_arg (self, SCM_ARG1, FUNC_NAME);

  return scm_from_bool (stscm_sal_is_valid (s_smob));
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:7,代码来源:scm-symtab.c

示例6: gdbscm_command_valid_p

static SCM
gdbscm_command_valid_p (SCM self)
{
  command_smob *c_smob
    = cmdscm_get_command_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);

  return scm_from_bool (cmdscm_is_valid (c_smob));
}
开发者ID:RWTH-OS,项目名称:binutils,代码行数:8,代码来源:scm-cmd.c

示例7: call_guile_buttonpress

bool call_guile_buttonpress(unsigned int button, bool ctrl, int x, int y) {
  return scm_to_bool (scm_eval (scm_list_n (scm_from_locale_symbol ("on-button-press"),
                                            scm_from_int(button),
                                            scm_from_bool(ctrl),
                                            scm_from_int(x),
                                            scm_from_int(y),
                                            SCM_UNDEFINED
                                            ), scm_interaction_environment()));
}
开发者ID:pimp-my-code,项目名称:sxiv,代码行数:9,代码来源:scripting.c

示例8: second_pointer_from_offset

SCM second_pointer_from_offset(void)
{
  uint8_t buffer[4] = {2, 3, 5, 7};
  uint8_t *p = &buffer[0];
  uint8_t *data[2];
  int64_t offsets[2] = {3, 2};
  pointers_from_offsets(p, offsets, data, 2);
  return scm_from_bool(5 == *data[1]);
}
开发者ID:wedesoft,项目名称:aiscm,代码行数:9,代码来源:samples-helpers-tests.c

示例9: first_pointer_from_offset

SCM first_pointer_from_offset(void)
{
  uint8_t buffer[4] = {2, 3, 5, 7};
  uint8_t *p = &buffer[0];
  uint8_t *data[1];
  int64_t offsets[1] = {3};
  pointers_from_offsets(p, offsets, data, 1);
  return scm_from_bool(7 == *data[0]);
}
开发者ID:wedesoft,项目名称:aiscm,代码行数:9,代码来源:samples-helpers-tests.c

示例10: gdbscm_set_pretty_printer_enabled_x

static SCM
gdbscm_set_pretty_printer_enabled_x (SCM self, SCM enabled)
{
  pretty_printer_smob *pp_smob
    = ppscm_get_pretty_printer_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);

  pp_smob->enabled = scm_from_bool (gdbscm_is_true (enabled));

  return SCM_UNSPECIFIED;
}
开发者ID:Caleb1994,项目名称:stewieos-binutils,代码行数:10,代码来源:scm-pretty-print.c

示例11: scm_from_netlist

static SCM
scm_from_netlist (NETLIST *netlist)
{
  return scm_list_n (netlist->component_uref ? scm_from_utf8_string (netlist->component_uref) : SCM_BOOL_F,
                     netlist->hierarchy_tag ? scm_from_utf8_string (netlist->hierarchy_tag) : SCM_BOOL_F,
                     scm_from_bool (netlist->composite_component),
                     netlist->object_ptr ? edascm_from_object (netlist->object_ptr) : SCM_BOOL_F,
                     scm_from_pin_list (netlist->cpins),
                     SCM_UNDEFINED);
}
开发者ID:gareth8118,项目名称:geda-gaf,代码行数:10,代码来源:s_netlist.c

示例12: gdbscm_symbol_function_p

static SCM
gdbscm_symbol_function_p (SCM self)
{
  symbol_smob *s_smob
    = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
  const struct symbol *symbol = s_smob->symbol;
  enum address_class theclass;

  theclass = SYMBOL_CLASS (symbol);

  return scm_from_bool (theclass == LOC_BLOCK);
}
开发者ID:cupertinomiranda,项目名称:binutils,代码行数:12,代码来源:scm-symbol.c

示例13: wrap_musicpd_play

static SCM wrap_musicpd_play(SCM id) {
	bool b;
	int mpdid;

	b = SCM_BOOL_F;
	if(scm_is_integer(id)) {
		mpdid = scm_to_int(id);
		b = musicpd_play_id(mpdid);
	} else {
		b = musicpd_play();
	}
	
	return scm_from_bool(b);
}
开发者ID:rkujawa,项目名称:geirvarta,代码行数:14,代码来源:scripting.c

示例14: gdbscm_symbol_variable_p

static SCM
gdbscm_symbol_variable_p (SCM self)
{
  symbol_smob *s_smob
    = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
  const struct symbol *symbol = s_smob->symbol;
  enum address_class theclass;

  theclass = SYMBOL_CLASS (symbol);

  return scm_from_bool (!SYMBOL_IS_ARGUMENT (symbol)
			&& (theclass == LOC_LOCAL || theclass == LOC_REGISTER
			    || theclass == LOC_STATIC || theclass == LOC_COMPUTED
			    || theclass == LOC_OPTIMIZED_OUT));
}
开发者ID:cupertinomiranda,项目名称:binutils,代码行数:15,代码来源:scm-symbol.c

示例15: cmdscm_function

static void
cmdscm_function (struct cmd_list_element *command, char *args, int from_tty)
{
  command_smob *c_smob/*obj*/ = (command_smob *) get_cmd_context (command);
  SCM arg_scm, tty_scm, result;

  gdb_assert (c_smob != NULL);

  if (args == NULL)
    args = "";
  arg_scm = gdbscm_scm_from_string (args, strlen (args), host_charset (), 1);
  if (gdbscm_is_exception (arg_scm))
    error (_("Could not convert arguments to Scheme string."));

  tty_scm = scm_from_bool (from_tty);

  result = gdbscm_safe_call_3 (c_smob->invoke, c_smob->containing_scm,
			       arg_scm, tty_scm, gdbscm_user_error_p);

  if (gdbscm_is_exception (result))
    {
      /* Don't print the stack if this was an error signalled by the command
	 itself.  */
      if (gdbscm_user_error_p (gdbscm_exception_key (result)))
	{
	  char *msg = gdbscm_exception_message_to_string (result);

	  make_cleanup (xfree, msg);
	  error ("%s", msg);
	}
      else
	{
	  gdbscm_print_gdb_exception (SCM_BOOL_F, result);
	  error (_("Error occurred in Scheme-implemented GDB command."));
	}
    }
}
开发者ID:RWTH-OS,项目名称:binutils,代码行数:37,代码来源:scm-cmd.c


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