Subversion Repositories Vertical

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * $Id: chck_names.c,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $
  3.  *
  4.  * $Log: chck_names.c,v $
  5.  * Revision 1.1.1.1  2003/11/04 23:34:57  mjames
  6.  * Imported into local repositrory
  7.  *
  8.  * Revision 1.8  2002/01/15 12:38:53  mjames
  9.  * converted to use #ident
  10.  *
  11.  * Revision 1.7  2001/10/31 22:19:59  mjames
  12.  * Tidying up problematical comments caused by CVS
  13.  * 'intelligent' comment guessing
  14.  *
  15.  * Revision 1.6  2001/10/23 21:15:54  mjames
  16.  * Become less critical of old style wildcards. The user may be right in fact.
  17.  *
  18.  * Revision 1.5  2001/10/10 20:18:45  mjames
  19.  * Added a vert_regcomp function to compile regular expressions
  20.  * with '^' (match start string) and  '$' (match end string) bracketing
  21.  * this => wildcard must match entire string not just a part of it.
  22.  *
  23.  * Revision 1.4  2001/10/10 12:49:47  mjames
  24.  * Passed wrong argument to wildcard validator within template ensure . Fixed
  25.  *
  26.  * Revision 1.3  2001/10/07 20:50:54  mjames
  27.  * Added wildcard checking (warn user about
  28.  * using wildcard '*' on the end of a string in stead of wildcard '.*')
  29.  *
  30.  * Revision 1.2  2001/06/06 12:10:26  mjames
  31.  * Move from HPUX
  32.  *
  33.  * Revision 1.1.1.1  2000/10/19 21:58:34  mjames
  34.  * Mike put it here
  35.  *
  36.  *
  37.  * Revision 1.35  2000/10/04  10:37:02  10:37:02  mjames (Mike James)
  38.  * Modified to become part of vertical2, complete
  39.  * with VHDL COMPONENT and SIGNAL declarations.
  40.  *
  41.  */
  42.  
  43. #include <ctype.h>
  44. #include <stdio.h>
  45. #include <stdlib.h>
  46. #include <string.h>
  47.  
  48. /* TCL/Tk declarations */
  49. #include "chck_names.h"
  50. #include "cmdlog.h"
  51. #include "cmdparse.h"
  52. #include "database.h"
  53. #include "expression.h"
  54. #include "generic.h"
  55. #include "lx_support.h"
  56. #include "statistics.h"
  57. #include "vertcl_main.h"
  58.  
  59. #ident                                                                                        \
  60.     "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/vertlib/chck_names.c,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $"
  61.  
  62. /* exported flag */
  63.  
  64. int need_validate_names = 0;
  65.  
  66. static void list_dodgy_net_id_names (net_t *netlist)
  67. {
  68.         while (netlist)
  69.         {
  70.                 /*
  71.                     printf("'%s' '%s'\n",netlist->name,netlist->identifier);
  72.                 */
  73.                 if (strchr (netlist->name, ' '))
  74.                         Log (
  75.                             LOG_ERROR,
  76.                             "# Warning : Net name '%s' has a SPACE in it\n",
  77.                             netlist->name);
  78.                 if (strchr (netlist->identifier, ' '))
  79.                         Log (
  80.                             LOG_ERROR,
  81.                             "# Warning : Net identifier '%s' has a SPACE in it\n",
  82.                             netlist->identifier);
  83.                 netlist = netlist->next;
  84.         }
  85. }
  86.  
  87. void validate_names (void)
  88. {
  89.         list_dodgy_net_id_names (unrouted_list);
  90.         list_dodgy_net_id_names (routed_list);
  91.         list_dodgy_net_id_names (named_list);
  92. }
  93.  
  94. /*************************************************/
  95. /* check to see if a wildcard is formed 'old' or */
  96. /* 'new' regexp style                            */
  97. /*************************************************/
  98. int check_wildcard (char *patt)
  99. {
  100.         int l;
  101.         if (ISNULLSTR (patt))
  102.         {
  103.                 Log (LOG_ERROR, "-- problem with zero length regular expression pattern\n");
  104.                 return TCL_ERROR;
  105.         }
  106.         l = strlen (patt);
  107.         /*
  108.           if ( patt[0] == '$' )
  109.             {
  110.             Log(LOG_ERROR,"-- Need to use '\$' NOT '$' at beginning of regular expression
  111.           pattern '%s'\n",patt); return TCL_ERROR;
  112.             }
  113.  
  114.         */
  115.  
  116.         if (patt[l - 1] == '*' && ((l == 1) || (l >= 2 && patt[l - 2] != '.')))
  117.         {
  118.                 Log (
  119.                     LOG_ERROR,
  120.                     "-- May Need to use '.*' NOT '*' in regular expression pattern '%s'\n",
  121.                     patt);
  122.         }
  123.         return TCL_OK;
  124. }
  125.