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

gEDA-cvs: CVS update: s_clib.c



  User: peterb  
  Date: 07/05/28 03:59:41

  Modified:    .        s_clib.c
  Log:
  Match .sym suffix case-insensively when building component library.
  
  
  
  When building symbol lists for directory-based component sources,
  
  match the ".sym" filename suffix case-insensitively.  Note that for
  
  backward- compatibility (and sanity on systems with case-sensitive
  
  filenames) searching for symbols does match symbols
  
  case-sensitively ("plug.SYM" will not satisfy a search for
  
  "plug.sym").
  
  
  
  
  Revision  Changes    Path
  1.25                 eda/geda/gaf/libgeda/src/s_clib.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: s_clib.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_clib.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -b -r1.24 -r1.25
  --- s_clib.c	28 May 2007 07:56:47 -0000	1.24
  +++ s_clib.c	28 May 2007 07:59:41 -0000	1.25
  @@ -39,7 +39,7 @@
    * 
    *  A directory which contains one or more symbol files in gEDA
    *  format may be used as a component source. Each symbol file should
  - *  have a filename ending in ".sym" (case sensitive).  A
  + *  have a filename ending in ".sym" (case insensitive).  A
    *  component source based on a directory can be added using
    *  s_clib_add_directory().  Symbol files with filenames starting with
    *  a period "." are ignored.
  @@ -70,9 +70,6 @@
    *  \todo
    *    -# Categorisation of symbols.
    *
  - *    -# Case-insensitive matching of symbol file extensions (both ".sym"
  - *       and ".SYM" should match).
  - *
    *  \page libcmds Library Commands
    *
    *  A library command should implement this specification.  Note that
  @@ -143,7 +140,8 @@
    * ===================
    */
   
  -/*! All symbols in directory sources end with this string */
  +/*! All symbols in directory sources end with this string. Must be
  + *  lowercase. */
   #define SYM_FILENAME_FILTER ".sym"
   
   /*! Library command mode used to fetch list of symbols */
  @@ -458,6 +456,7 @@
     CLibSymbol *symbol;
     GDir *dir;
     const gchar *entry;
  +  gchar *low_entry;
     gchar *fullpath;
     gboolean isfile;
     GError *e = NULL;
  @@ -490,12 +489,17 @@
       g_free (fullpath);
       if (!isfile) continue;
   
  -    /* skip filenames that don't match the filter or that we already
  -     * know about. */
  -    if (!g_str_has_suffix (entry, SYM_FILENAME_FILTER)
  -	|| (source_has_symbol (source, entry) != NULL)) {
  +    /* skip filenames that we already know about. */
  +    if (source_has_symbol (source, entry) != NULL) continue;
  +    
  +    /* skip filenames which don't have the right suffix. */
  +    low_entry = g_strdup(entry);
  +    string_tolower (low_entry, low_entry);
  +    if (!g_str_has_suffix (low_entry, SYM_FILENAME_FILTER)) {
  +      g_free (low_entry);
         continue;
       }
  +    g_free (low_entry);
   
       /* Create and add new symbol record */
       symbol = g_new0 (CLibSymbol, 1);
  
  
  


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