utils

g_rc.c

Go to the documentation of this file.
00001 /* gEDA - GPL Electronic Design Automation
00002  * gschlas - gEDA Load and Save
00003  * Copyright (C) 2002-2010 Ales Hvezda
00004  * Copyright (C) 2002-2010 gEDA Contributors (see ChangeLog for details)
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00019  * MA 02111-1301 USA.
00020  */
00021 
00022 #include <config.h>
00023 #include <missing.h>
00024 #include <version.h>
00025 
00026 #include <stdio.h>
00027 #include <ctype.h>
00028 #include <sys/stat.h>
00029 #ifdef HAVE_STRING_H
00030 #include <string.h>
00031 #endif
00032 #ifdef HAVE_STDLIB_H
00033 #include <stdlib.h>
00034 #endif
00035 #ifdef HAVE_UNISTD_H
00036 #include <unistd.h>
00037 #endif
00038 
00039 #include <libgeda/libgeda.h>
00040 
00041 #include "../include/globals.h"
00042 #include "../include/i_vars.h"
00043 #include "../include/prototype.h"
00044 
00045 #ifdef HAVE_LIBDMALLOC
00046 #include <dmalloc.h>
00047 #endif
00048 
00049 SCM g_rc_gschlas_version(SCM scm_version)
00050 {
00051     char *version;
00052     SCM ret = SCM_BOOL_T;
00053 
00054     SCM_ASSERT (scm_is_string (scm_version), scm_version,
00055         SCM_ARG1, "gschlas-version");
00056 
00057     version = scm_to_utf8_string (scm_version);
00058     if (g_strcasecmp (version, PACKAGE_DATE_VERSION) != 0) {
00059       fprintf(stderr,
00060               "You are running gEDA/gaf version [%s%s.%s],\n",
00061               PREPEND_VERSION_STRING, PACKAGE_DOTTED_VERSION,
00062               PACKAGE_DATE_VERSION);
00063       fprintf(stderr,
00064               "but you have a version [%s] gschlasrc file:\n[%s]\n",
00065               version, rc_filename);
00066       fprintf(stderr,
00067               "Please be sure that you have the latest rc file.\n");
00068       ret = SCM_BOOL_F;
00069     }
00070 
00071     free (version);
00072     return ret;
00073 }
00074 
00075 
00076 SCM 
00077 g_rc_force_boundingbox(SCM mode)
00078 {
00079   static const vstbl_entry mode_table[] = {
00080     {TRUE, "enabled"},
00081     {FALSE, "disabled"}
00082                 };
00083 
00084   RETURN_G_RC_MODE("force-boundingbox", default_force_boundingbox, 2);
00085 }
00086 
00087 
00088 /*************************** GUILE end done *********************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines