Subversion Repositories Vertical

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
11 mjames 1
/*
2 mjames 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.
11 mjames 40
 *
41
*/
2 mjames 42
 
43
#include <stdio.h>
11 mjames 44
#include <string.h>
2 mjames 45
#include <stdlib.h>
11 mjames 46
#include <ctype.h>
2 mjames 47
 
48
/* TCL/Tk declarations */
11 mjames 49
#include "vertcl_main.h" 
2 mjames 50
#include "expression.h"
51
#include "generic.h"
11 mjames 52
#include "database.h"
2 mjames 53
#include "lx_support.h"
11 mjames 54
#include "chck_names.h"
2 mjames 55
#include "statistics.h"
11 mjames 56
#include "cmdparse.h"
57
#include "cmdlog.h"
2 mjames 58
 
11 mjames 59
#ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/vertlib/chck_names.c,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $"
2 mjames 60
 
11 mjames 61
 
2 mjames 62
/* exported flag */
63
 
64
int need_validate_names = 0;
65
 
11 mjames 66
static void list_dodgy_net_id_names(net_t * netlist)  {
67
  while(netlist) {
68
/*
69
    printf("'%s' '%s'\n",netlist->name,netlist->identifier);
70
*/
71
    if (strchr(netlist->name,' '))
72
      Log(LOG_ERROR,"# Warning : Net name '%s' has a SPACE in it\n",
73
                      netlist->name);
74
    if (strchr(netlist->identifier,' '))
75
      Log(LOG_ERROR,"# Warning : Net identifier '%s' has a SPACE in it\n",
76
                      netlist->identifier);
77
    netlist = netlist->next;
78
    }
79
 }
2 mjames 80
 
81
 
11 mjames 82
void validate_names(void)
83
  {
84
  list_dodgy_net_id_names(unrouted_list);
85
  list_dodgy_net_id_names(routed_list);
86
  list_dodgy_net_id_names(named_list);
87
  }
88
 
2 mjames 89
/*************************************************/
90
/* check to see if a wildcard is formed 'old' or */
91
/* 'new' regexp style                            */
92
/*************************************************/
11 mjames 93
int check_wildcard(char *patt)
94
  {
95
  int l;
96
  if(ISNULLSTR(patt))
97
    {
98
    Log(LOG_ERROR,"-- problem with zero length regular expression pattern\n");
99
    return TCL_ERROR;
100
    }
101
  l = strlen(patt);
102
/*
103
  if ( patt[0] == '$' )
104
    {
105
    Log(LOG_ERROR,"-- Need to use '\$' NOT '$' at beginning of regular expression pattern '%s'\n",patt);
106
    return TCL_ERROR;
107
    }
2 mjames 108
 
11 mjames 109
*/
2 mjames 110
 
11 mjames 111
  if ( patt[l-1]=='*' && ((l==1)||(l>=2 && patt[l-2]!='.')))
112
    {
113
    Log(LOG_ERROR,"-- May Need to use '.*' NOT '*' in regular expression pattern '%s'\n",patt);
114
    }
115
   return TCL_OK;
116
 
117
  }