Esempio n. 1
0
/**
 * xslDbgShellDelParam:
 * @arg: A single white space trimmed parameter number to look for
 * 
 * Delet a libxslt parameter to be sent to libxslt later on
 *
 * Returns 1 if able to delete parameter @name,
 *         0 otherwise
 */
int
xslDbgShellDelParam(xmlChar * arg)
{
    int result = 0;
    static const char *errorPrompt = I18N_NOOP("Failed to delete parameter");
    long paramId;
    xmlChar *opts[2];

    if (!arg) {
	xsldbgGenericErrorFunc(i18n("Error: Invalid arguments for the command %1.\n").arg("delparam"));
    }else{
	if (xmlStrLen(arg) > 0) {
	    if (splitString(arg, 1, opts) == 1) {
		if ((xmlStrlen(opts[0]) == 0) ||
			!sscanf((char *) opts[0], "%ld", &paramId)) {
		    xsldbgGenericErrorFunc(i18n("Error: Unable to parse %1 as a line number.\n").arg(xsldbgText(opts[0])));
		} else {
		    result =
			arrayListDelete(optionsGetParamItemList(), paramId);
		    if (!result)
			xsldbgGenericErrorFunc(i18n("Error: Unable to find parameter %1.\n").arg(paramId));
		}
	    } else {
		xsldbgGenericErrorFunc(i18n("Error: Invalid arguments for the command %1.\n").arg("delparam"));
	    }
	} else {
	    /* Delete all parameters */
	    arrayListEmpty(optionsGetParamItemList());
	    result = 1;
	}
    }
    if (!result)
        xsldbgGenericErrorFunc(QString("Error: %1\n").arg(i18n(errorPrompt)));
    else
         xsldbgGenericErrorFunc("\n");

    return result;
}
Esempio n. 2
0
/**
 * breakPointEmpty:
 *
 * Empty the break point collection
 *
 * Returns 1 if able to empty the breakpoint list of its contents,
 *         0  otherwise
 */
int
breakPointEmpty(void)
{
    return arrayListEmpty(breakList);
}