Changeset 108326 in vbox
- Timestamp:
- Feb 21, 2025 1:52:50 PM (2 months ago)
- svn:sync-xref-src-repo-rev:
- 167676
- Location:
- trunk/src/libs/xpcom18a4/xpcom
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/components/nsIClassInfo.idl
r1 r108326 101 101 * Bitflags for 'flags' attribute. 102 102 */ 103 const PRUint32 SINGLETON = 1 << 0;104 const PRUint32 THREADSAFE = 1 << 1;105 const PRUint32 MAIN_THREAD_ONLY = 1 << 2;106 const PRUint32 DOM_OBJECT = 1 << 3;107 const PRUint32 PLUGIN_OBJECT = 1 << 4;108 const PRUint32 EAGER_CLASSINFO = 1 << 5;103 const PRUint32 SINGLETON = 0x01; 104 const PRUint32 THREADSAFE = 0x02; 105 const PRUint32 MAIN_THREAD_ONLY = 0x04; 106 const PRUint32 DOM_OBJECT = 0x08; 107 const PRUint32 PLUGIN_OBJECT = 0x10; 108 const PRUint32 EAGER_CLASSINFO = 0x20; 109 109 /** 110 110 * 'flags' attribute bitflag: whether objects of this type implement 111 111 * nsIContent. 112 112 */ 113 const PRUint32 CONTENT_NODE = 1 << 6;113 const PRUint32 CONTENT_NODE = 0x40; 114 114 115 115 // The high order bit is RESERVED for consumers of these flags. 116 116 // No implementor of this interface should ever return flags 117 117 // with this bit set. 118 const PRUint32 RESERVED = 1 << 31;118 const PRUint32 RESERVED = 0x80000000; 119 119 120 120 -
trunk/src/libs/xpcom18a4/xpcom/components/nsIComponentManager.idl
r1 r108326 109 109 #include "nsComponentManagerObsolete.h" 110 110 #endif 111 %} C++111 %} -
trunk/src/libs/xpcom18a4/xpcom/components/nsIComponentManagerObsolete.idl
r1 r108326 348 348 /* include after the class def'n, because it needs to see it. */ 349 349 #include "nsComponentManagerUtils.h" 350 %} C++351 350 %} 351 -
trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_header.c
r108324 r108326 231 231 static int write_param(PCXPIDLNODE pNd, FILE *pFile) 232 232 { 233 PCXPIDLNODE pNdTypeSpec = pNd->u.Param.pNdTypeSpec;233 PCXPIDLNODE pNdTypeSpec = find_underlying_type(pNd->u.Param.pNdTypeSpec); 234 234 bool is_in = pNd->u.Param.enmDir == kXpidlDirection_In; 235 235 /* in string, wstring, nsid, domstring, utf8string, cstring and … … 239 239 if (is_in && 240 240 (xpidlNdIsStringType(pNdTypeSpec) || 241 // IDL_tree_property_get(IDL_PARAM_DCL(param_tree).simple_declarator, 242 // "const") || 241 xpidlNodeAttrFind(pNd, "const") || 243 242 xpidlNodeAttrFind(pNdTypeSpec, "nsid") || 244 243 xpidlNodeAttrFind(pNdTypeSpec, "domstring") || … … 253 252 } 254 253 255 int rc = xpidlHdrWriteType(pNdTypeSpec, pFile); 254 int rc = xpidlHdrWriteType(pNd->u.Param.pNdTypeSpec, pFile); 255 AssertRC(rc); 256 256 if (RT_FAILURE(rc)) 257 257 return rc; … … 321 321 } 322 322 323 #if 0324 323 /* make IDL return value into trailing out argument */ 325 if (op->op_type_spec && !op_notxpcom) { 326 IDL_tree fake_param = IDL_param_dcl_new(IDL_PARAM_OUT, 327 op->op_type_spec, 328 IDL_ident_new("_retval")); 329 if (!fake_param) 330 return FALSE; 331 if (!write_param(fake_param, pFile)) 332 return FALSE; 324 if ( pNd->u.Method.pNdTypeSpecRet 325 && ( pNd->u.Method.pNdTypeSpecRet->enmType != kXpidlNdType_BaseType 326 || pNd->u.Method.pNdTypeSpecRet->u.enmBaseType != kXpidlType_Void) 327 && !op_notxpcom) 328 { 329 if (!no_generated_args) 330 fputs(", ", pFile); 331 XPIDLNODE Nd; 332 Nd.enmType = kXpidlNdType_Parameter; 333 Nd.u.Param.pszName = "_retval"; 334 Nd.u.Param.enmDir = kXpidlDirection_Out; 335 Nd.u.Param.pNdTypeSpec = pNd->u.Method.pNdTypeSpecRet; 336 int rc = write_param(&Nd, pFile); 337 if (RT_FAILURE(rc)) 338 { 339 AssertFailed(); 340 return VERR_INVALID_PARAMETER; 341 } 333 342 334 343 #if 0 … … 338 347 no_generated_args = false; 339 348 } 340 #endif341 349 342 350 #if 0 /** @todo No varargs allowed. */ … … 443 451 * cstring and astring get const. 444 452 */ 453 PCXPIDLNODE pNdTypeSpec = find_underlying_type(pNd->u.Attribute.pNdTypeSpec); 454 445 455 if (!getter && 446 (xpidlNdIsStringType(pNd ->u.Attribute.pNdTypeSpec) ||447 xpidlNodeAttrFind(pNd , "nsid") ||448 xpidlNodeAttrFind(pNd , "domstring") ||449 xpidlNodeAttrFind(pNd , "utf8string") ||450 xpidlNodeAttrFind(pNd , "cstring") ||451 xpidlNodeAttrFind(pNd , "astring")))456 (xpidlNdIsStringType(pNdTypeSpec) || 457 xpidlNodeAttrFind(pNdTypeSpec, "nsid") || 458 xpidlNodeAttrFind(pNdTypeSpec, "domstring") || 459 xpidlNodeAttrFind(pNdTypeSpec, "utf8string") || 460 xpidlNodeAttrFind(pNdTypeSpec, "cstring") || 461 xpidlNodeAttrFind(pNdTypeSpec, "astring"))) 452 462 fputs("const ", pFile); 453 463 … … 456 466 return rc; 457 467 fprintf(pFile, "%s%s", 458 (STARRED_TYPE(pNd ->u.Attribute.pNdTypeSpec) ? "" : " "),459 (getter && !DIPPER_TYPE(pNd ->u.Attribute.pNdTypeSpec) ? "*" : ""));468 (STARRED_TYPE(pNdTypeSpec) ? "" : " "), 469 (getter && !DIPPER_TYPE(pNdTypeSpec) ? "*" : "")); 460 470 } 461 471 fprintf(pFile, "a%c%s)", toupper(pszName[0]), pszName + 1); … … 525 535 return VERR_INVALID_PARAMETER; 526 536 527 #define FAIL do { rc = VERR_INVALID_PARAMETER; goto out;} while(0)537 #define FAIL do {AssertFailed(); rc = VERR_INVALID_PARAMETER; goto out;} while(0) 528 538 529 539 fprintf(pFile, "\n/* starting interface: %s */\n", pNd->u.If.pszIfName); … … 587 597 */ 588 598 bool keepvtable = false; 589 #if 0 /* We don't allow code fragments in interface definitions. */ 590 for (iter = IDL_INTERFACE(state->tree).body;591 iter != NULL;592 iter = IDL_LIST(iter).next)593 {594 IDL_tree data = IDL_LIST(iter).data;595 if (IDL_NODE_TYPE(data) == IDLN_CODEFRAG)596 keepvtable = TRUE;597 } 598 #endif 599 PCXPIDLNODE pIt; 600 RTListForEach(&pNd->u.If.LstBody, pIt, XPIDLNODE, NdLst) 601 { 602 if (pIt->enmType == kXpidlNdType_RawBlock) 603 { 604 keepvtable = true; 605 break; 606 } 607 } 608 599 609 600 610 /* The interface declaration itself. */ … … 614 624 fputs(")\n\n", pFile); 615 625 616 PCXPIDLNODE pIt;617 626 RTListForEach(&pNd->u.If.LstBody, pIt, XPIDLNODE, NdLst) 618 627 { … … 633 642 if (RT_FAILURE(rc)) 634 643 FAIL; 644 break; 645 case kXpidlNdType_RawBlock: 646 fprintf(pFile, "%.*s", (int)pIt->u.RawBlock.cchRaw, pIt->u.RawBlock.pszRaw); 635 647 break; 636 648 default: … … 670 682 { 671 683 case kXpidlNdType_Const: 684 case kXpidlNdType_RawBlock: 672 685 /* ignore it here; it doesn't contribute to the macro. */ 673 686 continue; … … 728 741 { 729 742 case kXpidlNdType_Const: 743 case kXpidlNdType_RawBlock: 730 744 continue; 731 745 case kXpidlNdType_Attribute: … … 798 812 { 799 813 case kXpidlNdType_Const: 814 case kXpidlNdType_RawBlock: 800 815 continue; 801 816 case kXpidlNdType_Attribute: -
trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_idl.c
r108321 r108326 80 80 "/*", 81 81 "%{C++", 82 "%{ C++", 82 83 NULL 83 84 }; … … 87 88 { 88 89 "*/", 90 "%}", 89 91 "%}", 90 92 NULL … … 246 248 247 249 248 static int xpidlParseSkipComments(PXPIDLPARSE pThis, PXPIDLINPUT pInput )250 static int xpidlParseSkipComments(PXPIDLPARSE pThis, PXPIDLINPUT pInput, bool *pfRawBlock) 249 251 { 250 252 for (;;) … … 260 262 261 263 /* Make sure we don't miss any %{C++ %} blocks. */ 262 if (!strncmp(pTok->Type.Comment.pszComment, RT_STR_TUPLE("%{C++"))) 263 return xpidlParseError(pThis, pInput, pTok, VERR_INVALID_PARAMETER, "Parser: Encountered unexpected raw code block comment"); 264 if ( !strncmp(pTok->Type.Comment.pszComment, RT_STR_TUPLE("%{C++")) 265 || !strncmp(pTok->Type.Comment.pszComment, RT_STR_TUPLE("%{ C++"))) 266 { 267 if (pfRawBlock) 268 *pfRawBlock = true; 269 return VINF_SUCCESS; 270 } 264 271 265 272 RTScriptLexConsumeToken(pInput->hIdlLex); … … 636 643 const char *pszVal = NULL; 637 644 638 XPIDL_PARSE_IDENTIFIER (pszAttr);645 XPIDL_PARSE_IDENTIFIER_ALLOW_KEYWORDS(pszAttr); /* For const for example. */ 639 646 XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, '('); 640 647 if (fConsumed) … … 839 846 { 840 847 int rc; 841 PXPIDLNODE pNdConst = xpidlNodeCreate(pThis, pNdIf, pInput, kXpidlNdType_Attribute); 848 PXPIDLNODE pNdConst = xpidlNodeCreateWithAttrs(pThis, pNdIf, pInput, kXpidlNdType_Attribute, 849 &pThis->aAttrs[0], pThis->cAttrs); 842 850 if (pNdConst) 843 851 { 852 pThis->cAttrs = 0; 844 853 RTListAppend(&pNdIf->u.If.LstBody, &pNdConst->NdLst); 845 854 … … 936 945 for (;;) 937 946 { 938 int rc = xpidlParseSkipComments(pThis, pInput); 947 bool fRawBlock = false; 948 int rc = xpidlParseSkipComments(pThis, pInput, &fRawBlock); 939 949 if (RT_FAILURE(rc)) 940 950 return rc; 951 952 if (fRawBlock) 953 { 954 PCRTSCRIPTLEXTOKEN pTok; 955 int rc = RTScriptLexQueryToken(pInput->hIdlLex, &pTok); 956 if (RT_FAILURE(rc)) 957 return xpidlParseError(pThis, pInput, NULL, rc, "Lexer: Failed to query punctuator token with %Rrc", rc); 958 959 size_t cchIntro = !strncmp(pTok->Type.Comment.pszComment, RT_STR_TUPLE("%{C++")) 960 ? 6 /* Assumes a newline after %{C++ */ 961 : 7; /* Assumes a newline after %{C++ */ 962 /* Create a new raw block node. */ 963 PXPIDLNODE pNode = xpidlNodeCreate(pThis, NULL, pInput, kXpidlNdType_RawBlock); 964 if (pNode) 965 { 966 pNode->u.RawBlock.pszRaw = pTok->Type.Comment.pszComment + cchIntro; 967 pNode->u.RawBlock.cchRaw = pTok->Type.Comment.cchComment - (cchIntro + 2 + 1); /* Start + end + zero terminator. */ 968 RTScriptLexConsumeToken(pInput->hIdlLex); 969 RTListAppend(&pNdIf->u.If.LstBody, &pNode->NdLst); 970 } 971 else 972 { 973 rc = VERR_NO_MEMORY; 974 break; 975 } 976 } 941 977 942 978 /* A closing '}' means we reached the end of the interface body. */ … … 944 980 XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, '}'); 945 981 if (fConsumed) 982 break; 983 984 XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, '['); 985 if (fConsumed) 986 { 987 if (pThis->cAttrs) 988 return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, 989 "Start of attribute list directly after an existing attribute list"); 990 991 rc = xpidlParseAttributes(pThis, pInput, &pThis->aAttrs[0], RT_ELEMENTS(pThis->aAttrs), &pThis->cAttrs); 992 } 993 if (RT_FAILURE(rc)) 946 994 break; 947 995 … … 981 1029 /* We need to parse a type spec. */ 982 1030 PXPIDLNODE pNdRetType = NULL; 983 XPIDLATTR aAttrs[32];984 uint32_t cAttrs = 0;985 986 /* A list of attributes for this method?. */987 XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, '[');988 if (fConsumed)989 {990 rc = xpidlParseAttributes(pThis, pInput, &aAttrs[0], RT_ELEMENTS(aAttrs), &cAttrs);991 if (RT_FAILURE(rc))992 return rc;993 }994 1031 995 1032 rc = xpidlParseTypeSpec(pThis, pInput, &pNdRetType); … … 998 1035 999 1036 PXPIDLNODE pNdMethod = xpidlNodeCreateWithAttrs(pThis, pNdIf, pInput, kXpidlNdType_Method, 1000 & aAttrs[0],cAttrs);1037 &pThis->aAttrs[0], pThis->cAttrs); 1001 1038 if (pNdMethod) 1002 1039 { 1040 pThis->cAttrs = 0; 1003 1041 RTListAppend(&pNdIf->u.If.LstBody, &pNdMethod->NdLst); 1004 1042 … … 1203 1241 { 1204 1242 /* Could be a raw block, check that the string starts with %{C++. */ 1205 if (!strncmp(pTok->Type.Comment.pszComment, RT_STR_TUPLE("%{C++"))) 1243 if ( !strncmp(pTok->Type.Comment.pszComment, RT_STR_TUPLE("%{C++")) 1244 || !strncmp(pTok->Type.Comment.pszComment, RT_STR_TUPLE("%{ C++"))) 1206 1245 { 1246 size_t cchIntro = !strncmp(pTok->Type.Comment.pszComment, RT_STR_TUPLE("%{C++")) 1247 ? 6 /* Assumes a newline after %{C++ */ 1248 : 7; /* Assumes a newline after %{C++ */ 1207 1249 /* Create a new raw block node. */ 1208 1250 PXPIDLNODE pNode = xpidlNodeCreate(pThis, NULL, pInput, kXpidlNdType_RawBlock); 1209 1251 if (pNode) 1210 1252 { 1211 pNode->u.RawBlock.pszRaw = pTok->Type.Comment.pszComment + 6; /* Assumes a newline after %{C++ */1212 pNode->u.RawBlock.cchRaw = pTok->Type.Comment.cchComment - ( 6+ 2 + 1); /* Start + end + zero terminator. */1253 pNode->u.RawBlock.pszRaw = pTok->Type.Comment.pszComment + cchIntro; 1254 pNode->u.RawBlock.cchRaw = pTok->Type.Comment.cchComment - (cchIntro + 2 + 1); /* Start + end + zero terminator. */ 1213 1255 RTListAppend(&pThis->LstNodes, &pNode->NdLst); 1214 1256 } -
trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_typelib.c
r108321 r108326 1211 1211 rc = xpidlTypelibProcessConst(pThis, pIt); 1212 1212 break; 1213 case kXpidlNdType_RawBlock: 1214 break; 1213 1215 default: 1214 1216 AssertReleaseFailed(); -
trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_util.c
r108321 r108326 352 352 DECLHIDDEN(PCXPIDLNODE) find_underlying_type(PCXPIDLNODE pNd) 353 353 { 354 if (pNd->enmType == kXpidlNdType_BaseType) 355 return pNd; 354 356 if (pNd == NULL || pNd->enmType != kXpidlNdType_Identifier) 355 357 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.