[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: gmk_sym.c
User: cnieves
Date: 06/09/27 13:31:03
Modified: . gmk_sym.c
Log:
Applied patch #1564796 by Cesar Strauss, enabling Cygwin's compilation. Thanks.
Also in utils/src/gmk_sym.c, use strcasecmp instead of stricmp, and define
strcasecmp as stricmp if the first is not available but the latter is.
Revision Changes Path
1.22 +27 -37 eda/geda/gaf/utils/src/gmk_sym.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: gmk_sym.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/utils/src/gmk_sym.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- gmk_sym.c 27 Sep 2005 22:46:55 -0000 1.21
+++ gmk_sym.c 27 Sep 2006 17:31:03 -0000 1.22
@@ -150,8 +150,11 @@
static char *strLabel(char *p, char *pTemp);
void strtrail(char *wrk);
int line_chk(char *pBuf);
-#ifndef __MINGW32__
-int stricmp(char *s, char *p);
+#if !defined(HAVE_STRCASECMP) && defined(HAVE_STRICMP) && !defined(stricmp)
+#define strcasecmp stricmp
+#endif
+#if !defined(HAVE_STRNCASECMP) && defined(HAVE_STRNICMP) && !defined(strnicmp)
+#define strncasecmp strnicmp
#endif
int pin_len=300;
@@ -470,32 +473,32 @@
{
name_size = GetStringDisplayLength(name,font_size);
/* Vaild positions: tl,tc,tr, bl,bc,br cc */
- if (!stricmp(name_pos,"tl"))
+ if (!strcasecmp(name_pos,"tl"))
{
pos_x = pin_0_x;
pos_y = pin_0_y+50;
}
- else if (!stricmp(name_pos,"tc"))
+ else if (!strcasecmp(name_pos,"tc"))
{
pos_x = pin_0_x+BoxWidth/2-name_size/2;
pos_y = pin_0_y+50;
}
- else if (!stricmp(name_pos,"tr"))
+ else if (!strcasecmp(name_pos,"tr"))
{
pos_x = pin_0_x+BoxWidth-name_size/2;
pos_y = pin_0_y+50;
}
- else if (!stricmp(name_pos,"bl"))
+ else if (!strcasecmp(name_pos,"bl"))
{
pos_x = pin_0_x;
pos_y = pin_0_y-BoxHeight-175;
}
- else if (!stricmp(name_pos,"bc"))
+ else if (!strcasecmp(name_pos,"bc"))
{
pos_x = pin_0_x+BoxWidth/2-name_size/2;
pos_y = pin_0_y-BoxHeight-175;
}
- else if (!stricmp(name_pos,"br"))
+ else if (!strcasecmp(name_pos,"br"))
{
pos_x = pin_0_x+BoxWidth-(name_size)/2;
pos_y = pin_0_y-BoxHeight-175;
@@ -544,17 +547,17 @@
strncpy(pin_used[pin_counter++],pin,5); /* save the current pin, the first 5 char */
shape = LINE_SHAPE;
- if (!stricmp(pFields[2],"dot")) /* get shape */
+ if (!strcasecmp(pFields[2],"dot")) /* get shape */
shape = DOT_SHAPE;
- if (!stricmp(pFields[2],"clock")) /* get shape */
+ if (!strcasecmp(pFields[2],"clock")) /* get shape */
shape = CLOCK_SHAPE;
- if (!stricmp(pFields[3],"L")) side = L_SIDE;
+ if (!strcasecmp(pFields[3],"L")) side = L_SIDE;
else
- if (!stricmp(pFields[3],"R")) side = R_SIDE;
+ if (!strcasecmp(pFields[3],"R")) side = R_SIDE;
else
- if (!stricmp(pFields[3],"B")) side = B_SIDE;
+ if (!strcasecmp(pFields[3],"B")) side = B_SIDE;
else
- if (!stricmp(pFields[3],"T")) side = T_SIDE;
+ if (!strcasecmp(pFields[3],"T")) side = T_SIDE;
else {
fprintf (stderr,"\nError, %s not a valid position, should be l,t,b or r.\n",pFields[3]);
return -1;
@@ -565,25 +568,25 @@
type = NULL;
if (pFields[5])
{
- if (!stricmp(pFields[5],"in"))
+ if (!strcasecmp(pFields[5],"in"))
type = PINTYPE_IN;
- else if ( !stricmp(pFields[5],"out"))
+ else if ( !strcasecmp(pFields[5],"out"))
type = PINTYPE_OUT;
- else if ( !stricmp(pFields[5],"io"))
+ else if ( !strcasecmp(pFields[5],"io"))
type = PINTYPE_IO;
- else if ( !stricmp(pFields[5],"oc"))
+ else if ( !strcasecmp(pFields[5],"oc"))
type = PINTYPE_OC;
- else if ( !stricmp(pFields[5],"oe"))
+ else if ( !strcasecmp(pFields[5],"oe"))
type = PINTYPE_OE;
- else if ( !stricmp(pFields[5],"pas"))
+ else if ( !strcasecmp(pFields[5],"pas"))
type = PINTYPE_PAS;
- else if ( !stricmp(pFields[5],"tp"))
+ else if ( !strcasecmp(pFields[5],"tp"))
type = PINTYPE_TP;
- else if ( !stricmp(pFields[5],"tri"))
+ else if ( !strcasecmp(pFields[5],"tri"))
type = PINTYPE_TRI;
- else if ( !stricmp(pFields[5],"clk"))
+ else if ( !strcasecmp(pFields[5],"clk"))
type = PINTYPE_CLK;
- else if ( !stricmp(pFields[5],"pwr"))
+ else if ( !strcasecmp(pFields[5],"pwr"))
type = PINTYPE_PWR;
else
fprintf( stderr, "WARNING: Invalid pin type attribute for pin %s: %s\n", pin_name, pFields[5] );
@@ -673,17 +676,4 @@
return 0;
}
-/************************************************/
-/* Compare two string without regard for case */
-/************************************************/
-#ifndef __MINGW32__
-int stricmp(char *s, char *p)
-{
- for (; toupper(*s) == toupper(*p); s++, p++)
- if (!(*s))
- return 0;
- return toupper(*s) - toupper(*p);
-}
-#endif
-
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs