49 #include "co_cdh_msg.h"
51 #include "co_string.h"
70 if (Objid_1.vid == Objid_2.vid) {
71 if (Objid_1.oix == Objid_2.oix)
73 else if (Objid_1.oix < Objid_2.oix)
77 }
else if (Objid_1.vid < Objid_2.vid)
91 return (Objid_1.vid == Objid_2.vid) && (Objid_1.oix == Objid_2.oix);
102 return (Objid_1.vid != Objid_2.vid) || (Objid_1.oix != Objid_2.oix);
113 return (Objid.vid == pwr_cNObjid.vid) && (Objid.oix == pwr_cNObjid.oix);
124 return (Objid.vid != pwr_cNObjid.vid) || (Objid.oix != pwr_cNObjid.oix);
178 int cdh_SubidIsNotNull(
pwr_tSubid Subscription)
206 int cdh_DlidIsNotNull(
pwr_tDlid DirectLink)
236 cid.
c.cix = oid.
c.cix;
237 cid.
c.must_be_zero = 0;
238 cid.
c.vid_0 = oid.
c.vid_0;
239 cid.
c.vid_1 = oid.
c.vid_1;
260 oid.
c.cix = cid.
c.cix;
261 oid.
c.must_be_two = 2;
262 oid.
c.vid_0 = cid.
c.vid_0;
263 oid.
c.vid_1 = cid.
c.vid_1;
283 if (oid.
t.must_be_three == 2) {
285 tid.
c.bix = oid.
c.bix;
286 tid.
c.cix = oid.
c.cix;
287 tid.
c.must_be_zero = 0;
288 tid.
c.vid_0 = oid.
c.vid_0;
289 tid.
c.vid_1 = oid.
c.vid_1;
290 }
else if (oid.
t.must_be_three == 3) {
292 tid.
t.tix = oid.
t.tix;
293 tid.
t.tyg = oid.
t.tyg;
294 tid.
t.must_be_one = 1;
295 tid.
t.vid_0 = oid.
t.vid_0;
296 tid.
t.vid_1 = oid.
t.vid_1;
299 tid.
t.tix = oid.
t.tix;
300 tid.
t.tyg = oid.
t.tyg;
301 tid.
t.must_be_one = 1;
302 tid.
t.vid_0 = oid.
t.vid_0;
303 tid.
t.vid_1 = oid.
t.vid_1;
329 if (tid.
t.must_be_one == 1) {
332 oid.
t.tix = tid.
t.tix;
333 oid.
t.tyg = tid.
t.tyg;
334 oid.
t.must_be_three = 3;
335 oid.
t.vid_0 = tid.
t.vid_0;
336 oid.
t.vid_1 = tid.
t.vid_1;
342 oid.
c.bix = tid.
c.bix;
343 oid.
c.cix = tid.
c.cix;
344 oid.
c.must_be_two = 2;
345 oid.
c.vid_0 = tid.
c.vid_0;
346 oid.
c.vid_1 = tid.
c.vid_1;
367 pwr_eType Type,
void* Value,
char* String,
int MaxSize)
373 case pwr_eType_Boolean:
379 case pwr_eType_Float32: {
381 memcpy(&f, Value,
sizeof(f));
382 snprintf(String, MaxSize,
"%.7g", f);
385 case pwr_eType_Float64: {
387 memcpy(&f, Value,
sizeof(f));
388 snprintf(String, MaxSize,
"%.17g", f);
395 sprintf(String,
"%c", *(
pwr_tChar*)Value);
398 snprintf(String, MaxSize,
"%d", *(
pwr_tInt8*)Value);
400 case pwr_eType_Int16:
401 snprintf(String, MaxSize,
"%hd", *(
pwr_tInt16*)Value);
403 case pwr_eType_Int32:
404 case pwr_eType_Status:
405 case pwr_eType_NetStatus:
407 snprintf(String, MaxSize,
"%d", *(
pwr_tInt32*)Value);
409 case pwr_eType_Int64:
410 snprintf(String, MaxSize, pwr_dFormatInt64, *(pwr_tInt64*)Value);
412 case pwr_eType_UInt8:
413 snprintf(String, MaxSize,
"%u", *(
pwr_tUInt8*)Value);
415 case pwr_eType_UInt16:
416 snprintf(String, MaxSize,
"%hu", *(
pwr_tUInt16*)Value);
418 case pwr_eType_UInt32:
420 snprintf(String, MaxSize,
"%u", *(
pwr_tUInt32*)Value);
422 case pwr_eType_UInt64:
423 snprintf(String, MaxSize, pwr_dFormatUInt64, *(pwr_tUInt64*)Value);
428 strncpy(String, timbuf, MaxSize);
430 strncpy(String,
"*** Bad time value ***", MaxSize);
434 case pwr_eType_DeltaTime:
436 strncpy(String, timbuf, MaxSize);
438 strncpy(String,
"*** Bad delta time value ***", MaxSize);
439 sts = CDH__INVDELTATIME;
442 case pwr_eType_String:
444 snprintf(String, MaxSize,
"%s", (
char*)Value);
446 case pwr_eType_ProString: {
447 int len = MIN(strlen((
char*)Value), MaxSize-1);
450 for (i = 0; i < len; i++)
459 str_Cut(String, MaxSize);
467 pwr_eType Type,
const char* String,
void* Value)
474 pwr_tInt64 i64val = 0;
478 pwr_tUInt64 ui64val = 0;
493 pwr_Assert(String != NULL);
494 pwr_Assert(Value != NULL);
497 case pwr_eType_Boolean:
498 if (*String !=
'\0') {
499 i32val = strtoul(String, &endp, 0);
500 if (errno == ERANGE || *endp !=
'\0' || (i32val != 0 && i32val != 1)) {
506 memcpy(Value, &bval,
sizeof(bval));
509 case pwr_eType_Float32:
510 if (*String !=
'\0') {
511 f64val = strtod(String, &endp);
512 if (errno == ERANGE || *endp !=
'\0' || fabs(f64val) > FLT_MAX) {
513 sts = CDH__INVFLOAT32;
518 memcpy(Value, &f32val,
sizeof(f32val));
521 case pwr_eType_Float64:
522 if (*String !=
'\0') {
523 f64val = strtod(String, &endp);
524 if (errno == ERANGE || *endp !=
'\0' || fabs(f64val) > DBL_MAX) {
525 sts = CDH__INVFLOAT64;
529 memcpy(Value, &f64val,
sizeof(f64val));
533 *((
char*)Value) = *String;
537 if (*String !=
'\0') {
538 i32val = strtol(String, &endp, 0);
539 if (errno == ERANGE || *endp !=
'\0' || i32val > SCHAR_MAX
540 || i32val < SCHAR_MIN) {
546 memcpy(Value, &i8val,
sizeof(i8val));
549 case pwr_eType_Int16:
550 if (*String !=
'\0') {
551 i32val = strtol(String, &endp, 0);
552 if (errno == ERANGE || *endp !=
'\0' || i32val > SHRT_MAX
553 || i32val < SHRT_MIN) {
559 memcpy(Value, &i16val,
sizeof(i16val));
562 case pwr_eType_Int32:
563 case pwr_eType_Status:
564 case pwr_eType_NetStatus:
566 if (*String !=
'\0') {
567 i32val = strtol(String, &endp, 0);
568 if (errno == ERANGE || *endp !=
'\0' || i32val > INT_MAX
569 || i32val < INT_MIN) {
574 memcpy(Value, &i32val,
sizeof(i32val));
577 case pwr_eType_Int64:
578 if (*String !=
'\0') {
579 if (sscanf(String, pwr_dFormatInt64, &i64val) != 1) {
584 memcpy(Value, &i64val,
sizeof(i64val));
587 case pwr_eType_UInt8:
588 while (*String && isspace(*String))
590 if (*String !=
'\0') {
591 ui32val = strtoul(String, &endp, 0);
592 if (errno == ERANGE || *endp !=
'\0' || ui32val > UCHAR_MAX
599 memcpy(Value, &ui8val,
sizeof(ui8val));
602 case pwr_eType_UInt16:
603 while (*String && isspace(*String))
605 if (*String !=
'\0') {
606 ui32val = strtoul(String, &endp, 0);
607 if (errno == ERANGE || *endp !=
'\0' || ui32val > USHRT_MAX
609 sts = CDH__INVUINT16;
614 memcpy(Value, &ui16val,
sizeof(ui16val));
617 case pwr_eType_UInt32:
619 while (*String && isspace(*String))
621 if (*String !=
'\0') {
622 ui32val = strtoul(String, &endp, 0);
623 if (errno == ERANGE || *endp !=
'\0' || ui32val > UINT_MAX
625 sts = CDH__INVUINT32;
629 memcpy(Value, &ui32val,
sizeof(ui32val));
632 case pwr_eType_UInt64:
633 if (*String !=
'\0') {
634 if (sscanf(String, pwr_dFormatUInt64, &ui64val) != 1) {
635 sts = CDH__INVUINT32;
639 memcpy(Value, &ui64val,
sizeof(ui64val));
642 case pwr_eType_String:
644 case pwr_eType_ProString:
645 strcpy(Value, String);
649 timlen = strlen(String);
654 memcpy(timbuf, String, MIN(
sizeof(timbuf), timlen));
655 timbuf[MIN(
sizeof(timbuf), timlen)] =
'\0';
661 memcpy(Value, &timeval,
sizeof(timeval));
664 case pwr_eType_DeltaTime:
665 timlen = strlen(String);
667 sts = CDH__INVDELTATIME;
670 memcpy(timbuf, String, MIN(
sizeof(timbuf), timlen));
671 timbuf[MIN(
sizeof(timbuf), timlen)] =
'\0';
674 sts = CDH__INVDELTATIME;
677 memcpy(Value, &dtimeval,
sizeof(dtimeval));
680 case pwr_eType_ClassId:
681 while (*String && isspace(*String))
683 if (*String !=
'\0') {
688 memcpy(Value, &cidval,
sizeof(cidval));
691 case pwr_eType_VolumeId:
692 while (*String && isspace(*String))
694 if (*String !=
'\0') {
699 memcpy(Value, &vidval,
sizeof(vidval));
702 case pwr_eType_TypeId:
703 while (*String && isspace(*String))
705 if (*String !=
'\0') {
710 memcpy(Value, &tidval,
sizeof(tidval));
713 case pwr_eType_ObjectIx:
714 while (*String && isspace(*String))
716 if (*String !=
'\0') {
721 memcpy(Value, &oixval,
sizeof(oixval));
740 m = 1 << (noofbits - 1);
742 for (i = 0; i < noofbits; i++) {
767 pwr_Assert(cid != NULL);
769 lcid.
pwr = pwr_cNClassId;
773 if (*s ==
'C' || *s ==
'c')
776 if (sscanf(s,
"%d.%d:%d%*s", &vid_1, &vid_0, &cix) != 3)
779 if (vid_1 > cdh_cMaxVidGroup || vid_0 > cdh_cMaxVidGroup || cix > cdh_cMaxCix)
782 lcid.
c.vid_1 = vid_1;
783 lcid.
c.vid_0 = vid_0;
810 pwr_Assert(oid != NULL);
812 loid.
pwr = pwr_cNObjid;
816 if (*s ==
'O' || *s ==
'o')
818 if (*s ==
'A' || *s ==
'a')
821 if (sscanf(s,
"%d.%d.%d.%d:%u%*s", &vid_3, &vid_2, &vid_1, &vid_0, &oix) != 5)
824 if (vid_3 > cdh_cMaxVidGroup || vid_2 > cdh_cMaxVidGroup
825 || vid_1 > cdh_cMaxVidGroup || vid_0 > cdh_cMaxVidGroup) {
830 loid.
o.vid_2 = vid_2;
831 loid.
o.vid_1 = vid_1;
832 loid.
o.vid_0 = vid_0;
863 pwr_Assert(aref != NULL);
867 for (t = s; *t; t++) {
868 if (state == 0 && *t ==
'(') {
872 }
else if (state == 1 && *t ==
')') {
879 }
else if (state == 2 && *t ==
'.') {
883 }
else if (state == 3 && *t ==
']') {
890 body_str[idx++] = *t;
892 offset_str[idx++] = *t;
894 size_str[idx++] = *t;
900 memset(&a, 0,
sizeof(a));
916 if (sscanf(offset_str,
"%u", &a.
Offset) != 1)
918 if (sscanf(size_str,
"%u", &a.
Size) != 1)
947 pwr_Assert(tid != NULL);
949 ltid.
pwr = pwr_cNTypeId;
953 if (*s ==
'T' || *s ==
't')
956 if (sscanf(s,
"%d.%d:%d.%d.%d%*s", &vid_1, &vid_0, &bit, &tyg, &tix) != 5)
959 if (vid_0 > cdh_cMaxVidGroup || vid_1 > cdh_cMaxVidGroup || bit > 1)
963 if (tyg > cdh_cMaxCix || tix > cdh_cMaxBix)
966 ltid.
c.vid_1 = vid_1;
967 ltid.
c.vid_0 = vid_0;
968 ltid.
c.must_be_zero = 0;
973 if (tyg > cdh_cMaxTyg || tix > cdh_cMaxTix)
976 ltid.
t.vid_1 = vid_1;
977 ltid.
t.vid_0 = vid_0;
978 ltid.
t.must_be_one = 1;
1004 pwr_Assert(vid != NULL);
1006 lvid.
pwr = pwr_cNVolumeId;
1010 if (*s ==
'V' || *s ==
'v')
1012 if (*s ==
'O' || *s ==
'o')
1014 if (*s ==
'A' || *s ==
'a')
1017 if (sscanf(s,
"%d.%d.%d.%d%*s", &vid_3, &vid_2, &vid_1, &vid_0) != 4)
1020 if (vid_3 > cdh_cMaxVidGroup || vid_2 > cdh_cMaxVidGroup
1021 || vid_1 > cdh_cMaxVidGroup || vid_0 > cdh_cMaxVidGroup)
1024 lvid.
v.vid_3 = vid_3;
1025 lvid.
v.vid_2 = vid_2;
1026 lvid.
v.vid_1 = vid_1;
1027 lvid.
v.vid_0 = vid_0;
1031 return CDH__SUCCESS;
1047 pwr_Assert(oix != NULL);
1052 if (*s ==
'X' || *s ==
'x')
1055 loix = strtoul(s, NULL, 0);
1056 if (errno == ERANGE || loix > cdh_cMaxOix)
1061 return CDH__SUCCESS;
1073 pwr_Assert(sid != NULL);
1079 if (*s ==
'S' || *s ==
's')
1082 if (sscanf(s,
"%d.%d.%d.%d:%u%*s", &vid_3, &vid_2, &vid_1, &vid_0, &six) != 5)
1085 if (vid_3 != cdh_eVid3_subid || vid_2 > cdh_cMaxVidGroup
1086 || vid_1 > cdh_cMaxVidGroup || vid_0 > cdh_cMaxVidGroup) {
1090 lrid.
r.vid_3 = vid_3;
1091 lrid.
r.vid_2 = vid_2;
1092 lrid.
r.vid_1 = vid_1;
1093 lrid.
r.vid_0 = vid_0;
1098 return CDH__SUCCESS;
1110 pwr_Assert(did != NULL);
1116 if (*s ==
'D' || *s ==
'd')
1119 if (sscanf(s,
"%d.%d.%d.%d:%u%*s", &vid_3, &vid_2, &vid_1, &vid_0, &dix) != 5)
1122 if (vid_3 != cdh_eVid3_dlid || vid_2 > cdh_cMaxVidGroup
1123 || vid_1 > cdh_cMaxVidGroup || vid_0 > cdh_cMaxVidGroup) {
1127 lrid.
r.vid_3 = vid_3;
1128 lrid.
r.vid_2 = vid_2;
1129 lrid.
r.vid_1 = vid_1;
1130 lrid.
r.vid_0 = vid_0;
1135 return CDH__SUCCESS;
1159 lcid.
c.bix != 0 || lcid.
c.must_be_zero != 0) {
1160 snprintf(s, size,
"%s%u.%u:?%u?", (prefix ?
"_C" :
""), lcid.
c.vid_1,
1161 lcid.
c.vid_0, lcid.
c.cix);
1163 snprintf(s, size,
"%s%u.%u:%u", (prefix ?
"_C" :
""), lcid.
c.vid_1,
1164 lcid.
c.vid_0, lcid.
c.cix);
1195 if (ltid.
t.must_be_one == 0) {
1196 snprintf(s, size,
"%s%u.%u:0.%u.%u", (prefix ?
"_T" :
""), ltid.
c.vid_1,
1197 ltid.
c.vid_0, ltid.
c.cix, ltid.
c.bix);
1199 snprintf(s, size,
"%s%u.%u:1.%u.%u", (prefix ?
"_T" :
""), ltid.
t.vid_1,
1200 ltid.
t.vid_0, ltid.
t.tyg, ltid.
t.tix);
1219 snprintf(s, size,
"%s%u", (prefix ?
"_X" :
""), oix);
1239 if (aref->
Body != pwr_cNTypeId) {
1244 sprintf(tmp,
"[%d.%d]", aref->
Offset, aref->
Size);
1249 sprintf(s,
"%s", (prefix ?
"_A" :
""));
1250 strncat(s, ls, size - strlen(s));
1269 static char ls[200];
1294 static char ls[
sizeof(
"_N255.255.255.255:")];
1298 sprintf(ls,
"%s%u.%u.%u.%u%s", (prefix ?
"_N" :
""), lvid.
v.vid_3,
1299 lvid.
v.vid_2, lvid.
v.vid_1, lvid.
v.vid_0, (suffix ?
":" :
""));
1302 return strcat(s, ls);
1323 snprintf(s, size,
"%s%u.%u.%u.%u:%u", (prefix ?
"_O" :
""), loid.
o.
vid_3,
1324 loid.
o.vid_2, loid.
o.vid_1, loid.
o.vid_0, loid.
o.oix);
1344 static char ls[
sizeof(
"_O255.255.255.255:4294967295")];
1348 sprintf(ls,
"%s%u.%u.%u.%u:%u", (prefix ?
"_O" :
""), loid.
o.
vid_3,
1349 loid.
o.vid_2, loid.
o.vid_1, loid.
o.vid_0, loid.
o.oix);
1371 static char str[40];
1375 sprintf(str,
"%3.3u_%3.3u_%3.3u_%3.3u_%8.8x", loid.
o.
vid_3, loid.
o.vid_2,
1376 loid.
o.vid_1, loid.
o.vid_0, loid.
o.oix);
1379 return strcat(s, str);
1403 char* s,
int size,
pwr_tVolumeId vid,
int prefix,
int suffix)
1406 static char ls[
sizeof(
"_V255.255.255.255:")];
1411 snprintf(s, size,
"%s%u.%u.%u.%u%s", (prefix ?
"_V" :
""), lvid.
v.vid_3,
1412 lvid.
v.vid_2, lvid.
v.vid_1, lvid.
v.vid_0, (suffix ?
":" :
""));
1415 sprintf(ls,
"%s%u.%u.%u.%u%s", (prefix ?
"_V" :
""), lvid.
v.vid_3,
1416 lvid.
v.vid_2, lvid.
v.vid_1, lvid.
v.vid_0, (suffix ?
":" :
""));
1435 snprintf(s, size,
"%3.3u_%3.3u_%3.3u_%3.3u", lvid.
v.vid_3, lvid.
v.vid_2,
1436 lvid.
v.vid_1, lvid.
v.vid_0);
1457 snprintf(s, size,
"%s%u.%u.%u.%u:%u", (prefix ?
"_S" :
""), lrid.
r.vid_3,
1458 lrid.
r.vid_2, lrid.
r.vid_1, lrid.
r.vid_0, lrid.
r.rix);
1477 snprintf(s, size,
"%s%u.%u.%u.%u:%u", (prefix ?
"_D" :
""), lrid.
r.vid_3,
1478 lrid.
r.vid_2, lrid.
r.vid_1, lrid.
r.vid_0, lrid.
r.rix);
1483 cdh_ObjName(&f->name, name);
1496 for (s = on->orig, t = on->norm; *s;) {
1497 utf_len = str_Utf8Len((
unsigned char*)s);
1498 if (t - on->norm + utf_len >
sizeof(
pwr_tObjName) - 1) {
1502 str_ToNormUtf8((
unsigned char*)t, (
unsigned char*)s);
1507 on->pack.key = cdh_PackName(on->norm);
1512 #define IDX_UTF8 256
1544 static const char* cvttab[] = {
1546 ~+++++++++++++++++++++++++++++++\
1547 +*******************************\
1548 ********************************\
1549 ********************************\
1550 ++++++++++++++++++++++++++++++++\
1551 ********************************\
1552 ********************************\
1553 ********************************\
1557 ~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1558 !!!!!!!!*!!!!-.!0123456789:!!!!!\
1559 !A!CD!!!!!!!!!!O!!!ST!V!X!!!!!!_\
1560 !^!^^!!!!!!!!!!^!!!^^!^!^!!!!!!!\
1561 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1562 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1563 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1564 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1568 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1569 !!!!$!!!!!!!!!!!0123456789*!!!!!\
1570 !ABCDEFGHIJKLMNOPQRSTUVWXYZ!!!!_\
1571 !^^^^^^^^^^^^^^^^^^^^^^^^^^!!!!!\
1572 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1573 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1574 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1575 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1579 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1580 !!!!$!!!!*!!!-!!0123456789!!!!!!\
1581 !ABCDEFGHIJKLMNOPQRSTUVWXYZ!!!!_\
1582 !^^^^^^^^^^^^^^^^^^^^^^^^^^!!!!!\
1583 !!!!!!!!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7tab[] = {
"\
1737 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1738 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1739 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1740 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1741 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1742 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
1743 AAAAAAACEEEEIIII!NOOOOOOOUUUUY!!\
1744 aaaaaaaceeeeiiii!nooooooouuuuy!!\
1748 if (len >=
sizeof(origName)) {
1749 *sts = CDH__NAMELEN;
1756 memset(pn, 0,
sizeof(*pn));
1760 pn->flags.
b.parent = 1;
1762 pn->parseFlags.m = flags;
1775 while (inp <= name + len) {
1777 utf_len = str_Utf8Len((
unsigned char*)inp);
1779 if (cvttab[state][IDX_UTF8] ==
'!') {
1780 printf(
"State: %d, %c\n", state, c);
1781 lsts = CDH__INVCHAR;
1784 c = cvttab[state][IDX_UTF8];
1786 if (cvttab[state][c] ==
'!') {
1787 printf(
"State: %d, %c\n", state, c);
1788 lsts = CDH__INVCHAR;
1790 }
else if (cvttab[state][c] ==
'^')
1793 c = cvttab[state][c];
1795 if (pn->parseFlags.
b.ascii_7 && ascii7tab[c] !=
'!') {
1806 }
else if (*inp ==
'.') {
1809 }
else if (pn->flags.
b.parent) {
1814 }
else if (c ==
'~') {
1817 }
else if (c ==
'+') {
1829 pn->flags.
b.idString = 1;
1852 lsts = cdh_StringToSubid(segp, &pn->uId.sid);
1856 lsts = cdh_StringToDlid(segp, &pn->uId.did);
1864 lsts = CDH__INVIDCHAR;
1872 }
else if (c ==
'*') {
1874 lsts = CDH__INVSYNTAX;
1879 pn->flags.
b.idString = 1;
1884 if (*(inp + 1) ==
'_')
1890 lsts = CDH__INVIDCHAR;
1899 }
else if (c ==
'-') {
1901 lsts = CDH__INVSYNTAX;
1906 pn->flags.
b.parent = 1;
1914 lsts = CDH__INVIDCHAR;
1932 lsts = CDH__INVTYPENAME;
1941 strcpy(pn->body[pn->nBody].name.orig, segcp);
1942 strcpy(pn->body[pn->nBody].name.norm, segp);
1943 pn->body[pn->nBody].name.pack.key = cdh_PackName(segp);
1959 lsts = CDH__INVTYPENAME;
1964 pn->flags.
b.bodyName = 1;
1969 strcpy(pn->body[pn->nBody].name.orig, segcp);
1970 strcpy(pn->body[pn->nBody].name.norm, segp);
1971 pn->body[pn->nBody].name.pack.key = cdh_PackName(segp);
1977 }
else if (c ==
'-') {
1979 lsts = CDH__INVTYPENAME;
1988 strcpy(pn->body[pn->nBody].name.orig, segcp);
1989 strcpy(pn->body[pn->nBody].name.norm, segp);
1990 pn->body[pn->nBody].name.pack.key = cdh_PackName(segp);
2007 pn->flags.
b.attribute = 1;
2012 strcpy(pn->attribute[0].name.orig, segcp);
2013 strcpy(pn->attribute[0].name.norm, segp);
2014 pn->attribute[0].name.pack.key = cdh_PackName(segp);
2019 }
else if (c ==
'*') {
2021 lsts = CDH__INVATTRNAME;
2026 pn->flags.
b.attribute = 1;
2031 strcpy(pn->attribute[0].name.orig, segcp);
2032 strcpy(pn->attribute[0].name.norm, segp);
2033 pn->attribute[0].name.pack.key = cdh_PackName(segp);
2056 pn->uId.aref.
Body = pn->bid;
2057 pn->flags.
b.bodyId = 1;
2061 if (*(inp + 1) ==
'[') {
2077 lsts = CDH__INVCHAR;
2082 pn->flags.
b.object = 1;
2087 strcpy(pn->object[pn->nObject].name.orig, segcp);
2088 strcpy(pn->object[pn->nObject].name.norm, segp);
2089 pn->object[pn->nObject].name.pack.key = cdh_PackName(segp);
2094 }
else if (c ==
'*') {
2096 lsts = CDH__INVCHAR;
2106 strcpy(pn->volume.name.orig, segcp);
2107 strcpy(pn->volume.name.norm, segp);
2108 pn->volume.name.pack.key = cdh_PackName(segp);
2109 pn->flags.
b.volume = 1;
2111 }
else if (*inp ==
'-') {
2112 pn->flags.
b.object = 1;
2117 strcpy(pn->object[pn->nObject].name.orig, segcp);
2118 strcpy(pn->object[pn->nObject].name.norm, segp);
2119 pn->object[pn->nObject].name.pack.key = cdh_PackName(segp);
2122 }
else if (*inp ==
'.') {
2123 pn->flags.
b.object = 1;
2128 strcpy(pn->object[pn->nObject].name.orig, segcp);
2129 strcpy(pn->object[pn->nObject].name.norm, segp);
2130 pn->object[pn->nObject].name.pack.key = cdh_PackName(segp);
2139 str_CpyUtf8((
unsigned char*)outcp, (
unsigned char*)inp);
2140 str_ToNormUtf8((
unsigned char*)outp, (
unsigned char*)inp);
2158 pn->flags.
b.object = 1;
2163 strcpy(pn->object[pn->nObject].name.orig, segcp);
2164 strcpy(pn->object[pn->nObject].name.norm, segp);
2165 pn->object[pn->nObject].name.pack.key = cdh_PackName(segp);
2171 }
else if (c ==
'*') {
2173 lsts = CDH__INVCHAR;
2178 pn->flags.
b.object = 1;
2183 strcpy(pn->object[pn->nObject].name.orig, segcp);
2184 strcpy(pn->object[pn->nObject].name.norm, segp);
2185 pn->object[pn->nObject].name.pack.key = cdh_PackName(segp);
2191 }
else if (c ==
'-') {
2193 lsts = CDH__INVCHAR;
2198 pn->flags.
b.object = 1;
2203 strcpy(pn->object[pn->nObject].name.orig, segcp);
2204 strcpy(pn->object[pn->nObject].name.norm, segp);
2205 pn->object[pn->nObject].name.pack.key = cdh_PackName(segp);
2212 str_CpyUtf8((
unsigned char*)outcp, (
unsigned char*)inp);
2213 str_ToNormUtf8((
unsigned char*)outp, (
unsigned char*)inp);
2229 lsts = CDH__INVATTRNAME;
2234 pn->flags.
b.attribute = 1;
2239 strcpy(pn->attribute[pn->nAttribute].name.orig, segcp);
2240 strcpy(pn->attribute[pn->nAttribute].name.norm, segp);
2241 pn->attribute[pn->nAttribute].name.pack.key = cdh_PackName(segp);
2246 }
else if (c ==
'*') {
2248 lsts = CDH__INVATTRNAME;
2253 pn->flags.
b.attribute = 1;
2258 strcpy(pn->attribute[pn->nAttribute].name.orig, segcp);
2259 strcpy(pn->attribute[pn->nAttribute].name.norm, segp);
2260 pn->attribute[pn->nAttribute].name.pack.key = cdh_PackName(segp);
2266 }
else if (c ==
'.') {
2268 lsts = CDH__INVATTRNAME;
2273 pn->flags.
b.attribute = 1;
2278 strcpy(pn->attribute[pn->nAttribute].name.orig, segcp);
2279 strcpy(pn->attribute[pn->nAttribute].name.norm, segp);
2280 pn->attribute[pn->nAttribute].name.pack.key = cdh_PackName(segp);
2287 str_CpyUtf8((
unsigned char*)outcp, (
unsigned char*)inp);
2288 str_ToNormUtf8((
unsigned char*)outp, (
unsigned char*)inp);
2309 pn->index[pn->nAttribute - 1] = number;
2310 pn->hasIndex[pn->nAttribute - 1] = 1;
2311 pn->flags.
b.index = 1;
2314 pn->offset = number;
2315 pn->uId.aref.
Offset = pn->offset;
2319 pn->uId.aref.
Size = pn->size;
2320 pn->flags.
b.index = 1;
2326 number = number * 10 + (c -
'0');
2327 if (number > 65535) {
2328 lsts = CDH__INVATTRINDEX;
2347 if (pn->nObject > 1)
2348 pn->flags.
b.path = 1;
2360 unsigned int len = strlen(name);
2361 const char* s = name;
2362 unsigned char hash = 0;
2365 hash = (hash * 3) ^ *s++;
2369 pack.
c.first = name[0];
2370 pack.
c.last = name[len - 1];
2383 static char buf[500];
2385 return str_ToLower(buf, (
char*)s);
2398 static char str[32];
2401 case pwr_mOpSys_PPC_LINUX:
2402 strcpy(str,
"ppc_linux");
2404 case pwr_mOpSys_X86_LINUX:
2405 strcpy(str,
"x86_linux");
2407 case pwr_mOpSys_X86_64_LINUX:
2408 strcpy(str,
"x86_64_linux");
2410 case pwr_mOpSys_X86_64_MACOS:
2411 strcpy(str,
"x86_64_macos");
2413 case pwr_mOpSys_ARM_LINUX:
2414 strcpy(str,
"arm_linux");
2416 case pwr_mOpSys_ARM64_LINUX:
2417 strcpy(str,
"arm64_linux");
2419 case pwr_mOpSys_X86_64_FREEBSD:
2420 strcpy(str,
"x86_64_freebsd");
2422 case pwr_mOpSys_X86_64_OPENBSD:
2423 strcpy(str,
"x86_64_openbsd");
2425 case pwr_mOpSys_X86_CYGWIN:
2426 strcpy(str,
"x86_cygwin");
2444 static char str[80];
2447 case pwr_mOpSys_PPC_LINUX:
2448 strcpy(str,
"os_linux/hw_ppc");
2450 case pwr_mOpSys_X86_LINUX:
2451 strcpy(str,
"os_linux/hw_x86");
2453 case pwr_mOpSys_X86_64_LINUX:
2454 strcpy(str,
"os_linux/hw_x86_64");
2456 case pwr_mOpSys_X86_64_MACOS:
2457 strcpy(str,
"os_macos/hw_x86_64");
2459 case pwr_mOpSys_ARM_LINUX:
2460 strcpy(str,
"os_linux/hw_arm");
2462 case pwr_mOpSys_ARM64_LINUX:
2463 strcpy(str,
"os_linux/hw_arm64");
2465 case pwr_mOpSys_X86_64_FREEBSD:
2466 strcpy(str,
"os_freebsd/hw_x86_64");
2468 case pwr_mOpSys_X86_64_OPENBSD:
2469 strcpy(str,
"os_openbsd/hw_x86_64");
2471 case pwr_mOpSys_X86_CYGWIN:
2472 strcpy(str,
"os_cygwin/hw_x86");
2480 int cdh_IsClassVolume(
pwr_tVid vid)
2492 if (arp->
Flags.
b.DisableAttr)
2493 cast_aref.
Offset -= pwr_cAlignLW;
2494 cast_aref.
Offset -= pwr_cAlignLW;
2496 cast_aref.
Flags.
b.ObjectAttr = 0;
2497 cast_aref.
Flags.
b.CastAttr = 0;
2498 cast_aref.
Flags.
b.DisableAttr = 0;
2499 cast_aref.
Flags.
b.Indirect = 0;
2508 dis_aref.
Offset -= pwr_cAlignLW;
2510 dis_aref.
Flags.
b.ObjectAttr = 0;
2511 dis_aref.
Flags.
b.CastAttr = 0;
2512 dis_aref.
Flags.
b.DisableAttr = 0;
2525 void cdh_SuppressSuper(
char* out,
char* in)
2528 while (str_StartsWith(s,
"Super."))
2533 void cdh_SuppressSuperAll(
char* out,
char* in)
2537 for (s = in, t = out; *s;) {
2538 if (str_StartsWith(s,
"Super."))
2549 int cdh_TypeToMaxStrSize(pwr_eType type,
int attr_size,
int attr_elements)
2554 case pwr_eType_Boolean:
2557 case pwr_eType_Int64:
2560 case pwr_eType_UInt64:
2563 case pwr_eType_Enum:
2564 case pwr_eType_Mask:
2565 case pwr_eType_Status:
2566 case pwr_eType_NetStatus:
2567 case pwr_eType_Int32:
2570 case pwr_eType_UInt32:
2573 case pwr_eType_Int16:
2576 case pwr_eType_UInt16:
2579 case pwr_eType_Int8:
2582 case pwr_eType_UInt8:
2585 case pwr_eType_Char:
2588 case pwr_eType_Float32:
2591 case pwr_eType_Float64:
2594 case pwr_eType_Time:
2597 case pwr_eType_DeltaTime:
2600 case pwr_eType_AttrRef:
2603 case pwr_eType_TypeId:
2604 case pwr_eType_ClassId:
2605 case pwr_eType_Objid:
2608 case pwr_eType_VolumeId:
2611 case pwr_eType_String:
2612 case pwr_eType_Text:
2613 size = attr_size / attr_elements - 1;
2621 int cdh_TypeToSize(pwr_eType type)
2626 case pwr_eType_Boolean:
2629 case pwr_eType_Enum:
2632 case pwr_eType_Mask:
2635 case pwr_eType_Status:
2636 case pwr_eType_NetStatus:
2639 case pwr_eType_Int64:
2640 case pwr_eType_UInt64:
2641 size =
sizeof(pwr_tInt64);
2643 case pwr_eType_Int32:
2644 case pwr_eType_UInt32:
2647 case pwr_eType_Int16:
2648 case pwr_eType_UInt16:
2651 case pwr_eType_Int8:
2652 case pwr_eType_UInt8:
2655 case pwr_eType_Char:
2658 case pwr_eType_Float32:
2661 case pwr_eType_Float64:
2664 case pwr_eType_Time:
2665 size =
sizeof(pwr_tTime);
2667 case pwr_eType_DeltaTime:
2670 case pwr_eType_AttrRef:
2673 case pwr_eType_TypeId:
2676 case pwr_eType_ClassId:
2679 case pwr_eType_ObjectIx:
2682 case pwr_eType_RefId:
2685 case pwr_eType_CastId:
2688 case pwr_eType_DisableAttr:
2691 case pwr_eType_Objid:
2694 case pwr_eType_VolumeId:
2715 static const char valtab[] =
"\
2716 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
2717 !!!!$!!!!!!!!!!!0123456789!!!!!!\
2718 !ABCDEFGHIJKLMNOPQRSTUVWXYZ!!!!_\
2719 !^^^^^^^^^^^^^^^^^^^^^^^^^^!!!!!\
2720 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
2721 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
2722 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\
2723 ^^^^^^^^^^^^^^^^!^^^^^^^^^^^^^!!";
2734 len = str_Utf8Len((
unsigned char*)s1);
2736 strncpy(t, s1, len);
2740 if (valtab[(
unsigned char)*s1] ==
'!') {
2769 int len = strlen(s);
2772 for (i = len - 1; i >= 0; i--) {
2773 if (isdigit(s[i]) == 0)
2779 strncpy(name, s, i + 1);
2780 sscanf(&s[i + 1],
"%d", &num);
2782 if (s[i + 1] ==
'0')
2783 sprintf(&name[i + 1],
"%0*d", len - i - 1, num);
2785 sprintf(&name[i + 1],
"%d", num);
2788 return CDH__NAMELEN;
2791 return CDH__SUCCESS;
2806 int i, j, last_i = 0;
2808 if (segments == 0) {
2809 strcpy(outname,
"");
2813 for (i = 0; i < segments; i++) {
2814 s[i] = strrchr(name,
'-');
2822 for (j = 0; j <= last_i; j++) {
2827 strcpy(outname, name);
2829 strcpy(outname, s[last_i] + 1);
2838 if (info->Flags & PWR_MASK_POINTER && !(info->Flags & PWR_MASK_PRIVATE))
2840 return sizeof(pwr_tUInt64) * info->Elements;
Include file for Cdh Class definition handler.
Include file for Time management.
#define cdh_cManufactClassVolMax
Largest value of volume identity for manufacturer classvolumes.
#define cdh_cManufactClassVolMin
Smallest value of volume identity for manufacturer classvolumes.
#define cdh_cSystemClassVolMin
Smallest value of volume identity for system classvolumes.
#define cdh_cUserClassVolMin
Smallest value of volume identity for user classvolumes.
#define cdh_cSystemClassVolMax
Largest value of volume identity for system classvolumes.
#define cdh_cUserClassVolMax
Largest value of volume identity for user classvolumes.
@ cdh_eId_objid
Object identity.
@ cdh_eId_objectIx
Object index.
@ cdh_eId_typeId
Type identity.
@ cdh_eId_volumeId
Volume identity.
@ cdh_eId_classId
Class identity.
@ cdh_eId_dlid
Direct link identity.
@ cdh_eId_aref
Attribute reference.
@ cdh_eId_subid
Subscription identity.
char * cdh_VolumeIdToString(char *s, int size, pwr_tVolumeId vid, int prefix, int suffix)
Converts a volume identifier, 'vid' to a string.
void cdh_DlidToString(char *s, int size, pwr_tDlid did, int prefix)
Converts a direct link identifier, 'did' to a string.
int cdh_ObjidIsNull(pwr_tObjid Objid)
Test if object identity is null.
char * cdh_ObjidToFnString(char *s, pwr_tOid oid)
Converts a object identifier, 'oid' to a filename string.
pwr_tStatus cdh_StringToAref(const char *s, pwr_tAttrRef *aref)
Convert AttrRef string to id.
void cdh_ObjectIxToString(char *s, int size, pwr_tObjectIx oix, int prefix)
Converts a object index, 'oix' to a string.
char * cdh_AttrRefToString(pwr_sAttrRef *aref, int prefix)
Converts an attribute reference , 'aref' to a string.
int cdh_ObjidIsNotNull(pwr_tObjid Objid)
Test if object identity is not null.
char * cdh_VolumeIdToFnString(char *s, int size, pwr_tVolumeId vid)
Converts a volume identifier, 'vid' to a filename string.
pwr_tStatus cdh_StringToObjid(const char *s, pwr_tObjid *oid)
Convert Objid string to id.
char * cdh_OpSysToDirStr(pwr_mOpSys opsys)
Convert operating system to directory string.
pwr_tStatus cdh_AttrValueToString(pwr_eType Type, void *Value, char *String, int MaxSize)
Converts an attribute given in internal binary format to a text string.
pwr_tStatus cdh_StringToClassId(const char *s, pwr_tClassId *cid)
Convert ClassId string to id.
void cdh_CutNameSegments(char *outname, char *name, int segments)
Cut the leading segments of an object name.
char * cdh_Low(const char *s)
Convert string to lower case.
char * cdh_StringToObjectName(char *t, const char *s)
Convert string to valid object name.
pwr_tStatus cdh_StringToVolumeId(const char *s, pwr_tVolumeId *vid)
Convert VolumeId string to id.
void cdh_SubidToString(char *s, int size, pwr_tSubid sid, int prefix)
Converts a subscription identifier, 'sid' to a string.
pwr_tUInt32 cdh_AttrElemSize(pwr_sParInfo *info)
Get attribute array element size.
void cdh_MaskToBinaryString(unsigned int mask, int noofbits, char *str)
pwr_tStatus cdh_StringToObjectIx(const char *s, pwr_tObjectIx *oix)
Converts ObjectIx string to index.
void cdh_TypeIdToString(char *s, int size, pwr_tTypeId tid, int prefix)
Converts a type identifier, 'tid' to a string.
void cdh_OidToString(char *s, int size, pwr_tObjid oid, int prefix)
Converts a object identifier, 'oid' to a string.
void cdh_ClassIdToString(char *s, int size, pwr_tClassId cid, int prefix)
Converts a class identifier, 'cid' to a string.
pwr_tClassId cdh_ClassObjidToId(pwr_tObjid Objid)
Convert Objid to ClassId.
pwr_tStatus cdh_NextObjectName(char *t, const char *s)
Create an similar objectname from another object name.
pwr_tObjid cdh_ClassIdToObjid(pwr_tClassId Class)
Convert ClassId to Objid.
pwr_tTypeId cdh_TypeObjidToId(pwr_tObjid Objid)
Convert Objid to TypeId.
int cdh_ObjidCompare(pwr_tObjid Objid_1, pwr_tObjid Objid_2)
Compare two object identities.
pwr_tStatus cdh_StringToAttrValue(pwr_eType Type, const char *String, void *Value)
int cdh_ObjidIsEqual(pwr_tObjid Objid_1, pwr_tObjid Objid_2)
Test if two object identities are equal.
void cdh_ArefToString(char *s, int size, pwr_sAttrRef *aref, int prefix)
Converts an attribute reference , 'aref' to a string.
int cdh_ObjidIsNotEqual(pwr_tObjid Objid_1, pwr_tObjid Objid_2)
Test if two object identities are different.
char * cdh_OpSysToStr(pwr_mOpSys opsys)
Convert operating system to string.
pwr_sAttrRef cdh_ObjidToAref(pwr_tObjid Objid)
Converts an objid to an attrref.
pwr_tObjid cdh_TypeIdToObjid(pwr_tTypeId Type)
Convert TypeId to Objid.
pwr_tStatus cdh_StringToTypeId(const char *s, pwr_tTypeId *tid)
Convert TypeId string to id.
int cdh_TypeIdToIndex(pwr_tTypeId Type)
Convert TypeId to index.
char * cdh_NodeIdToString(char *s, pwr_tNodeId nid, int prefix, int suffix)
Converts a volume identifier, 'vid' to a string.
char * cdh_ObjidToString(pwr_tObjid oid, int prefix)
Converts a object identifier, 'oid' to a string.
pwr_tUInt32 cdh_AttrSize(pwr_sParInfo *info)
Get attribute size.
@ time_eFormat_DateAndTime
Display date and time, 01-JAN-1970 01:00:00.00.
pwr_tStatus time_AsciiToA(const char *, pwr_tTime *)
Convert ascii time to timespec.
pwr_tStatus time_AsciiToD(const char *, pwr_tDeltaTime *)
Convert ascii to timespec.
pwr_tStatus time_DtoAscii(pwr_tDeltaTime *, int, char *, int)
Convert a delta time to ascii string.
pwr_tStatus time_AtoAscii(pwr_tTime *, time_eFormat, char *, int)
Convert timespec to ascii.
#define EVEN(a)
Check if value is even.
unsigned int pwr_tUInt32
32-bit unsigned integer type.
char pwr_tAName[399+1]
Full Aref Name type.
double pwr_tFloat64
64-bit float.
char pwr_tChar
Character type.
pwr_tNid pwr_tNodeId
Node identity type.
unsigned int pwr_tVid
Volume identity type.
pwr_tOix pwr_tObjectIx
Object index type.
pwr_tTypeId pwr_tCastId
CastId type.
#define pwr_cNDlid
Zero direct link identity constant.
pwr_tTid pwr_tTypeId
Type identity type.
unsigned int pwr_tBoolean
Boolean type.
pwr_tCid pwr_tClassId
Class identity type.
char pwr_tInt8
8-bit integer type.
pwr_tRid pwr_tSubid
Subscription identity type.
pwr_tOid pwr_tObjid
Object identity type.
short pwr_tInt16
16-bit integer type.
int pwr_tInt32
32-bit integer type.
#define pwr_cNSubid
Zero subscription identity constant.
unsigned char pwr_tUInt8
8-bit unsigned integer type.
int pwr_tStatus
Status type.
pwr_tInt32 pwr_tEnum
Enumeration type.
pwr_tVid pwr_tVolumeId
Volume identity type.
pwr_tRid pwr_tDlid
Direct link identity type.
char pwr_tOName[199+1]
Full Object Name type.
#define ODD(a)
Check if value is odd.
pwr_tRid pwr_tRefId
Reference identity type.
unsigned int pwr_tDisableAttr
DisableAttr type.
unsigned short pwr_tUInt16
16-bit unsigned integer type.
char pwr_tObjName[31+1]
Object name type.
pwr_tUInt32 pwr_tMask
Mask type.
float pwr_tFloat32
32-bit float.
unsigned int vid_3
Object index.
pwr_tUInt32 Size
Attribute size.
pwr_tCid Body
Typeid of attribute, body or class.
pwr_tOid Objid
Object identity.
pwr_mAttrRef Flags
Attribute flags.
pwr_tUInt32 Offset
Offset in body.
struct cdh_mName::@4 b
Bit mask representation.
struct cdh_mParseName::@3 b
Bitmask representation.
Type for representions of object identity.
cdh_mClassObjid c
ClassDef object representation.
cdh_mObjid o
Common object representation.
pwr_tOid pwr
Extern representation.
cdh_mTypeObjid t
TypeDef object representation.
struct cdh_uPackName::@2 c
Name structure.
Type for representations of reference identity.
cdh_mRid r
Intern representation.
pwr_tRid pwr
Extern representation.
Type for representation of type identity.
cdh_mCid c
Class identity representation.
cdh_mTid t
Type identity representation.
pwr_tCid pwr
Extern representation.
Type for representation of volume identity.
cdh_mVid v
Intern representation.
pwr_tVid pwr
Extern representation.
struct pwr_mAttrRef::@1 b
Bitmask representation.