コード例 #1
0
ファイル: main.c プロジェクト: leque/Gauche
void feature_options(const char *optarg)
{
    if (optarg[0] == '-') {
        Scm_DisableFeature(optarg+1);
    } else {
        Scm_AddFeature(optarg, NULL);
    }
}
コード例 #2
0
ファイル: fcntl.c プロジェクト: Z-Shang/Gauche
SCM_EXTENSION_ENTRY void Scm_Init_gauche__fcntl(void)
{
    SCM_INIT_EXTENSION(gauche__fcntl);
    ScmModule *mod = SCM_FIND_MODULE("gauche.fcntl", SCM_FIND_MODULE_CREATE);
    Scm_InitStaticClass(&Scm_SysFlockClass, "<sys-flock>",
                        mod, flock_slots, 0);
    Scm_Init_fcntlib(mod);

#ifndef GAUCHE_WINDOWS
    Scm_AddFeature("gauche.sys.fcntl", NULL);
#endif
}
コード例 #3
0
ファイル: main.c プロジェクト: leque/Gauche
/* Path setup.  When we're ran with -ftest flag, add paths to refer
   to the files in the source tree.  This is called after option processing
   and before loading init file. */
void test_paths_setup(void)
{
    /* The order of directories is important.  'lib' should
       be searched first (hence it should come latter), since some
       extension modules are built from the file in src then linked
       from lib, and we want to test the one in lib. */
    if (access("../src/gauche/config.h", R_OK) == 0
        && access("../libsrc/srfi-1.scm", R_OK) == 0
        && access("../lib/srfi-0.scm", R_OK) == 0) {
        Scm_AddLoadPath("../src", FALSE);
        Scm_AddLoadPath("../libsrc", FALSE);
        Scm_AddLoadPath("../lib", FALSE);
    } else if (access("../../src/gauche/config.h", R_OK) == 0
               && access("../../libsrc/srfi-1.scm", R_OK) == 0
               && access("../../lib/srfi-0.scm", R_OK) == 0) {
        Scm_AddLoadPath("../../src", FALSE);
        Scm_AddLoadPath("../../libsrc", FALSE);
        Scm_AddLoadPath("../../lib", FALSE);
    }
    /* Also set a feature identifier gauche.in-place, so that other modules
       may initialize differently if needed. */
    Scm_AddFeature("gauche.in-place", NULL);
}
コード例 #4
0
ファイル: graphics_gd.c プロジェクト: tabe/Gauche-gd
ScmObj
Scm_Init_graphics_gd(void)
{
  const char *module_name = "graphics.gd";
  ScmModule *mod;

  SCM_INIT_EXTENSION(graphics_gd);

  mod = SCM_MODULE(SCM_FIND_MODULE(module_name, TRUE));

  GraphicsGdImageClass =
	Scm_MakeForeignPointerClass(mod, "<gd-image>",
								NULL, graphicsGdImageCleanUp, SCM_FOREIGN_POINTER_KEEP_IDENTITY|SCM_FOREIGN_POINTER_MAP_NULL);
  GraphicsGdFontClass =
	Scm_MakeForeignPointerClass(mod, "<gd-font>",
								NULL, graphicsGdFontCleanUp, SCM_FOREIGN_POINTER_KEEP_IDENTITY|SCM_FOREIGN_POINTER_MAP_NULL);

  sym_destroyed = SCM_INTERN("destroyed?");

  Scm_Init_graphics_gdlib(mod);

  /* the following feature identifiers are available *after* loading. */
#ifdef GD_XPM
  Scm_AddFeature("gauche.ext.graphics.gd.xpm", module_name);
#endif /* GD_XPM */
#ifdef GD_PNG
  Scm_AddFeature("gauche.ext.graphics.gd.png", module_name);
#endif /* GD_PNG */
#ifdef GD_JPEG
  Scm_AddFeature("gauche.ext.graphics.gd.jpeg", module_name);
#endif /* GD_JPEG */
#ifdef GD_GIF
  Scm_AddFeature("gauche.ext.graphics.gd.gif", module_name);
#endif /* GD_GIF */
#ifdef GD_FREETYPE
  Scm_AddFeature("gauche.ext.graphics.gd.freetype", module_name);
#endif /* GD_FREETYPE */
#ifdef GD_FONTCONFIG
  Scm_AddFeature("gauche.ext.graphics.gd.fontconfig", module_name);
#endif /* GD_FONTCONFIG */
}
コード例 #5
0
ファイル: main.c プロジェクト: h2oota/Gauche
void feature_options(const char *optarg)
{
    Scm_AddFeature(optarg, NULL);
}