/* * Generate the XML for a function. */ static void xmlFunction(sipSpec *pt, classDef *scope, memberDef *md, overDef *oloads, int indent, FILE *fp) { overDef *od; const char *default_str = "default=\"1\" "; for (od = oloads; od != NULL; od = od->next) { int isstat; classDef *xtnds; if (od->common != md) continue; if (isPrivate(od)) continue; if (isSignal(od)) { xmlIndent(indent, fp); fprintf(fp, "<Signal %sname=\"", default_str); prScopedPythonName(fp, scope, md->pyname->text); fprintf(fp, "\" sig=\""); xmlCppSignature(fp, od); fprintf(fp, "\"/>\n"); default_str = ""; continue; } xtnds = NULL; isstat = (scope == NULL || scope->iff->type == namespace_iface || isStatic(od)); if (scope == NULL && md->slot != no_slot && od->pysig.args[0].atype == class_type) { xtnds = od->pysig.args[0].u.cd; isstat = FALSE; } if (xmlOverload(pt, scope, md, od, xtnds, isstat, FALSE, indent, fp)) xmlOverload(pt, scope, md, od, xtnds, isstat, TRUE, indent, fp); } }
/* * Generate the XML for a function. */ static void xmlFunction(sipSpec *pt, moduleDef *mod, classDef *scope, memberDef *md, overDef *oloads, int indent, FILE *fp) { overDef *od; for (od = oloads; od != NULL; od = od->next) { int isstat; classDef *xtnds; if (od->common != md) continue; if (isPrivate(od)) continue; if (isSignal(od)) { int a; xmlIndent(indent++, fp); fprintf(fp, "<Signal name=\""); prScopedPythonName(fp, scope, md->pyname->text); fprintf(fp, "\""); xmlRealScopedName(scope, od->cppname, fp); if (hasCppSignature(od->cppsig)) { fprintf(fp, " cppsig=\""); xmlCppSignature(fp, od->cppsig, FALSE); fprintf(fp, "\""); } /* Handle the trivial case. */ if (od->pysig.nrArgs == 0) { fprintf(fp, "/>\n"); continue; } fprintf(fp, ">\n"); for (a = 0; a < od->pysig.nrArgs; ++a) { argDef *ad = &od->pysig.args[a]; xmlArgument(pt, mod, ad, FALSE, od->kwargs, FALSE, indent, fp); } xmlIndent(--indent, fp); fprintf(fp, "</Signal>\n"); continue; } xtnds = NULL; isstat = (scope == NULL || scope->iff->type == namespace_iface || isStatic(od)); if (scope == NULL && md->slot != no_slot && od->pysig.args[0].atype == class_type) { xtnds = od->pysig.args[0].u.cd; isstat = FALSE; } xmlOverload(pt, mod, scope, md, od, xtnds, isstat, indent, fp); } }