Lines Matching refs:pv
42 UPropsVectors *pv;
55 pv=(UPropsVectors *)uprv_malloc(sizeof(UPropsVectors));
57 if(pv==NULL || v==NULL) {
58 uprv_free(pv);
63 uprv_memset(pv, 0, sizeof(UPropsVectors));
64 pv->v=v;
65 pv->columns=columns;
66 pv->maxRows=UPVEC_INITIAL_ROWS;
67 pv->rows=2+(UPVEC_MAX_CP-UPVEC_FIRST_SPECIAL_CP);
70 row=pv->v;
71 uprv_memset(row, 0, pv->rows*columns*4);
80 return pv;
84 upvec_close(UPropsVectors *pv) {
85 if(pv!=NULL) {
86 uprv_free(pv->v);
87 uprv_free(pv);
92 _findRow(UPropsVectors *pv, UChar32 rangeStart) {
96 columns=pv->columns;
97 rows=limit=pv->rows;
98 prevRow=pv->prevRow;
101 row=pv->v+prevRow*columns;
108 pv->prevRow=prevRow+1;
112 pv->prevRow=prevRow+2;
121 pv->prevRow=prevRow;
124 } else if(rangeStart<(UChar32)pv->v[1]) {
126 pv->prevRow=0;
127 return pv->v;
134 row=pv->v+i*columns;
138 pv->prevRow=i;
146 pv->prevRow=start;
147 return pv->v+start*columns;
151 upvec_setValue(UPropsVectors *pv,
165 if( pv==NULL ||
167 column<0 || column>=(pv->columns-2)
172 if(pv->isCompacted) {
179 columns=pv->columns;
186 firstRow=_findRow(pv, start);
187 lastRow=_findRow(pv, end);
201 rows=pv->rows;
202 if((rows+splitFirstRow+splitLastRow)>pv->maxRows) {
206 if(pv->maxRows<UPVEC_MEDIUM_ROWS) {
208 } else if(pv->maxRows<UPVEC_MAX_ROWS) {
220 uprv_memcpy(newVectors, pv->v, rows*columns*4);
221 firstRow=newVectors+(firstRow-pv->v);
222 lastRow=newVectors+(lastRow-pv->v);
223 uprv_free(pv->v);
224 pv->v=newVectors;
225 pv->maxRows=newMaxRows;
229 count = (int32_t)((pv->v+rows*columns)-(lastRow+columns));
236 pv->rows=rows+splitFirstRow+splitLastRow;
261 pv->prevRow=(int32_t)((lastRow-(pv->v))/columns);
277 upvec_getValue(const UPropsVectors *pv, UChar32 c, int32_t column) {
281 if(pv->isCompacted || c<0 || c>UPVEC_MAX_CP || column<0 || column>=(pv->columns-2)) {
284 ncpv=(UPropsVectors *)pv;
290 upvec_getRow(const UPropsVectors *pv, int32_t rowIndex,
295 if(pv->isCompacted || rowIndex<0 || rowIndex>=pv->rows) {
299 columns=pv->columns;
300 row=pv->v+rowIndex*columns;
313 const UPropsVectors *pv=(const UPropsVectors *)context;
316 count=columns=pv->columns; /* includes start/limit columns */
333 upvec_compact(UPropsVectors *pv, UPVecCompactHandler *handler, void *context, UErrorCode *pErrorCode) {
346 if(pv->isCompacted) {
351 pv->isCompacted=TRUE;
353 rows=pv->rows;
354 columns=pv->columns;
358 uprv_sortArray(pv->v, rows, columns*4,
359 upvec_compareRows, pv, FALSE, pErrorCode);
369 row=pv->v;
406 row=pv->v;
414 if(count<0 || 0!=uprv_memcmp(row+2, pv->v+count, valueColumns*4)) {
416 uprv_memmove(pv->v+count, row+2, valueColumns*4);
420 handler(context, start, limit-1, count, pv->v+count, valueColumns, pErrorCode);
430 pv->rows=count/valueColumns+1;
434 upvec_getArray(const UPropsVectors *pv, int32_t *pRows, int32_t *pColumns) {
435 if(!pv->isCompacted) {
439 *pRows=pv->rows;
442 *pColumns=pv->columns-2;
444 return pv->v;
448 upvec_cloneArray(const UPropsVectors *pv,
456 if(!pv->isCompacted) {
460 byteLength=pv->rows*(pv->columns-2)*4;
466 uprv_memcpy(clonedArray, pv->v, byteLength);
468 *pRows=pv->rows;
471 *pColumns=pv->columns-2;
477 upvec_compactToUTrie2WithRowIndexes(UPropsVectors *pv, UErrorCode *pErrorCode) {
479 upvec_compact(pv, upvec_compactToUTrie2Handler, &toUTrie2, pErrorCode);