abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vecStr.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [vecStr.h]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Resizable arrays.]
8 
9  Synopsis [Resizable arrays of characters.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: vecStr.h,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifndef ABC__misc__vec__vecStr_h
22 #define ABC__misc__vec__vecStr_h
23 
24 
25 ////////////////////////////////////////////////////////////////////////
26 /// INCLUDES ///
27 ////////////////////////////////////////////////////////////////////////
28 
29 #include <stdio.h>
30 
32 
33 
34 ////////////////////////////////////////////////////////////////////////
35 /// PARAMETERS ///
36 ////////////////////////////////////////////////////////////////////////
37 
38 ////////////////////////////////////////////////////////////////////////
39 /// BASIC TYPES ///
40 ////////////////////////////////////////////////////////////////////////
41 
42 typedef struct Vec_Str_t_ Vec_Str_t;
43 struct Vec_Str_t_
44 {
45  int nCap;
46  int nSize;
47  char * pArray;
48 };
49 
50 ////////////////////////////////////////////////////////////////////////
51 /// MACRO DEFINITIONS ///
52 ////////////////////////////////////////////////////////////////////////
53 
54 #define Vec_StrForEachEntry( vVec, Entry, i ) \
55  for ( i = 0; (i < Vec_StrSize(vVec)) && (((Entry) = Vec_StrEntry(vVec, i)), 1); i++ )
56 
57 ////////////////////////////////////////////////////////////////////////
58 /// FUNCTION DEFINITIONS ///
59 ////////////////////////////////////////////////////////////////////////
60 
61 /**Function*************************************************************
62 
63  Synopsis [Allocates a vector with the given capacity.]
64 
65  Description []
66 
67  SideEffects []
68 
69  SeeAlso []
70 
71 ***********************************************************************/
72 static inline Vec_Str_t * Vec_StrAlloc( int nCap )
73 {
74  Vec_Str_t * p;
75  p = ABC_ALLOC( Vec_Str_t, 1 );
76  if ( nCap > 0 && nCap < 16 )
77  nCap = 16;
78  p->nSize = 0;
79  p->nCap = nCap;
80  p->pArray = p->nCap? ABC_ALLOC( char, p->nCap ) : NULL;
81  return p;
82 }
83 
84 /**Function*************************************************************
85 
86  Synopsis [Allocates a vector with the given size and cleans it.]
87 
88  Description []
89 
90  SideEffects []
91 
92  SeeAlso []
93 
94 ***********************************************************************/
95 static inline Vec_Str_t * Vec_StrStart( int nSize )
96 {
97  Vec_Str_t * p;
98  p = Vec_StrAlloc( nSize );
99  p->nSize = nSize;
100  memset( p->pArray, 0, sizeof(char) * nSize );
101  return p;
102 }
103 
104 /**Function*************************************************************
105 
106  Synopsis [Creates the vector from an integer array of the given size.]
107 
108  Description []
109 
110  SideEffects []
111 
112  SeeAlso []
113 
114 ***********************************************************************/
115 static inline Vec_Str_t * Vec_StrAllocArray( char * pArray, int nSize )
116 {
117  Vec_Str_t * p;
118  p = ABC_ALLOC( Vec_Str_t, 1 );
119  p->nSize = nSize;
120  p->nCap = nSize;
121  p->pArray = pArray;
122  return p;
123 }
124 
125 /**Function*************************************************************
126 
127  Synopsis [Creates the vector from an integer array of the given size.]
128 
129  Description []
130 
131  SideEffects []
132 
133  SeeAlso []
134 
135 ***********************************************************************/
136 static inline Vec_Str_t * Vec_StrAllocArrayCopy( char * pArray, int nSize )
137 {
138  Vec_Str_t * p;
139  p = ABC_ALLOC( Vec_Str_t, 1 );
140  p->nSize = nSize;
141  p->nCap = nSize;
142  p->pArray = ABC_ALLOC( char, nSize );
143  memcpy( p->pArray, pArray, sizeof(char) * nSize );
144  return p;
145 }
146 
147 /**Function*************************************************************
148 
149  Synopsis [Duplicates the integer array.]
150 
151  Description []
152 
153  SideEffects []
154 
155  SeeAlso []
156 
157 ***********************************************************************/
158 static inline Vec_Str_t * Vec_StrDup( Vec_Str_t * pVec )
159 {
160  Vec_Str_t * p;
161  p = ABC_ALLOC( Vec_Str_t, 1 );
162  p->nSize = pVec->nSize;
163  p->nCap = pVec->nCap;
164  p->pArray = p->nCap? ABC_ALLOC( char, p->nCap ) : NULL;
165  memcpy( p->pArray, pVec->pArray, sizeof(char) * pVec->nSize );
166  return p;
167 }
168 
169 /**Function*************************************************************
170 
171  Synopsis [Transfers the array into another vector.]
172 
173  Description []
174 
175  SideEffects []
176 
177  SeeAlso []
178 
179 ***********************************************************************/
180 static inline Vec_Str_t * Vec_StrDupArray( Vec_Str_t * pVec )
181 {
182  Vec_Str_t * p;
183  p = ABC_ALLOC( Vec_Str_t, 1 );
184  p->nSize = pVec->nSize;
185  p->nCap = pVec->nCap;
186  p->pArray = pVec->pArray;
187  pVec->nSize = 0;
188  pVec->nCap = 0;
189  pVec->pArray = NULL;
190  return p;
191 }
192 
193 /**Function*************************************************************
194 
195  Synopsis []
196 
197  Description []
198 
199  SideEffects []
200 
201  SeeAlso []
202 
203 ***********************************************************************/
204 static inline void Vec_StrZero( Vec_Str_t * p )
205 {
206  p->pArray = NULL;
207  p->nSize = 0;
208  p->nCap = 0;
209 }
210 static inline void Vec_StrErase( Vec_Str_t * p )
211 {
212  ABC_FREE( p->pArray );
213  p->nSize = 0;
214  p->nCap = 0;
215 }
216 static inline void Vec_StrFree( Vec_Str_t * p )
217 {
218  ABC_FREE( p->pArray );
219  ABC_FREE( p );
220 }
221 
222 /**Function*************************************************************
223 
224  Synopsis []
225 
226  Description []
227 
228  SideEffects []
229 
230  SeeAlso []
231 
232 ***********************************************************************/
233 static inline void Vec_StrFreeP( Vec_Str_t ** p )
234 {
235  if ( *p == NULL )
236  return;
237  ABC_FREE( (*p)->pArray );
238  ABC_FREE( (*p) );
239 }
240 
241 /**Function*************************************************************
242 
243  Synopsis []
244 
245  Description []
246 
247  SideEffects []
248 
249  SeeAlso []
250 
251 ***********************************************************************/
252 static inline char * Vec_StrReleaseArray( Vec_Str_t * p )
253 {
254  char * pArray = p->pArray;
255  p->nCap = 0;
256  p->nSize = 0;
257  p->pArray = NULL;
258  return pArray;
259 }
260 
261 /**Function*************************************************************
262 
263  Synopsis []
264 
265  Description []
266 
267  SideEffects []
268 
269  SeeAlso []
270 
271 ***********************************************************************/
272 static inline char * Vec_StrArray( Vec_Str_t * p )
273 {
274  return p->pArray;
275 }
276 
277 /**Function*************************************************************
278 
279  Synopsis []
280 
281  Description []
282 
283  SideEffects []
284 
285  SeeAlso []
286 
287 ***********************************************************************/
288 static inline int Vec_StrSize( Vec_Str_t * p )
289 {
290  return p->nSize;
291 }
292 
293 /**Function*************************************************************
294 
295  Synopsis []
296 
297  Description []
298 
299  SideEffects []
300 
301  SeeAlso []
302 
303 ***********************************************************************/
304 static inline int Vec_StrCap( Vec_Str_t * p )
305 {
306  return p->nCap;
307 }
308 
309 /**Function*************************************************************
310 
311  Synopsis []
312 
313  Description []
314 
315  SideEffects []
316 
317  SeeAlso []
318 
319 ***********************************************************************/
320 static inline double Vec_StrMemory( Vec_Str_t * p )
321 {
322  return !p ? 0.0 : 1.0 * sizeof(char) * p->nCap + sizeof(Vec_Str_t);
323 }
324 
325 /**Function*************************************************************
326 
327  Synopsis []
328 
329  Description []
330 
331  SideEffects []
332 
333  SeeAlso []
334 
335 ***********************************************************************/
336 static inline char Vec_StrEntry( Vec_Str_t * p, int i )
337 {
338  assert( i >= 0 && i < p->nSize );
339  return p->pArray[i];
340 }
341 
342 /**Function*************************************************************
343 
344  Synopsis []
345 
346  Description []
347 
348  SideEffects []
349 
350  SeeAlso []
351 
352 ***********************************************************************/
353 static inline char * Vec_StrEntryP( Vec_Str_t * p, int i )
354 {
355  assert( i >= 0 && i < p->nSize );
356  return p->pArray + i;
357 }
358 
359 /**Function*************************************************************
360 
361  Synopsis []
362 
363  Description []
364 
365  SideEffects []
366 
367  SeeAlso []
368 
369 ***********************************************************************/
370 static inline void Vec_StrWriteEntry( Vec_Str_t * p, int i, char Entry )
371 {
372  assert( i >= 0 && i < p->nSize );
373  p->pArray[i] = Entry;
374 }
375 
376 /**Function*************************************************************
377 
378  Synopsis []
379 
380  Description []
381 
382  SideEffects []
383 
384  SeeAlso []
385 
386 ***********************************************************************/
387 static inline char Vec_StrEntryLast( Vec_Str_t * p )
388 {
389  assert( p->nSize > 0 );
390  return p->pArray[p->nSize-1];
391 }
392 
393 /**Function*************************************************************
394 
395  Synopsis [Resizes the vector to the given capacity.]
396 
397  Description []
398 
399  SideEffects []
400 
401  SeeAlso []
402 
403 ***********************************************************************/
404 static inline void Vec_StrGrow( Vec_Str_t * p, int nCapMin )
405 {
406  if ( p->nCap >= nCapMin )
407  return;
408  p->pArray = ABC_REALLOC( char, p->pArray, nCapMin );
409  p->nCap = nCapMin;
410 }
411 
412 /**Function*************************************************************
413 
414  Synopsis [Fills the vector with given number of entries.]
415 
416  Description []
417 
418  SideEffects []
419 
420  SeeAlso []
421 
422 ***********************************************************************/
423 static inline void Vec_StrFill( Vec_Str_t * p, int nSize, char Fill )
424 {
425  int i;
426  Vec_StrGrow( p, nSize );
427  p->nSize = nSize;
428  for ( i = 0; i < p->nSize; i++ )
429  p->pArray[i] = Fill;
430 }
431 
432 /**Function*************************************************************
433 
434  Synopsis [Fills the vector with given number of entries.]
435 
436  Description []
437 
438  SideEffects []
439 
440  SeeAlso []
441 
442 ***********************************************************************/
443 static inline void Vec_StrFillExtra( Vec_Str_t * p, int nSize, char Fill )
444 {
445  int i;
446  if ( nSize <= p->nSize )
447  return;
448  if ( nSize > 2 * p->nCap )
449  Vec_StrGrow( p, nSize );
450  else if ( nSize > p->nCap )
451  Vec_StrGrow( p, 2 * p->nCap );
452  for ( i = p->nSize; i < nSize; i++ )
453  p->pArray[i] = Fill;
454  p->nSize = nSize;
455 }
456 
457 /**Function*************************************************************
458 
459  Synopsis [Returns the entry even if the place not exist.]
460 
461  Description []
462 
463  SideEffects []
464 
465  SeeAlso []
466 
467 ***********************************************************************/
468 static inline char Vec_StrGetEntry( Vec_Str_t * p, int i )
469 {
470  Vec_StrFillExtra( p, i + 1, 0 );
471  return Vec_StrEntry( p, i );
472 }
473 
474 /**Function*************************************************************
475 
476  Synopsis [Inserts the entry even if the place does not exist.]
477 
478  Description []
479 
480  SideEffects []
481 
482  SeeAlso []
483 
484 ***********************************************************************/
485 static inline void Vec_StrSetEntry( Vec_Str_t * p, int i, char Entry )
486 {
487  Vec_StrFillExtra( p, i + 1, 0 );
488  Vec_StrWriteEntry( p, i, Entry );
489 }
490 
491 /**Function*************************************************************
492 
493  Synopsis []
494 
495  Description []
496 
497  SideEffects []
498 
499  SeeAlso []
500 
501 ***********************************************************************/
502 static inline void Vec_StrShrink( Vec_Str_t * p, int nSizeNew )
503 {
504  assert( p->nSize >= nSizeNew );
505  p->nSize = nSizeNew;
506 }
507 
508 /**Function*************************************************************
509 
510  Synopsis []
511 
512  Description []
513 
514  SideEffects []
515 
516  SeeAlso []
517 
518 ***********************************************************************/
519 static inline void Vec_StrClear( Vec_Str_t * p )
520 {
521  p->nSize = 0;
522 }
523 
524 /**Function*************************************************************
525 
526  Synopsis []
527 
528  Description []
529 
530  SideEffects []
531 
532  SeeAlso []
533 
534 ***********************************************************************/
535 static inline void Vec_StrPush( Vec_Str_t * p, char Entry )
536 {
537  if ( p->nSize == p->nCap )
538  {
539  if ( p->nCap < 16 )
540  Vec_StrGrow( p, 16 );
541  else
542  Vec_StrGrow( p, 2 * p->nCap );
543  }
544  p->pArray[p->nSize++] = Entry;
545 }
546 
547 /**Function*************************************************************
548 
549  Synopsis [Returns the last entry and removes it from the list.]
550 
551  Description []
552 
553  SideEffects []
554 
555  SeeAlso []
556 
557 ***********************************************************************/
558 static inline char Vec_StrPop( Vec_Str_t * p )
559 {
560  assert( p->nSize > 0 );
561  return p->pArray[--p->nSize];
562 }
563 
564 /**Function*************************************************************
565 
566  Synopsis []
567 
568  Description []
569 
570  SideEffects []
571 
572  SeeAlso []
573 
574 ***********************************************************************/
575 static inline void Vec_StrPrintNum( Vec_Str_t * p, int Num )
576 {
577  int i;
578  char Digits[16];
579  if ( Num == 0 )
580  {
581  Vec_StrPush( p, '0' );
582  return;
583  }
584  if ( Num < 0 )
585  {
586  Vec_StrPush( p, '-' );
587  Num = -Num;
588  }
589  for ( i = 0; Num; Num /= 10, i++ )
590  Digits[i] = Num % 10;
591  for ( i--; i >= 0; i-- )
592  Vec_StrPush( p, (char)('0' + Digits[i]) );
593 }
594 static inline void Vec_StrPrintNumStar( Vec_Str_t * p, int Num, int nDigits )
595 {
596  int i;
597  char Digits[16] = {0};
598  if ( Num == 0 )
599  {
600  for ( i = 0; i < nDigits; i++ )
601  Vec_StrPush( p, '0' );
602  return;
603  }
604  if ( Num < 0 )
605  {
606  Vec_StrPush( p, '-' );
607  Num = -Num;
608  nDigits--;
609  }
610  for ( i = 0; Num; Num /= 10, i++ )
611  Digits[i] = Num % 10;
612  for ( i = Abc_MaxInt(i, nDigits)-1; i >= 0; i-- )
613  Vec_StrPush( p, (char)('0' + Digits[i]) );
614 }
615 
616 /**Function*************************************************************
617 
618  Synopsis []
619 
620  Description []
621 
622  SideEffects []
623 
624  SeeAlso []
625 
626 ***********************************************************************/
627 static inline void Vec_StrPrintStr( Vec_Str_t * p, const char * pStr )
628 {
629  int i, Length = strlen(pStr);
630  for ( i = 0; i < Length; i++ )
631  Vec_StrPush( p, pStr[i] );
632 }
633 
634 /**Function*************************************************************
635 
636  Synopsis [Appends the string to the char vector.]
637 
638  Description []
639 
640  SideEffects []
641 
642  SeeAlso []
643 
644 ***********************************************************************/
645 static inline void Vec_StrAppend( Vec_Str_t * p, const char * pString )
646 {
647  Vec_StrPrintStr( p, pString );
648 }
649 static inline void Vec_StrCopy( Vec_Str_t * p, const char * pString )
650 {
651  Vec_StrClear( p );
652  Vec_StrAppend( p, pString );
653  Vec_StrPush( p, '\0' );
654 }
655 
656 /**Function*************************************************************
657 
658  Synopsis [Reverses the order of entries.]
659 
660  Description []
661 
662  SideEffects []
663 
664  SeeAlso []
665 
666 ***********************************************************************/
667 static inline void Vec_StrReverseOrder( Vec_Str_t * p )
668 {
669  int i, Temp;
670  for ( i = 0; i < p->nSize/2; i++ )
671  {
672  Temp = p->pArray[i];
673  p->pArray[i] = p->pArray[p->nSize-1-i];
674  p->pArray[p->nSize-1-i] = Temp;
675  }
676 }
677 
678 /**Function*************************************************************
679 
680  Synopsis []
681 
682  Description []
683 
684  SideEffects []
685 
686  SeeAlso []
687 
688 ***********************************************************************/
689 static inline int Vec_StrSum( Vec_Str_t * p )
690 {
691  int i, Counter = 0;
692  for ( i = 0; i < p->nSize; i++ )
693  Counter += (int)p->pArray[i];
694  return Counter;
695 }
696 
697 /**Function*************************************************************
698 
699  Synopsis [Compares two strings.]
700 
701  Description []
702 
703  SideEffects []
704 
705  SeeAlso []
706 
707 ***********************************************************************/
708 static inline int Vec_StrEqual( Vec_Str_t * p1, Vec_Str_t * p2 )
709 {
710  int i;
711  if ( p1->nSize != p2->nSize )
712  return 0;
713  for ( i = 0; i < p1->nSize; i++ )
714  if ( p1->pArray[i] != p2->pArray[i] )
715  return 0;
716  return 1;
717 }
718 
719 /**Function*************************************************************
720 
721  Synopsis [Comparison procedure for two clauses.]
722 
723  Description []
724 
725  SideEffects []
726 
727  SeeAlso []
728 
729 ***********************************************************************/
730 static int Vec_StrSortCompare1( char * pp1, char * pp2 )
731 {
732  // for some reason commenting out lines (as shown) led to crashing of the release version
733  if ( *pp1 < *pp2 )
734  return -1;
735  if ( *pp1 > *pp2 ) //
736  return 1;
737  return 0; //
738 }
739 
740 /**Function*************************************************************
741 
742  Synopsis [Comparison procedure for two clauses.]
743 
744  Description []
745 
746  SideEffects []
747 
748  SeeAlso []
749 
750 ***********************************************************************/
751 static int Vec_StrSortCompare2( char * pp1, char * pp2 )
752 {
753  // for some reason commenting out lines (as shown) led to crashing of the release version
754  if ( *pp1 > *pp2 )
755  return -1;
756  if ( *pp1 < *pp2 ) //
757  return 1;
758  return 0; //
759 }
760 
761 /**Function*************************************************************
762 
763  Synopsis [Sorting the entries by their integer value.]
764 
765  Description []
766 
767  SideEffects []
768 
769  SeeAlso []
770 
771 ***********************************************************************/
772 static inline void Vec_StrSort( Vec_Str_t * p, int fReverse )
773 {
774  if ( fReverse )
775  qsort( (void *)p->pArray, p->nSize, sizeof(char),
776  (int (*)(const void *, const void *)) Vec_StrSortCompare2 );
777  else
778  qsort( (void *)p->pArray, p->nSize, sizeof(char),
779  (int (*)(const void *, const void *)) Vec_StrSortCompare1 );
780 }
781 
782 /**Function*************************************************************
783 
784  Synopsis []
785 
786  Description []
787 
788  SideEffects []
789 
790  SeeAlso []
791 
792 ***********************************************************************/
793 static inline int Vec_StrCompareVec( Vec_Str_t * p1, Vec_Str_t * p2 )
794 {
795  if ( p1 == NULL || p2 == NULL )
796  return (p1 != NULL) - (p2 != NULL);
797  if ( Vec_StrSize(p1) != Vec_StrSize(p2) )
798  return Vec_StrSize(p1) - Vec_StrSize(p2);
799  return memcmp( Vec_StrArray(p1), Vec_StrArray(p2), Vec_StrSize(p1) );
800 }
801 
802 
803 /**Function*************************************************************
804 
805  Synopsis [Binary I/O for numbers (int/float/etc) and strings (char *).]
806 
807  Description []
808 
809  SideEffects []
810 
811  SeeAlso []
812 
813 ***********************************************************************/
814 static inline void Vec_StrPutI_ne( Vec_Str_t * vOut, int Val )
815 {
816  int i;
817 // for ( i = 0; i < 4; i++ )
818  for ( i = 3; i >= 0; i-- )
819  Vec_StrPush( vOut, (char)(Val >> (8*i)) );
820 }
821 static inline int Vec_StrGetI_ne( Vec_Str_t * vOut, int * pPos )
822 {
823  int i;
824  int Val = 0;
825 // for ( i = 0; i < 4; i++ )
826  for ( i = 3; i >= 0; i-- )
827  Val |= ((int)(unsigned char)Vec_StrEntry(vOut, (*pPos)++) << (8*i));
828  return Val;
829 }
830 
831 static inline void Vec_StrPutI( Vec_Str_t * vOut, int Val )
832 {
833  for ( ; Val >= 0x80; Val >>= 7 )
834  Vec_StrPush( vOut, (unsigned char)(Val | 0x80) );
835  Vec_StrPush( vOut, (unsigned char)Val );
836 }
837 static inline int Vec_StrGetI( Vec_Str_t * vOut, int * pPos )
838 {
839  unsigned char ch;
840  int i = 0, Val = 0;
841  while ( (ch = Vec_StrEntry(vOut, (*pPos)++)) & 0x80 )
842  Val |= ((ch & 0x7f) << (7 * i++));
843  return Val | (ch << (7 * i));
844 }
845 
846 static inline void Vec_StrPutW( Vec_Str_t * vOut, word Val )
847 {
848  int i;
849  for ( i = 0; i < 8; i++ )
850  Vec_StrPush( vOut, (char)(Val >> (8*i)) );
851 }
852 static inline word Vec_StrGetW( Vec_Str_t * vOut, int * pPos )
853 {
854  int i;
855  word Val = 0;
856  for ( i = 0; i < 8; i++ )
857  Val |= ((word)(unsigned char)Vec_StrEntry(vOut, (*pPos)++) << (8*i));
858  return Val;
859 }
860 
861 static inline void Vec_StrPutF( Vec_Str_t * vOut, float Val )
862 {
863  union { float num; unsigned char data[4]; } tmp;
864  tmp.num = Val;
865  Vec_StrPush( vOut, tmp.data[0] );
866  Vec_StrPush( vOut, tmp.data[1] );
867  Vec_StrPush( vOut, tmp.data[2] );
868  Vec_StrPush( vOut, tmp.data[3] );
869 }
870 static inline float Vec_StrGetF( Vec_Str_t * vOut, int * pPos )
871 {
872  union { float num; unsigned char data[4]; } tmp;
873  tmp.data[0] = Vec_StrEntry( vOut, (*pPos)++ );
874  tmp.data[1] = Vec_StrEntry( vOut, (*pPos)++ );
875  tmp.data[2] = Vec_StrEntry( vOut, (*pPos)++ );
876  tmp.data[3] = Vec_StrEntry( vOut, (*pPos)++ );
877  return tmp.num;
878 }
879 
880 static inline void Vec_StrPutD( Vec_Str_t * vOut, double Val )
881 {
882  union { double num; unsigned char data[8]; } tmp;
883  int i, Lim = sizeof(double);
884  tmp.num = Val;
885  for ( i = 0; i < Lim; i++ )
886  Vec_StrPush( vOut, tmp.data[i] );
887 }
888 static inline double Vec_StrGetD( Vec_Str_t * vOut, int * pPos )
889 {
890  union { double num; unsigned char data[8]; } tmp;
891  int i, Lim = sizeof(double);
892  for ( i = 0; i < Lim; i++ )
893  tmp.data[i] = Vec_StrEntry( vOut, (*pPos)++ );
894  return tmp.num;
895 }
896 
897 static inline void Vec_StrPutS( Vec_Str_t * vOut, char * pStr )
898 {
899  while ( *pStr )
900  Vec_StrPush( vOut, *pStr++ );
901  Vec_StrPush( vOut, (char)0 );
902 }
903 static inline char * Vec_StrGetS( Vec_Str_t * vOut, int * pPos )
904 {
905  char * pStr = Vec_StrEntryP( vOut, *pPos );
906  while ( Vec_StrEntry(vOut, (*pPos)++) );
907  return Abc_UtilStrsav(pStr);
908 }
909 
910 static inline void Vec_StrPutC( Vec_Str_t * vOut, char c )
911 {
912  Vec_StrPush( vOut, c );
913 }
914 static inline char Vec_StrGetC( Vec_Str_t * vOut, int * pPos )
915 {
916  return Vec_StrEntry(vOut, (*pPos)++);
917 }
918 
919 
920 
922 
923 #endif
924 
925 ////////////////////////////////////////////////////////////////////////
926 /// END OF FILE ///
927 ////////////////////////////////////////////////////////////////////////
928 
char * memset()
static void Vec_StrSort(Vec_Str_t *p, int fReverse)
Definition: vecStr.h:772
static int Vec_StrSortCompare2(char *pp1, char *pp2)
Definition: vecStr.h:751
static int Vec_StrGetI_ne(Vec_Str_t *vOut, int *pPos)
Definition: vecStr.h:821
static word Vec_StrGetW(Vec_Str_t *vOut, int *pPos)
Definition: vecStr.h:852
static char Vec_StrGetC(Vec_Str_t *vOut, int *pPos)
Definition: vecStr.h:914
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_StrPutW(Vec_Str_t *vOut, word Val)
Definition: vecStr.h:846
static char * Vec_StrArray(Vec_Str_t *p)
Definition: vecStr.h:272
#define ABC_REALLOC(type, obj, num)
Definition: abc_global.h:233
static void Vec_StrPutC(Vec_Str_t *vOut, char c)
Definition: vecStr.h:910
static Vec_Str_t * Vec_StrAllocArray(char *pArray, int nSize)
Definition: vecStr.h:115
static void Vec_StrPrintNum(Vec_Str_t *p, int Num)
Definition: vecStr.h:575
static float Vec_StrGetF(Vec_Str_t *vOut, int *pPos)
Definition: vecStr.h:870
static void Vec_StrReverseOrder(Vec_Str_t *p)
Definition: vecStr.h:667
static int Vec_StrCap(Vec_Str_t *p)
Definition: vecStr.h:304
static int Vec_StrSum(Vec_Str_t *p)
Definition: vecStr.h:689
static char Vec_StrEntryLast(Vec_Str_t *p)
Definition: vecStr.h:387
static void Vec_StrClear(Vec_Str_t *p)
Definition: vecStr.h:519
char * memcpy()
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
static void Vec_StrFillExtra(Vec_Str_t *p, int nSize, char Fill)
Definition: vecStr.h:443
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static void Vec_StrPush(Vec_Str_t *p, char Entry)
Definition: vecStr.h:535
static char * Vec_StrReleaseArray(Vec_Str_t *p)
Definition: vecStr.h:252
static char Vec_StrPop(Vec_Str_t *p)
Definition: vecStr.h:558
static Vec_Str_t * Vec_StrDupArray(Vec_Str_t *pVec)
Definition: vecStr.h:180
static void Vec_StrWriteEntry(Vec_Str_t *p, int i, char Entry)
Definition: vecStr.h:370
static void Vec_StrGrow(Vec_Str_t *p, int nCapMin)
Definition: vecStr.h:404
static void Vec_StrAppend(Vec_Str_t *p, const char *pString)
Definition: vecStr.h:645
static char Vec_StrEntry(Vec_Str_t *p, int i)
Definition: vecStr.h:336
char * pArray
Definition: bblif.c:51
static void Vec_StrPutD(Vec_Str_t *vOut, double Val)
Definition: vecStr.h:880
static int Vec_StrSortCompare1(char *pp1, char *pp2)
Definition: vecStr.h:730
static void Vec_StrZero(Vec_Str_t *p)
Definition: vecStr.h:204
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
static void Vec_StrPutI_ne(Vec_Str_t *vOut, int Val)
Definition: vecStr.h:814
static void Vec_StrFill(Vec_Str_t *p, int nSize, char Fill)
Definition: vecStr.h:423
int memcmp()
static void Vec_StrPutS(Vec_Str_t *vOut, char *pStr)
Definition: vecStr.h:897
static Vec_Str_t * Vec_StrStart(int nSize)
Definition: vecStr.h:95
static int Counter
static void Vec_StrShrink(Vec_Str_t *p, int nSizeNew)
Definition: vecStr.h:502
static char * Vec_StrGetS(Vec_Str_t *vOut, int *pPos)
Definition: vecStr.h:903
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
static Vec_Str_t * Vec_StrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecStr.h:72
static double Vec_StrMemory(Vec_Str_t *p)
Definition: vecStr.h:320
static int Vec_StrSize(Vec_Str_t *p)
Definition: vecStr.h:288
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
static void Vec_StrPrintNumStar(Vec_Str_t *p, int Num, int nDigits)
Definition: vecStr.h:594
static void Vec_StrPutF(Vec_Str_t *vOut, float Val)
Definition: vecStr.h:861
static double Vec_StrGetD(Vec_Str_t *vOut, int *pPos)
Definition: vecStr.h:888
static int Vec_StrCompareVec(Vec_Str_t *p1, Vec_Str_t *p2)
Definition: vecStr.h:793
static void Vec_StrSetEntry(Vec_Str_t *p, int i, char Entry)
Definition: vecStr.h:485
#define ABC_FREE(obj)
Definition: abc_global.h:232
int nSize
Definition: bblif.c:50
static Vec_Str_t * Vec_StrAllocArrayCopy(char *pArray, int nSize)
Definition: vecStr.h:136
static void Vec_StrPutI(Vec_Str_t *vOut, int Val)
Definition: vecStr.h:831
#define assert(ex)
Definition: util_old.h:213
int strlen()
static void Vec_StrPrintStr(Vec_Str_t *p, const char *pStr)
Definition: vecStr.h:627
static void Vec_StrCopy(Vec_Str_t *p, const char *pString)
Definition: vecStr.h:649
int nCap
Definition: bblif.c:49
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
static void Vec_StrFree(Vec_Str_t *p)
Definition: vecStr.h:216
static int Vec_StrGetI(Vec_Str_t *vOut, int *pPos)
Definition: vecStr.h:837
static Vec_Str_t * Vec_StrDup(Vec_Str_t *pVec)
Definition: vecStr.h:158
static char * Vec_StrEntryP(Vec_Str_t *p, int i)
Definition: vecStr.h:353
static void Vec_StrErase(Vec_Str_t *p)
Definition: vecStr.h:210
static int Vec_StrEqual(Vec_Str_t *p1, Vec_Str_t *p2)
Definition: vecStr.h:708
static void Vec_StrFreeP(Vec_Str_t **p)
Definition: vecStr.h:233
static char Vec_StrGetEntry(Vec_Str_t *p, int i)
Definition: vecStr.h:468