summaryrefslogtreecommitdiffstats
path: root/src/misc
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-03-27 12:43:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-03-27 12:43:00 -0700
commite64cad10e2f9417247cb7f212d9bc434902bd154 (patch)
tree0469f7f1197a87b7d16e7d1222ad6f5f2921a703 /src/misc
parent4c0082990051610f28397067027406ff961ab91f (diff)
downloadabc-e64cad10e2f9417247cb7f212d9bc434902bd154.tar.gz
abc-e64cad10e2f9417247cb7f212d9bc434902bd154.tar.bz2
abc-e64cad10e2f9417247cb7f212d9bc434902bd154.zip
Adding command &miter2 to derive a specified sequential miter.
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/extra/extra.h1
-rw-r--r--src/misc/extra/extraUtilFile.c26
2 files changed, 27 insertions, 0 deletions
diff --git a/src/misc/extra/extra.h b/src/misc/extra/extra.h
index 78a0fa99..c3c9a93d 100644
--- a/src/misc/extra/extra.h
+++ b/src/misc/extra/extra.h
@@ -112,6 +112,7 @@ extern char * Extra_FileReadContents2( char * pFileName, char * pFileName2
extern int Extra_FileIsType( char * pFileName, char * pS1, char * pS2, char * pS3 );
extern char * Extra_TimeStamp();
extern char * Extra_StringAppend( char * pStrGiven, char * pStrAdd );
+extern void Extra_StringClean( char * pStrGiven, char * pCharKeep );
extern unsigned Extra_ReadBinary( char * Buffer );
extern void Extra_PrintBinary( FILE * pFile, unsigned Sign[], int nBits );
extern int Extra_ReadHex( unsigned Sign[], char * pString, int nDigits );
diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c
index cab36e29..2e1d60f4 100644
--- a/src/misc/extra/extraUtilFile.c
+++ b/src/misc/extra/extraUtilFile.c
@@ -630,6 +630,32 @@ char * Extra_StringAppend( char * pStrGiven, char * pStrAdd )
/**Function*************************************************************
+ Synopsis [Only keep characters belonging to the second string.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Extra_StringClean( char * pStrGiven, char * pCharKeep )
+{
+ char * pTemp, * pChar, * pSave = pStrGiven;
+ for ( pTemp = pStrGiven; *pTemp; pTemp++ )
+ {
+ for ( pChar = pCharKeep; *pChar; pChar++ )
+ if ( *pTemp == *pChar )
+ break;
+ if ( *pChar == 0 )
+ continue;
+ *pSave++ = *pTemp;
+ }
+ *pSave = 0;
+}
+
+/**Function*************************************************************
+
Synopsis [String comparison procedure.]
Description []