|
@@ -85,6 +85,7 @@ bool cmDsvIsFloat( const cmDspValue_t* vp ){ vp=_vcptr(vp); return cmAllFla
|
85
|
85
|
bool cmDsvIsDouble( const cmDspValue_t* vp ){ vp=_vcptr(vp); return cmAllFlags(vp->flags,kDoubleDsvFl); }
|
86
|
86
|
bool cmDsvIsSample( const cmDspValue_t* vp ){ vp=_vcptr(vp); return cmAllFlags(vp->flags,kSampleDsvFl); }
|
87
|
87
|
bool cmDsvIsReal( const cmDspValue_t* vp ){ vp=_vcptr(vp); return cmAllFlags(vp->flags,kRealDsvFl); }
|
|
88
|
+bool cmDsvIsPtr( const cmDspValue_t* vp ){ vp=_vcptr(vp); return cmAllFlags(vp->flags,kPtrDsvFl); }
|
88
|
89
|
bool cmDsvIsStrz( const cmDspValue_t* vp ){ vp=_vcptr(vp); return cmAllFlags(vp->flags,kStrzDsvFl); }
|
89
|
90
|
bool cmDsvIsStrcz( const cmDspValue_t* vp ){ vp=_vcptr(vp); return cmAllFlags(vp->flags,kStrzDsvFl | kConstDsvFl); }
|
90
|
91
|
bool cmDsvIsSymbol( const cmDspValue_t* vp ){ vp=_vcptr(vp); return cmAllFlags(vp->flags,kSymDsvFl); }
|
|
@@ -125,6 +126,7 @@ bool cmDsvSetFromValist( cmDspValue_t* vp, unsigned flags, va_list vl )
|
125
|
126
|
case kDoubleDsvFl: cmDsvSetDouble( vp, va_arg(vl,double )); break;
|
126
|
127
|
case kSampleDsvFl: cmDsvSetSample( vp, va_arg(vl,double )); break;
|
127
|
128
|
case kRealDsvFl: cmDsvSetReal( vp, va_arg(vl,double )); break;
|
|
129
|
+ case kPtrDsvFl: cmDsvSetPtr( vp, va_arg(vl,void* )); break;
|
128
|
130
|
case kStrzDsvFl: cmDsvSetStrz( vp, va_arg(vl,cmChar_t* )); break;
|
129
|
131
|
default:
|
130
|
132
|
return false;
|
|
@@ -146,6 +148,7 @@ void cmDsvSetFloat( cmDspValue_t* vp, float v ) { vp->flags = kFloatDs
|
146
|
148
|
void cmDsvSetDouble( cmDspValue_t* vp, double v ) { vp->flags = kDoubleDsvFl; vp->u.d = v; }
|
147
|
149
|
void cmDsvSetSample( cmDspValue_t* vp, cmSample_t v ) { vp->flags = kSampleDsvFl; vp->u.a = v; }
|
148
|
150
|
void cmDsvSetReal( cmDspValue_t* vp, cmReal_t v ) { vp->flags = kRealDsvFl; vp->u.r = v; }
|
|
151
|
+void cmDsvSetPtr( cmDspValue_t* vp, void* v ) { vp->flags = kPtrDsvFl; vp->u.vp = v; }
|
149
|
152
|
void cmDsvSetSymbol( cmDspValue_t* vp, unsigned v ) { vp->flags = kSymDsvFl; vp->u.u = v; }
|
150
|
153
|
void cmDsvSetStrz( cmDspValue_t* vp, cmChar_t* v ) { vp->flags = kStrzDsvFl; vp->u.z = v; }
|
151
|
154
|
void cmDsvSetStrcz( cmDspValue_t* vp, const cmChar_t* v ){ vp->flags = kStrzDsvFl | kConstDsvFl; vp->u.cz = v; }
|
|
@@ -235,6 +238,7 @@ float cmDsvFloat( const cmDspValue_t* vp ) { vp=_vcptr(vp); if(cmIsFla
|
235
|
238
|
double cmDsvDouble( const cmDspValue_t* vp ) { vp=_vcptr(vp); if(cmIsFlag((vp->flags & kTypeDsvMask),kDoubleDsvFl)) return vp->u.d; assert(0); return 0; }
|
236
|
239
|
cmSample_t cmDsvSample( const cmDspValue_t* vp ) { vp=_vcptr(vp); if(cmIsFlag((vp->flags & kTypeDsvMask),kSampleDsvFl)) return vp->u.a; assert(0); return 0; }
|
237
|
240
|
cmReal_t cmDsvReal( const cmDspValue_t* vp ) { vp=_vcptr(vp); if(cmIsFlag((vp->flags & kTypeDsvMask),kRealDsvFl)) return vp->u.r; assert(0); return 0; }
|
|
241
|
+void* cmDsvPtr( const cmDspValue_t* vp ) { vp=_vcptr(vp); if(cmIsFlag((vp->flags & kTypeDsvMask),kPtrDsvFl)) return vp->u.vp; assert(0); return 0; }
|
238
|
242
|
unsigned int cmDsvSymbol( const cmDspValue_t* vp ) { vp=_vcptr(vp); if(cmIsFlag((vp->flags & kTypeDsvMask),kSymDsvFl)) return vp->u.u; assert(0); return cmInvalidId; }
|
239
|
243
|
cmJsonNode_t* cmDsvJson( const cmDspValue_t* vp ) { vp=_vcptr(vp); if(cmIsFlag((vp->flags & kTypeDsvMask),kJsonDsvFl)) return vp->u.j; assert(0); return NULL; }
|
240
|
244
|
|
|
@@ -661,6 +665,17 @@ cmReal_t cmDsvGetReal( const cmDspValue_t* vp )
|
661
|
665
|
return 0;
|
662
|
666
|
}
|
663
|
667
|
|
|
668
|
+void* cmDsvGetPtr( const cmDspValue_t* vp )
|
|
669
|
+{
|
|
670
|
+ vp = _vcptr(vp);
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+ if( (vp->flags & kTypeDsvMask) == kPtrDsvFl )
|
|
674
|
+ return vp->u.vp;
|
|
675
|
+
|
|
676
|
+ return NULL;
|
|
677
|
+}
|
|
678
|
+
|
664
|
679
|
unsigned int cmDsvGetSymbol( const cmDspValue_t* vp )
|
665
|
680
|
{
|
666
|
681
|
vp = _vcptr(vp);
|
|
@@ -1266,6 +1281,7 @@ unsigned cmDsvSerialByteCount( const cmDspValue_t* vp )
|
1266
|
1281
|
case kDoubleDsvFl:
|
1267
|
1282
|
case kSampleDsvFl:
|
1268
|
1283
|
case kRealDsvFl:
|
|
1284
|
+ case kPtrDsvFl:
|
1269
|
1285
|
case kSymDsvFl:
|
1270
|
1286
|
// these types are stored as part of the type record
|
1271
|
1287
|
// and therefore don't need any extra storage
|
|
@@ -1371,6 +1387,7 @@ cmDsvRC_t cmDsvSerialize( const cmDspValue_t* vp, void* buf, unsigned bufByteCnt
|
1371
|
1387
|
case kDoubleDsvFl:
|
1372
|
1388
|
case kSampleDsvFl:
|
1373
|
1389
|
case kRealDsvFl:
|
|
1390
|
+ case kPtrDsvFl:
|
1374
|
1391
|
case kSymDsvFl:
|
1375
|
1392
|
// these types are stored as part of the type record
|
1376
|
1393
|
// and therefore don't need any extra storage
|
|
@@ -1501,6 +1518,7 @@ void cmDsvPrint( const cmDspValue_t* vp, const cmChar_t* label, cmRpt_t* rpt )
|
1501
|
1518
|
case kDoubleDsvFl: cmRptPrintf(rpt,"%s%f ",lbl,vp->u.d); break;
|
1502
|
1519
|
case kSampleDsvFl: cmRptPrintf(rpt,"%s%f ",lbl,vp->u.a); break;
|
1503
|
1520
|
case kRealDsvFl: cmRptPrintf(rpt,"%s%f ",lbl,vp->u.r); break;
|
|
1521
|
+ case kPtrDsvFl: cmRptPrintf(rpt,"%s%p ",lbl,vp->u.vp); break;
|
1504
|
1522
|
case kStrzDsvFl: cmRptPrintf(rpt,"%s%s ",lbl,vp->u.z); break;
|
1505
|
1523
|
case kSymDsvFl: cmRptPrintf(rpt,"%s%i ",lbl,vp->u.u); break;
|
1506
|
1524
|
case kJsonDsvFl: cmJsonPrintTree(vp->u.j,rpt); break;
|