зеркало из https://github.com/mozilla/pjs.git
NOT YET PART OF SEAMONKEY:
* added function XPT_GetInterfaceIndexByName * replaced remaining occurences of 'namespace' with 'name_space' to keep C++ happy * added xpt_dump display for param types (in/out/retval) * changed xpt_dump handling for wchar_t strings * use shaver's print_IID function when displaying type descriptors * removed DoAnnotations (not used)
This commit is contained in:
Родитель
7f21c85171
Коммит
b67985862a
|
@ -164,8 +164,9 @@ struct XPTInterfaceDescriptor {
|
|||
};
|
||||
|
||||
extern XPT_PUBLIC_API(PRBool)
|
||||
XPT_IndexForInterface(XPTInterfaceDirectoryEntry *ide_block,
|
||||
uint32 num_interfaces, nsID *iid, uint16 *indexp);
|
||||
XPT_GetInterfaceIndexByName(XPTInterfaceDirectoryEntry *ide_block,
|
||||
uint32 num_interfaces, char *name,
|
||||
uint16 *indexp);
|
||||
|
||||
extern XPT_PUBLIC_API(XPTInterfaceDescriptor *)
|
||||
XPT_NewInterfaceDescriptor(uint32 parent_interface, uint32 num_methods,
|
||||
|
|
|
@ -46,6 +46,7 @@ DoTypeDescriptor(XPTCursor *cursor, XPTTypeDescriptor *td);
|
|||
static PRBool
|
||||
DoParamDescriptor(XPTCursor *cursor, XPTParamDescriptor *pd);
|
||||
|
||||
|
||||
#define CURS_POOL_OFFSET_RAW(cursor) \
|
||||
((cursor)->pool == XPT_HEADER \
|
||||
? (cursor)->offset \
|
||||
|
@ -695,8 +696,20 @@ DoAnnotation(XPTCursor *cursor, XPTAnnotation **annp)
|
|||
}
|
||||
|
||||
PRBool
|
||||
DoAnnotations(XPTCursor *cursor, XPTAnnotation **ap)
|
||||
XPT_GetInterfaceIndexByName(XPTInterfaceDirectoryEntry *ide_block,
|
||||
uint32 num_interfaces, char *name,
|
||||
uint16 *indexp)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=1; i<=num_interfaces; i++) {
|
||||
fprintf(stderr, "%s == %s ?\n", ide_block[i].name, name);
|
||||
if (strcmp(ide_block[i].name, name) == 0) {
|
||||
*indexp = i;
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
indexp = 0;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -283,7 +283,7 @@ XPT_DumpInterfaceDirectoryEntry(XPTInterfaceDirectoryEntry *ide,
|
|||
fprintf(stdout, "%*sName: %s\n",
|
||||
indent, " ", ide->name);
|
||||
fprintf(stdout, "%*sNamespace: %s\n",
|
||||
indent, " ", ide->namespace);
|
||||
indent, " ", ide->name_space);
|
||||
fprintf(stdout, "%*sAddress of interface descriptor: %p\n",
|
||||
indent, " ", ide->interface_descriptor);
|
||||
|
||||
|
@ -295,7 +295,7 @@ XPT_DumpInterfaceDirectoryEntry(XPTInterfaceDirectoryEntry *ide,
|
|||
}
|
||||
} else {
|
||||
fprintf(stdout, "%*s- %s::%s (", indent, " ",
|
||||
ide->namespace ? ide->namespace : "", ide->name);
|
||||
ide->name_space ? ide->name_space : "", ide->name);
|
||||
print_IID(&ide->iid, stdout);
|
||||
fprintf(stdout, "):\n");
|
||||
if (!XPT_DumpInterfaceDescriptor(ide->interface_descriptor,
|
||||
|
@ -435,6 +435,24 @@ XPT_DumpMethodDescriptor(XPTMethodDescriptor *md, const int indent,
|
|||
fprintf(stdout, ", ");
|
||||
}
|
||||
pd = &md->params[i];
|
||||
if (XPT_PD_IS_IN(pd->flags)) {
|
||||
fprintf(stdout, "in");
|
||||
if (XPT_PD_IS_OUT(pd->flags)) {
|
||||
fprintf(stdout, "/out ");
|
||||
if (XPT_PD_IS_RETVAL(pd->flags)) {
|
||||
fprintf(stdout, "retval ");
|
||||
}
|
||||
} else {
|
||||
fprintf(stdout, " ");
|
||||
}
|
||||
} else {
|
||||
if (XPT_PD_IS_OUT(pd->flags)) {
|
||||
fprintf(stdout, "out ");
|
||||
if (XPT_PD_IS_RETVAL(pd->flags)) {
|
||||
fprintf(stdout, "retval ");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!XPT_GetStringForType(&pd->type, ¶m_type)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
@ -605,24 +623,14 @@ XPT_DumpConstDescriptor(XPTConstDescriptor *cd, const int indent, PRBool verbose
|
|||
fprintf(stdout, "%c", cd->value.ch);
|
||||
break;
|
||||
case TD_WCHAR:
|
||||
fprintf(stdout, "%d", cd->value.wch);
|
||||
fprintf(stdout, "%c", cd->value.wch & 0xff);
|
||||
break;
|
||||
case TD_VOID:
|
||||
fprintf(stdout, "VOID");
|
||||
break;
|
||||
case TD_PPNSIID:
|
||||
if (XPT_TDP_IS_POINTER(cd->type.prefix.flags)) {
|
||||
fprintf(stdout, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
|
||||
cd->value.iid->m0, (PRUint32) cd->value.iid->m1,
|
||||
(PRUint32) cd->value.iid->m2,
|
||||
(PRUint32) cd->value.iid->m3[0],
|
||||
(PRUint32) cd->value.iid->m3[1],
|
||||
(PRUint32) cd->value.iid->m3[2],
|
||||
(PRUint32) cd->value.iid->m3[3],
|
||||
(PRUint32) cd->value.iid->m3[4],
|
||||
(PRUint32) cd->value.iid->m3[5],
|
||||
(PRUint32) cd->value.iid->m3[6],
|
||||
(PRUint32) cd->value.iid->m3[7]);
|
||||
print_IID(cd->value.iid, stdout);
|
||||
} else
|
||||
return PR_FALSE;
|
||||
break;
|
||||
|
|
|
@ -164,8 +164,9 @@ struct XPTInterfaceDescriptor {
|
|||
};
|
||||
|
||||
extern XPT_PUBLIC_API(PRBool)
|
||||
XPT_IndexForInterface(XPTInterfaceDirectoryEntry *ide_block,
|
||||
uint32 num_interfaces, nsID *iid, uint16 *indexp);
|
||||
XPT_GetInterfaceIndexByName(XPTInterfaceDirectoryEntry *ide_block,
|
||||
uint32 num_interfaces, char *name,
|
||||
uint16 *indexp);
|
||||
|
||||
extern XPT_PUBLIC_API(XPTInterfaceDescriptor *)
|
||||
XPT_NewInterfaceDescriptor(uint32 parent_interface, uint32 num_methods,
|
||||
|
|
|
@ -46,6 +46,7 @@ DoTypeDescriptor(XPTCursor *cursor, XPTTypeDescriptor *td);
|
|||
static PRBool
|
||||
DoParamDescriptor(XPTCursor *cursor, XPTParamDescriptor *pd);
|
||||
|
||||
|
||||
#define CURS_POOL_OFFSET_RAW(cursor) \
|
||||
((cursor)->pool == XPT_HEADER \
|
||||
? (cursor)->offset \
|
||||
|
@ -695,8 +696,20 @@ DoAnnotation(XPTCursor *cursor, XPTAnnotation **annp)
|
|||
}
|
||||
|
||||
PRBool
|
||||
DoAnnotations(XPTCursor *cursor, XPTAnnotation **ap)
|
||||
XPT_GetInterfaceIndexByName(XPTInterfaceDirectoryEntry *ide_block,
|
||||
uint32 num_interfaces, char *name,
|
||||
uint16 *indexp)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=1; i<=num_interfaces; i++) {
|
||||
fprintf(stderr, "%s == %s ?\n", ide_block[i].name, name);
|
||||
if (strcmp(ide_block[i].name, name) == 0) {
|
||||
*indexp = i;
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
indexp = 0;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -283,7 +283,7 @@ XPT_DumpInterfaceDirectoryEntry(XPTInterfaceDirectoryEntry *ide,
|
|||
fprintf(stdout, "%*sName: %s\n",
|
||||
indent, " ", ide->name);
|
||||
fprintf(stdout, "%*sNamespace: %s\n",
|
||||
indent, " ", ide->namespace);
|
||||
indent, " ", ide->name_space);
|
||||
fprintf(stdout, "%*sAddress of interface descriptor: %p\n",
|
||||
indent, " ", ide->interface_descriptor);
|
||||
|
||||
|
@ -295,7 +295,7 @@ XPT_DumpInterfaceDirectoryEntry(XPTInterfaceDirectoryEntry *ide,
|
|||
}
|
||||
} else {
|
||||
fprintf(stdout, "%*s- %s::%s (", indent, " ",
|
||||
ide->namespace ? ide->namespace : "", ide->name);
|
||||
ide->name_space ? ide->name_space : "", ide->name);
|
||||
print_IID(&ide->iid, stdout);
|
||||
fprintf(stdout, "):\n");
|
||||
if (!XPT_DumpInterfaceDescriptor(ide->interface_descriptor,
|
||||
|
@ -435,6 +435,24 @@ XPT_DumpMethodDescriptor(XPTMethodDescriptor *md, const int indent,
|
|||
fprintf(stdout, ", ");
|
||||
}
|
||||
pd = &md->params[i];
|
||||
if (XPT_PD_IS_IN(pd->flags)) {
|
||||
fprintf(stdout, "in");
|
||||
if (XPT_PD_IS_OUT(pd->flags)) {
|
||||
fprintf(stdout, "/out ");
|
||||
if (XPT_PD_IS_RETVAL(pd->flags)) {
|
||||
fprintf(stdout, "retval ");
|
||||
}
|
||||
} else {
|
||||
fprintf(stdout, " ");
|
||||
}
|
||||
} else {
|
||||
if (XPT_PD_IS_OUT(pd->flags)) {
|
||||
fprintf(stdout, "out ");
|
||||
if (XPT_PD_IS_RETVAL(pd->flags)) {
|
||||
fprintf(stdout, "retval ");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!XPT_GetStringForType(&pd->type, ¶m_type)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
@ -605,24 +623,14 @@ XPT_DumpConstDescriptor(XPTConstDescriptor *cd, const int indent, PRBool verbose
|
|||
fprintf(stdout, "%c", cd->value.ch);
|
||||
break;
|
||||
case TD_WCHAR:
|
||||
fprintf(stdout, "%d", cd->value.wch);
|
||||
fprintf(stdout, "%c", cd->value.wch & 0xff);
|
||||
break;
|
||||
case TD_VOID:
|
||||
fprintf(stdout, "VOID");
|
||||
break;
|
||||
case TD_PPNSIID:
|
||||
if (XPT_TDP_IS_POINTER(cd->type.prefix.flags)) {
|
||||
fprintf(stdout, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
|
||||
cd->value.iid->m0, (PRUint32) cd->value.iid->m1,
|
||||
(PRUint32) cd->value.iid->m2,
|
||||
(PRUint32) cd->value.iid->m3[0],
|
||||
(PRUint32) cd->value.iid->m3[1],
|
||||
(PRUint32) cd->value.iid->m3[2],
|
||||
(PRUint32) cd->value.iid->m3[3],
|
||||
(PRUint32) cd->value.iid->m3[4],
|
||||
(PRUint32) cd->value.iid->m3[5],
|
||||
(PRUint32) cd->value.iid->m3[6],
|
||||
(PRUint32) cd->value.iid->m3[7]);
|
||||
print_IID(cd->value.iid, stdout);
|
||||
} else
|
||||
return PR_FALSE;
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче