Пример #1
0
static SCM
scscm_call_3_body (void *argsp)
{
  SCM *args = argsp;

  return scm_call_3 (args[0], args[1], args[2], args[3]);
}
Пример #2
0
static AvahiWatch *
watch_new (const AvahiPoll *api, int fd, AvahiWatchEvent events,
	   AvahiWatchCallback callback, void *userdata)
{
  AvahiWatch *watch;
  AvahiGuilePoll *guile_poll;

  guile_poll = (AvahiGuilePoll *) api->userdata;

  watch = scm_malloc (sizeof (*watch));
  watch->fd = fd;
  watch->dead = 0;
  watch->events = events;
  watch->callback = callback;
  watch->userdata = userdata;
  watch->guile_poll = guile_poll;
  watch->stuff = SCM_BOOL_F;

  watch->watch_smob = scm_from_avahi_watch (watch);
  watch->watch_smob = scm_gc_protect_object (watch->watch_smob);

  (void) scm_call_3 (guile_poll->new_watch, watch->watch_smob,
		     scm_from_int (fd),
		     scm_from_avahi_watch_events (events));

  return (watch);
}
Пример #3
0
static AvahiTimeout *
timeout_new (const AvahiPoll *api, const struct timeval *tv,
	     AvahiTimeoutCallback callback, void *userdata)
{
  SCM sec, nsec;
  AvahiTimeout *timeout;
  AvahiGuilePoll *guile_poll;

  guile_poll = (AvahiGuilePoll *) api->userdata;

  timeout = scm_malloc (sizeof (*timeout));
  timeout->dead = 0;
  timeout->enabled = (tv != NULL);
  timeout->callback = callback;
  timeout->userdata = userdata;
  timeout->guile_poll = guile_poll;
  timeout->stuff = SCM_BOOL_F;

  timeout->timeout_smob = scm_from_avahi_timeout (timeout);
  timeout->timeout_smob = scm_gc_protect_object (timeout->timeout_smob);

  if (tv != NULL)
    {
      timeout->expiry = *tv;
      sec = scm_from_long (tv->tv_sec);
      nsec = scm_from_long (tv->tv_usec * 1000L);
    }
  else
    sec = nsec = SCM_BOOL_F;

  (void) scm_call_3 (guile_poll->new_timeout,
		     timeout->timeout_smob, sec, nsec);

  return (timeout);
}
Пример #4
0
SCM
scm_get_keyword (SCM kw, SCM initargs, SCM default_value)
{
  scm_c_issue_deprecation_warning
    ("scm_get_keyword is deprecated.  Use `kw-arg-ref' from Scheme instead.");

  return scm_call_3 (scm_variable_ref (var_get_keyword),
                     kw, initargs, default_value);
}
Пример #5
0
static void
timeout_update (AvahiTimeout *timeout, const struct timeval *tv)
{
  SCM sec, nsec;

  if (tv)
    {
      sec = scm_from_long (tv->tv_sec);
      nsec = scm_from_long (tv->tv_usec * 1000L);
    }
  else
    sec = nsec = SCM_BOOL_F;

  (void) scm_call_3 (timeout->guile_poll->update_timeout_x,
		     timeout->timeout_smob, sec, nsec);

  if (tv)
    timeout->enabled = 1, timeout->expiry = *tv;
  else
    timeout->enabled = 0;
}
Пример #6
0
/********************************************************************\
 * gnc_copy_split_scm_onto_split                                    *
 *   copies a scheme representation of a split onto an actual split.*
 *                                                                  *
 * Args: split_scm - the scheme representation of a split           *
 *       split     - the split to copy onto                         *
 * Returns: Nothing                                                 *
\********************************************************************/
void
gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
                              QofBook * book)
{
    static swig_type_info *split_type = NULL;
    SCM result;
    SCM func;
    SCM arg;

    if (split_scm == SCM_UNDEFINED)
        return;

    if (split == NULL)
        return;

    g_return_if_fail (book);

    func = scm_c_eval_string("gnc:split-scm?");
    if (!scm_is_procedure(func))
        return;

    result = scm_call_1(func, split_scm);
    if (!scm_is_true(result))
        return;

    func = scm_c_eval_string("gnc:split-scm-onto-split");
    if (!scm_is_procedure(func))
        return;

    if (!split_type)
        split_type = SWIG_TypeQuery("_p_Split");

    arg = SWIG_NewPointerObj(split, split_type, 0);

    scm_call_3(func, split_scm, arg, gnc_book_to_scm (book));
}
void
SCMFunctor::operator()(SCM arg1, SCM arg2, SCM arg3)
{
  scm_call_3(func, arg1, arg2, arg3);
}