Example #1
0
File: scheme.c Project: nizmic/nwm
static void init_client_type(void)
{
    client_tag = scm_make_smob_type("client", sizeof(client_t));
    scm_set_smob_mark(client_tag, mark_client);
    scm_set_smob_free(client_tag, free_client);
    scm_set_smob_print(client_tag, print_client);
    scm_set_smob_equalp(client_tag, equalp_client);
}
Example #2
0
void
init_gram_keysym (void)
{
  gram_keysym_tag =
    scm_make_smob_type ("keysym", sizeof (struct gram_keysym));
  scm_set_smob_print (gram_keysym_tag, gram_keysym_print);
  scm_set_smob_equalp (gram_keysym_tag, gram_keysym_equalp);

  scm_c_define_module ("gram keysym", init_gram_keysym_fns, NULL);
}
Example #3
0
/* Key smob initialization. */
void
init_key_type (void)
{
  key_tag = scm_make_smob_type ("key", sizeof (struct key_data));
  scm_set_smob_mark (key_tag, mark_key_smob);
  scm_set_smob_free (key_tag, free_key_smob);
  scm_set_smob_print (key_tag, print_key);
  scm_set_smob_equalp (key_tag, equalp_key);

#include "key-type.x"
}
Example #4
0
SWIGINTERN SCM
SWIG_Guile_Init ()
{
  static SCM swig_module;
  
  if (swig_initialized) return swig_module;
  swig_initialized = 1;

  swig_module = scm_c_resolve_module("Swig swigrun");
  if (ensure_smob_tag(swig_module, &swig_tag,
		      "swig-pointer", "swig-pointer-tag")) {
    scm_set_smob_print(swig_tag, print_swig);
    scm_set_smob_equalp(swig_tag, equalp_swig);
  }
  if (ensure_smob_tag(swig_module, &swig_collectable_tag,
		      "collectable-swig-pointer", "collectable-swig-pointer-tag")) {
    scm_set_smob_print(swig_collectable_tag, print_collectable_swig);
    scm_set_smob_equalp(swig_collectable_tag, equalp_swig);
    scm_set_smob_free(swig_collectable_tag, free_swig);
  }
  if (ensure_smob_tag(swig_module, &swig_destroyed_tag,
		      "destroyed-swig-pointer", "destroyed-swig-pointer-tag")) {
    scm_set_smob_print(swig_destroyed_tag, print_destroyed_swig);
    scm_set_smob_equalp(swig_destroyed_tag, equalp_swig);
  }
  if (ensure_smob_tag(swig_module, &swig_member_function_tag,
		      "swig-member-function-pointer", "swig-member-function-pointer-tag")) {
    scm_set_smob_print(swig_member_function_tag, print_member_function_swig);
    scm_set_smob_free(swig_member_function_tag, free_swig_member_function);
  }
  swig_make_func = scm_permanent_object(
    scm_variable_ref(scm_c_module_lookup(scm_c_resolve_module("oop goops"), "make")));
  swig_keyword = scm_permanent_object(scm_from_locale_keyword((char*) "init-smob"));
  swig_symbol = scm_permanent_object(scm_from_locale_symbol("swig-smob"));
#ifdef SWIG_INIT_RUNTIME_MODULE
  SWIG_INIT_RUNTIME_MODULE
#endif

  return swig_module;
}
Example #5
0
/*!
 * \brief Initialise the basic gEDA smob types.
 * \par Function Description
 * Registers the gEDA core smob types and some procedures acting on
 * them.  gEDA only uses a single Guile smob, and uses the flags field
 * to multiplex the several different underlying C structures that may
 * be represented by that smob. Should only be called by
 * edascm_init().
 */
void
edascm_init_smob ()
{
  /* Register gEDA smob type */
  geda_smob_tag = scm_make_smob_type ("geda", 0);
  scm_set_smob_free (geda_smob_tag, smob_free);
  scm_set_smob_print (geda_smob_tag, smob_print);
  scm_set_smob_equalp (geda_smob_tag, smob_equalp);

  /* Define the (geda core smob) module */
  scm_c_define_module ("geda core smob",
                       init_module_geda_core_smob,
                       NULL);
}
Example #6
0
void
gupl_plot_init (void)
{
  static int first = 1;

  if (first)
    {
      port_funcs.read = port_read;
      port_funcs.write = port_write;
      port_funcs.seek = port_seek;
      port_funcs.close = port_close;

      plparams_tag = scm_make_smob_type ("plparams", sizeof (plPlotterParams *));
      scm_set_smob_mark (plparams_tag, mark_plparams);
      scm_set_smob_free (plparams_tag, free_plparams);
      scm_set_smob_print (plparams_tag, print_plparams);
      scm_set_smob_equalp (plparams_tag, equalp_plparams);
      scm_c_define_gsubr ("plparams?", 1, 0, 0, gupl_is_plparams_p);
      scm_c_define_gsubr ("newplparams", 0, 0, 0, gupl_newplparams);

      plotter_tag = scm_make_smob_type ("plotter", sizeof (plPlotter *));
      scm_set_smob_mark (plotter_tag, mark_plotter);
      scm_set_smob_free (plotter_tag, free_plotter);
      scm_set_smob_print (plotter_tag, print_plotter);
      scm_set_smob_equalp (plotter_tag, equalp_plotter);
      scm_c_define_gsubr ("plotter?", 1, 0, 0, gupl_is_plotter_p);
      scm_c_define_gsubr ("newpl", 4, 0, 0, gupl_newpl);

      scm_c_define_gsubr ("%alabel!", 4, 0, 0, gupl_alabel_x);
      scm_c_define_gsubr ("arc!", 7, 0, 0, gupl_arc_x);
      scm_c_define_gsubr ("arcrel!", 7, 0, 0, gupl_arcrel_x);
      scm_c_define_gsubr ("bezier2!", 7, 0, 0, gupl_bezier2_x);
      scm_c_define_gsubr ("bezier2rel!", 7, 0, 0, gupl_bezier2rel_x);
      scm_c_define_gsubr ("bezier3!", 9, 0, 0, gupl_bezier3_x);
      scm_c_define_gsubr ("bezier3rel!", 9, 0, 0, gupl_bezier3rel_x);
      scm_c_define_gsubr ("bgcolor!", 4, 0, 0, gupl_bgcolor_x);
      scm_c_define_gsubr ("bgcolorname!", 2, 0, 0, gupl_bgcolorname_x);
      scm_c_define_gsubr ("box!", 5, 0, 0, gupl_box_x);
      scm_c_define_gsubr ("boxrel!", 5, 0, 0, gupl_boxrel_x);
      scm_c_define_gsubr ("capmod!", 2, 0, 0, gupl_capmod_x);
      scm_c_define_gsubr ("circle!", 4, 0, 0, gupl_circle_x);
      scm_c_define_gsubr ("circlerel!", 4, 0, 0, gupl_circlerel_x);
      scm_c_define_gsubr ("closepl!", 1, 0, 0, gupl_closepl_x);
      scm_c_define_gsubr ("color!", 4, 0, 0, gupl_color_x);
      scm_c_define_gsubr ("colorname!", 2, 0, 0, gupl_colorname_x);
      scm_c_define_gsubr ("concat!", 7, 0, 0, gupl_concat_x);
      scm_c_define_gsubr ("cont!", 3, 0, 0, gupl_cont_x);
      scm_c_define_gsubr ("contrel!", 3, 0, 0, gupl_contrel_x);
      scm_c_define_gsubr ("ellarc!", 7, 0, 0, gupl_ellarc_x);
      scm_c_define_gsubr ("ellarcrel!", 7, 0, 0, gupl_ellarcrel_x);
      scm_c_define_gsubr ("ellipse!", 6, 0, 0, gupl_ellipse_x);
      scm_c_define_gsubr ("ellipserel!", 6, 0, 0, gupl_ellipserel_x);
      scm_c_define_gsubr ("endpath!", 1, 0, 0, gupl_endpath_x);
      scm_c_define_gsubr ("endsubpath!", 1, 0, 0, gupl_endsubpath_x);
      scm_c_define_gsubr ("erase!", 1, 0, 0, gupl_erase_x);
      scm_c_define_gsubr ("fillcolor!", 4, 0, 0, gupl_fillcolor_x);
      scm_c_define_gsubr ("fillcolorname!", 2, 0, 0, gupl_fillcolorname_x);
      scm_c_define_gsubr ("fillmod!", 2, 0, 0, gupl_fillmod_x);
      scm_c_define_gsubr ("filltype!", 2, 0, 0, gupl_filltype_x);
      scm_c_define_gsubr ("flushpl!", 1, 0, 0, gupl_flushpl_x);
      scm_c_define_gsubr ("fontname!", 2, 0, 0, gupl_fontname_x);
      scm_c_define_gsubr ("fontsize!", 2, 0, 0, gupl_fontsize_x);
      scm_c_define_gsubr ("havecap", 2, 0, 0, gupl_havecap);
      scm_c_define_gsubr ("joinmod!", 2, 0, 0, gupl_joinmod_x);
      scm_c_define_gsubr ("label!", 2, 0, 0, gupl_label_x);
      scm_c_define_gsubr ("labelwidth!", 2, 0, 0, gupl_labelwidth_x);
      scm_c_define_gsubr ("line!", 5, 0, 0, gupl_line_x);
      scm_c_define_gsubr ("linemod!", 2, 0, 0, gupl_linemod_x);
      scm_c_define_gsubr ("linerel!", 5, 0, 0, gupl_linerel_x);
      scm_c_define_gsubr ("linewidth!", 2, 0, 0, gupl_linewidth_x);
      scm_c_define_gsubr ("marker!", 5, 0, 0, gupl_marker_x);
      scm_c_define_gsubr ("markerrel!", 5, 0, 0, gupl_markerrel_x);
      scm_c_define_gsubr ("miterlimit!", 2, 0, 0, gupl_miterlimit_x);
      scm_c_define_gsubr ("move!", 3, 0, 0, gupl_move_x);
      scm_c_define_gsubr ("moverel!", 3, 0, 0, gupl_moverel_x);
      scm_c_define_gsubr ("openpl!", 1, 0, 0, gupl_openpl_x);
      scm_c_define_gsubr ("orientation!", 2, 0, 0, gupl_orientation_x);
      scm_c_define_gsubr ("pencolor!", 4, 0, 0, gupl_pencolor_x);
      scm_c_define_gsubr ("pencolorname!", 2, 0, 0, gupl_pencolorname_x);
      scm_c_define_gsubr ("pentype!", 2, 0, 0, gupl_pentype_x);
      scm_c_define_gsubr ("point!", 3, 0, 0, gupl_point_x);
      scm_c_define_gsubr ("pointrel!", 3, 0, 0, gupl_pointrel_x);
      scm_c_define_gsubr ("restorestate!", 1, 0, 0, gupl_restorestate_x);
      scm_c_define_gsubr ("rotate!", 2, 0, 0, gupl_rotate_x);
      scm_c_define_gsubr ("savestate!", 1, 0, 0, gupl_savestate_x);
      scm_c_define_gsubr ("scale!", 3, 0, 0, gupl_scale_x);
      scm_c_define_gsubr ("setmatrix!", 7, 0, 0, gupl_setmatrix_x);
      scm_c_define_gsubr ("setplparam!", 3, 0, 0, gupl_setplparam_x);
      scm_c_define_gsubr ("space!", 5, 0, 0, gupl_space_x);
      scm_c_define_gsubr ("space2!", 7, 0, 0, gupl_space2_x);
      scm_c_define_gsubr ("textangle!", 2, 0, 0, gupl_textangle_x);
      scm_c_define_gsubr ("translate!", 3, 0, 0, gupl_translate_x);

      first = 0;
    }
}