コード例 #1
0
ファイル: scheme_smob.c プロジェクト: SayCV/geda-gaf
/*! \brief Get a configuration context from a smob.
 * \ingroup guile_c_iface
 * \par Function Description
 * Return the #EdaConfig represented by \a smob.
 *
 * \param [in] smob Guile value to retrieve #EdaConfig from.
 * \return the #EdaConfig represented by \a smob.
 *
 * \since 1.10.
 */
EdaConfig *
edascm_to_config (SCM smob)
{
#ifndef NDEBUG
  SCM_ASSERT (EDASCM_CONFIGP (smob), smob,
              SCM_ARG1, "edascm_to_object");
#endif
  EDASCM_ASSERT_SMOB_VALID (smob);

  return EDA_CONFIG (SCM_SMOB_DATA (smob));
}
コード例 #2
0
ファイル: scheme_smob.c プロジェクト: gareth8118/geda-gaf
/*! \brief Get a smob for a configuration context.
 * \ingroup guile_c_iface
 * \par Function Description
 * Create a new smob representing \a cfg.
 *
 * \param cfg Configuration context to create a smob for.
 * \return a smob representing \a cfg.
 */
SCM
edascm_from_config (EdaConfig *cfg)
{
  SCM smob = smob_cache_lookup (cfg);

  if (EDASCM_CONFIGP (smob)) {
    return smob;
  }

  SCM_NEWSMOB (smob, geda_smob_tag, g_object_ref (cfg));
  SCM_SET_SMOB_FLAGS (smob, GEDA_SMOB_CONFIG);
  return smob;
}
コード例 #3
0
ファイル: scheme_smob.c プロジェクト: SayCV/geda-gaf
/*! \brief Test whether a smob is an #EdaConfig instance.
 * \ingroup guile_c_iface
 * \par Function Description
 * If \a smob is a configuration context, returns non-zero. Otherwise,
 * returns zero.
 *
 * \param [in] smob Guile value to test.
 * \return non-zero iff \a smob is an #EdaConfig instance.
 *
 * \since 1.10.
 */
int
edascm_is_config (SCM smob)
{
  return EDASCM_CONFIGP (smob);
}