libgeda

scheme_os.c

Go to the documentation of this file.
00001 /* gEDA - GPL Electronic Design Automation
00002  * libgeda - gEDA's library
00003  * Copyright (C) 1998-2010 gEDA Contributors (see ChangeLog for details)
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
00018  */
00019 
00025 #include <config.h>
00026 
00027 #include <libgeda_priv.h>
00028 #include <libgedaguile_priv.h>
00029 
00030 SCM_SYMBOL (carbon_sym , "carbon");
00031 SCM_SYMBOL (cygwin_sym , "cygwin");
00032 SCM_SYMBOL (linux_sym , "linux");
00033 SCM_SYMBOL (win32_sym , "win32");
00034 SCM_SYMBOL (win32_native_sym , "win32-native");
00035 
00049 SCM_DEFINE (platform, "%platform", 0, 0, 0, (),
00050             "Return a list of symbols describing the host platform.")
00051 {
00052   SCM result = SCM_EOL;
00053 
00054 # if defined (OS_CARBON)
00055   result = scm_cons (carbon_sym, result);
00056 # endif
00057 # if defined (OS_CYGWIN)
00058   result = scm_cons (cygwin_sym, result);
00059 # endif
00060 # if defined (OS_LINUX)
00061   result = scm_cons (linux_sym, result);
00062 # endif
00063 # if defined (OS_WIN32)
00064   result = scm_cons (win32_sym, result);
00065 # endif
00066 # if defined (OS_WIN32_NATIVE)
00067   result = scm_cons (win32_native_sym, result);
00068 # endif
00069 
00070   return result;
00071 }
00072 
00079 static void
00080 init_module_geda_core_os ()
00081 {
00082   /* Register the functions and symbols */
00083   #include "scheme_os.x"
00084 
00085   /* Add them to the module's public definitions. */
00086   scm_c_export (s_platform,
00087                 NULL);
00088 }
00089 
00097 void
00098 edascm_init_os ()
00099 {
00100   /* Define the (geda core os) module */
00101   scm_c_define_module ("geda core os",
00102                        init_module_geda_core_os,
00103                        NULL);
00104 }
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines