[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: Makefile.am



  User: ahvezda 
  Date: 07/01/08 23:47:11

  Modified:    .        Makefile.am globals.c gschlas.c parsecmd.c
  Added:       .        s_util.c
  Log:
  Added "embed/unembed all components/schematics" functionality to gschlas
  
  
  
  
  Revision  Changes    Path
  1.3       +1 -1      eda/geda/gaf/utils/gschlas/Makefile.am
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Makefile.am
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/utils/gschlas/Makefile.am,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- Makefile.am	25 Aug 2003 03:53:04 -0000	1.2
  +++ Makefile.am	9 Jan 2007 04:47:11 -0000	1.3
  @@ -5,7 +5,7 @@
   # don't forget all *.h files */
   gschlas_SOURCES = \
   		i_vars.c g_rc.c g_register.c globals.c \
  -		gschlas.c parsecmd.c 
  +		gschlas.c s_util.c parsecmd.c 
   
   
   INCLUDES = @GSCHLAS_CFLAGS@ 
  
  
  
  1.7       +3 -0      eda/geda/gaf/utils/gschlas/globals.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: globals.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/utils/gschlas/globals.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- globals.c	27 Nov 2005 00:15:12 -0000	1.6
  +++ globals.c	9 Jan 2007 04:47:11 -0000	1.7
  @@ -77,5 +77,8 @@
   int verbose_mode=FALSE;
   int interactive_mode=FALSE;
   int quiet_mode=FALSE;
  +int embed_mode=FALSE; 
  +int unembed_mode=FALSE;
  +
   
   
  
  
  
  1.18      +8 -0      eda/geda/gaf/utils/gschlas/gschlas.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: gschlas.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/utils/gschlas/gschlas.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -b -r1.17 -r1.18
  --- gschlas.c	7 Sep 2006 02:41:29 -0000	1.17
  +++ gschlas.c	9 Jan 2007 04:47:11 -0000	1.18
  @@ -155,6 +155,14 @@
     
     if (!quiet_mode) s_log_message("\n");
   
  +  if (embed_mode) {
  +    s_util_embed(pr_current, TRUE);
  +  }
  +
  +  if (unembed_mode) {
  +    s_util_embed(pr_current, FALSE);
  +  }	
  +
     /* save all the opened files */
     s_page_save_all(pr_current);
   
  
  
  
  1.3       +18 -1     eda/geda/gaf/utils/gschlas/parsecmd.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: parsecmd.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/utils/gschlas/parsecmd.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- parsecmd.c	7 Feb 2005 23:57:14 -0000	1.2
  +++ parsecmd.c	9 Jan 2007 04:47:11 -0000	1.3
  @@ -36,7 +36,7 @@
   #include <dmalloc.h>
   #endif
   
  -#define OPTIONS "hqv"
  +#define OPTIONS "hqveu"
   
   #ifndef OPTARG_IN_UNISTD
   extern char *optarg;
  @@ -47,6 +47,8 @@
   void usage(char *cmd)
   {
       printf("Usage: %s [OPTIONS] filename1 ... filenameN\n", cmd);
  +    printf("  -e  		Embed all components/pictures\n");
  +    printf("  -u  		Unembed all components/pictures\n");
       printf("  -q  		Quiet mode\n");
       printf("  -v  		Verbose mode on\n");
       printf("  -h  		This message\n");
  @@ -69,6 +71,14 @@
   	    quiet_mode = TRUE;
   	    break;
   
  +	case 'e':
  +	    embed_mode = TRUE;
  +	    break;
  +
  +	case 'u':
  +	    unembed_mode = TRUE;
  +	    break;
  +
   	case 'h':
   	    usage(argv[0]);
   	    break;
  @@ -84,5 +94,12 @@
   	verbose_mode = FALSE;
       }
   
  +    if (embed_mode && unembed_mode) {
  +	fprintf(stderr, 
  +	        "Cannot specify both -e and -u at the same time (ignoring both flags)\n");	
  +	embed_mode = FALSE;
  +	unembed_mode = FALSE;
  +    }
  +
       return (optind);
   }
  
  
  
  1.1                  eda/geda/gaf/utils/gschlas/s_util.c
  
  Index: s_util.c
  ===================================================================
  /* gEDA - GPL Electronic Design Automation
   * gschlas - gEDA Load and Save
   * Copyright (C) 2002-2007 Ales V. Hvezda
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation; either version 2 of the License, or
   * (at your option) any later version.
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   *
   * You should have received a copy of the GNU General Public License
   * along with this program; if not, write to the Free Software
   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   */
  
  #include <config.h>
  
  #include <stdio.h>
  #include <sys/stat.h>
  #ifdef HAVE_STDLIB_H
  #include <stdlib.h>
  #endif
  #ifdef HAVE_ASSERT_H
  #include <assert.h>
  #endif
  #ifdef HAVE_UNISTD_H
  #include <unistd.h> 
  #endif
  
  #include <libgeda/libgeda.h>
  
  #include "../include/prototype.h"
  
  #ifdef HAVE_LIBDMALLOC
  #include <dmalloc.h>
  #endif
  
  /* If embed_mode is true, then embed all components in all pages, */
  /* otherwise unembed all components in all pages */
  void
  s_util_embed(TOPLEVEL *pr_current, int embed_mode)
  {
      PAGE *p_current;
      OBJECT *o_current;
  
      p_current = pr_current->page_head;
  
      while (p_current != NULL) {
  
        o_current = p_current->object_head;
  
        if (p_current->pid != -1) {
  
          while (o_current != NULL) {
  
   	  if (o_current->type == OBJ_COMPLEX || 
                o_current->type == OBJ_PICTURE) {
  	    if (embed_mode == TRUE) {
  		o_embed(pr_current, o_current);
  	    } else {
  		o_unembed(pr_current, o_current);
              }
  	  }
  
  	  o_current = o_current->next;
  	}
        }
  
        p_current = p_current->next;
      }
  }
  
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs