21 #ifndef ABC__misc__vec__vecStr_h
22 #define ABC__misc__vec__vecStr_h
54 #define Vec_StrForEachEntry( vVec, Entry, i ) \
55 for ( i = 0; (i < Vec_StrSize(vVec)) && (((Entry) = Vec_StrEntry(vVec, i)), 1); i++ )
76 if ( nCap > 0 && nCap < 16 )
254 char * pArray = p->
pArray;
322 return !p ? 0.0 : 1.0 *
sizeof(char) * p->
nCap +
sizeof(
Vec_Str_t);
338 assert( i >= 0 && i < p->nSize );
355 assert( i >= 0 && i < p->nSize );
372 assert( i >= 0 && i < p->nSize );
406 if ( p->
nCap >= nCapMin )
428 for ( i = 0; i < p->
nSize; i++ )
446 if ( nSize <= p->nSize )
448 if ( nSize > 2 * p->
nCap )
450 else if ( nSize > p->
nCap )
452 for ( i = p->
nSize; i < nSize; i++ )
589 for ( i = 0; Num; Num /= 10, i++ )
590 Digits[i] = Num % 10;
591 for ( i--; i >= 0; i-- )
597 char Digits[16] = {0};
600 for ( i = 0; i < nDigits; i++ )
610 for ( i = 0; Num; Num /= 10, i++ )
611 Digits[i] = Num % 10;
612 for ( i =
Abc_MaxInt(i, nDigits)-1; i >= 0; i-- )
629 int i, Length =
strlen(pStr);
630 for ( i = 0; i < Length; i++ )
670 for ( i = 0; i < p->
nSize/2; i++ )
692 for ( i = 0; i < p->
nSize; i++ )
693 Counter += (
int)p->
pArray[i];
713 for ( i = 0; i < p1->
nSize; i++ )
795 if ( p1 == NULL || p2 == NULL )
796 return (p1 != NULL) - (p2 != NULL);
818 for ( i = 3; i >= 0; i-- )
826 for ( i = 3; i >= 0; i-- )
827 Val |= ((
int)(
unsigned char)
Vec_StrEntry(vOut, (*pPos)++) << (8*i));
833 for ( ; Val >= 0x80; Val >>= 7 )
842 Val |= ((ch & 0x7f) << (7 * i++));
843 return Val | (ch << (7 * i));
849 for ( i = 0; i < 8; i++ )
856 for ( i = 0; i < 8; i++ )
863 union {
float num;
unsigned char data[4]; } tmp;
872 union {
float num;
unsigned char data[4]; } tmp;
882 union {
double num;
unsigned char data[8]; } tmp;
883 int i, Lim =
sizeof(double);
885 for ( i = 0; i < Lim; i++ )
890 union {
double num;
unsigned char data[8]; } tmp;
891 int i, Lim =
sizeof(double);
892 for ( i = 0; i < Lim; i++ )
static void Vec_StrSort(Vec_Str_t *p, int fReverse)
static int Vec_StrSortCompare2(char *pp1, char *pp2)
static int Vec_StrGetI_ne(Vec_Str_t *vOut, int *pPos)
static word Vec_StrGetW(Vec_Str_t *vOut, int *pPos)
static char Vec_StrGetC(Vec_Str_t *vOut, int *pPos)
static void Vec_StrPutW(Vec_Str_t *vOut, word Val)
static char * Vec_StrArray(Vec_Str_t *p)
#define ABC_REALLOC(type, obj, num)
static void Vec_StrPutC(Vec_Str_t *vOut, char c)
static Vec_Str_t * Vec_StrAllocArray(char *pArray, int nSize)
static void Vec_StrPrintNum(Vec_Str_t *p, int Num)
static float Vec_StrGetF(Vec_Str_t *vOut, int *pPos)
static void Vec_StrReverseOrder(Vec_Str_t *p)
static int Vec_StrCap(Vec_Str_t *p)
static int Vec_StrSum(Vec_Str_t *p)
static char Vec_StrEntryLast(Vec_Str_t *p)
static void Vec_StrClear(Vec_Str_t *p)
#define ABC_ALLOC(type, num)
static void Vec_StrFillExtra(Vec_Str_t *p, int nSize, char Fill)
static int Abc_MaxInt(int a, int b)
static void Vec_StrPush(Vec_Str_t *p, char Entry)
static char * Vec_StrReleaseArray(Vec_Str_t *p)
static char Vec_StrPop(Vec_Str_t *p)
static Vec_Str_t * Vec_StrDupArray(Vec_Str_t *pVec)
static void Vec_StrWriteEntry(Vec_Str_t *p, int i, char Entry)
static void Vec_StrGrow(Vec_Str_t *p, int nCapMin)
static void Vec_StrAppend(Vec_Str_t *p, const char *pString)
static char Vec_StrEntry(Vec_Str_t *p, int i)
static void Vec_StrPutD(Vec_Str_t *vOut, double Val)
static int Vec_StrSortCompare1(char *pp1, char *pp2)
static void Vec_StrZero(Vec_Str_t *p)
unsigned __int64 word
DECLARATIONS ///.
static void Vec_StrPutI_ne(Vec_Str_t *vOut, int Val)
static void Vec_StrFill(Vec_Str_t *p, int nSize, char Fill)
static void Vec_StrPutS(Vec_Str_t *vOut, char *pStr)
static Vec_Str_t * Vec_StrStart(int nSize)
static void Vec_StrShrink(Vec_Str_t *p, int nSizeNew)
static char * Vec_StrGetS(Vec_Str_t *vOut, int *pPos)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
static Vec_Str_t * Vec_StrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static double Vec_StrMemory(Vec_Str_t *p)
static int Vec_StrSize(Vec_Str_t *p)
#define ABC_NAMESPACE_HEADER_END
static void Vec_StrPrintNumStar(Vec_Str_t *p, int Num, int nDigits)
static void Vec_StrPutF(Vec_Str_t *vOut, float Val)
static double Vec_StrGetD(Vec_Str_t *vOut, int *pPos)
static int Vec_StrCompareVec(Vec_Str_t *p1, Vec_Str_t *p2)
static void Vec_StrSetEntry(Vec_Str_t *p, int i, char Entry)
static Vec_Str_t * Vec_StrAllocArrayCopy(char *pArray, int nSize)
static void Vec_StrPutI(Vec_Str_t *vOut, int Val)
static void Vec_StrPrintStr(Vec_Str_t *p, const char *pStr)
static void Vec_StrCopy(Vec_Str_t *p, const char *pString)
char * Abc_UtilStrsav(char *s)
static void Vec_StrFree(Vec_Str_t *p)
static int Vec_StrGetI(Vec_Str_t *vOut, int *pPos)
static Vec_Str_t * Vec_StrDup(Vec_Str_t *pVec)
static char * Vec_StrEntryP(Vec_Str_t *p, int i)
static void Vec_StrErase(Vec_Str_t *p)
static int Vec_StrEqual(Vec_Str_t *p1, Vec_Str_t *p2)
static void Vec_StrFreeP(Vec_Str_t **p)
static char Vec_StrGetEntry(Vec_Str_t *p, int i)