gattrib

g_rc.c

Go to the documentation of this file.
00001 /* gEDA - GPL Electronic Design Automation
00002  * gattrib -- gEDA component and net attribute manipulation using spreadsheet.
00003  * Copyright (C) 2003-2010 Stuart D. Brorson.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00018  */
00027 #include <config.h>
00028 #include <missing.h>
00029 #include <version.h>
00030 
00031 #include <stdio.h>
00032 #include <sys/stat.h>
00033 #include <ctype.h>
00034 #ifdef HAVE_STRING_H
00035 #include <string.h>
00036 #endif
00037 #ifdef HAVE_STDLIB_H
00038 #include <stdlib.h>
00039 #endif
00040 #ifdef HAVE_UNISTD_H
00041 #include <unistd.h>
00042 #endif
00043 
00044 /*------------------------------------------------------------------
00045  * Gattrib specific includes
00046  *------------------------------------------------------------------*/
00047 #include <libgeda/libgeda.h>       /* geda library fcns  */
00048 #include "../include/struct.h"     /* typdef and struct declarations */
00049 #include "../include/prototype.h"  /* function prototypes */
00050 #include "../include/globals.h"
00051 #include "../include/i_vars.h"     /* This holds all the guile variable defs */
00052 
00053 
00054 #ifdef HAVE_LIBDMALLOC
00055 #include <dmalloc.h>
00056 #endif
00057 
00058 /*------------------------------------------------------------------*/
00064 SCM g_rc_gattrib_version(SCM scm_version)
00065 {
00066   char *version;
00067   SCM ret = SCM_BOOL_T;
00068 
00069   SCM_ASSERT (scm_is_string (scm_version), scm_version,
00070           SCM_ARG1, "gattrib-version");
00071 
00072   version = scm_to_utf8_string (scm_version);
00073   if (g_strcasecmp (version, PACKAGE_DATE_VERSION) != 0) {
00074     fprintf(stderr,
00075             "You are running gEDA/gaf version [%s%s.%s],\n",
00076             PREPEND_VERSION_STRING, PACKAGE_DOTTED_VERSION,
00077             PACKAGE_DATE_VERSION);
00078     fprintf(stderr,
00079             "but you have a version [%s] gattribrc file.\n",
00080             version);
00081     fprintf(stderr,
00082             "Please be sure that you have the latest rc file.\n");
00083     ret = SCM_BOOL_F;
00084   }
00085 
00086   free (version);
00087   return ret;
00088 }
00089 
00090 
00091 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines