generic/tcl-augeas.c
static int
Setm_Cmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
    augeas* aug;
    const char* base;
    const char* sub;
    const char* value;
    int aug_result;

    if (objc != 5) {
        Tcl_WrongNumArgs(interp, 1, objv, USAGE_SETM);
        return TCL_ERROR;
    }

    aug = parse_id(cdata, interp, objv[1], 0);
    if (aug == NULL) {
        return TCL_ERROR;
    }

    base = Tcl_GetString(objv[2]);
    sub = Tcl_GetString(objv[3]);
    value = Tcl_GetString(objv[4]);

    aug_result = aug_setm(aug, base, sub, value);

    if (aug_result > 0) {
        /* Return the number of nodes changed. */

        Tcl_SetObjResult(interp, Tcl_NewIntObj(aug_result));
        return TCL_OK;
    } else if (aug_result == 0) {
        Tcl_SetObjResult(interp, Tcl_NewStringObj(ERROR_NO_NODES, -1));

        return TCL_ERROR;
    } else if (aug_result == -1) {
        Tcl_SetObjResult(interp,
                Tcl_NewStringObj("can't set value", -1));

        return TCL_ERROR;
    } else {
        Tcl_SetObjResult(interp, Tcl_NewStringObj(ERROR_UNKNOWN, -1));

        return TCL_ERROR;
    }
}
/*
 * Set the values of multiple node that match the expression sub relative to
 * path base to one value.
 * Return value: the number of nodes changed.
 * Usage: setm token base sub value
 * Side effects: changes an Augeas object.
 */
Set the values of multiple node that match the expression sub relative to
path base to one value.
Return value: the number of nodes changed.
Usage: setm token base sub value
Side effects: changes an Augeas object.
Set the values of multiple node that match the expression sub relative to path base to one value . Return value : the number of nodes changed . Usage : setm token base sub value Side effects : changes an Augeas object .
static int
Setm_Cmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
    augeas* aug;
    const char* base;
    const char* sub;
    const char* value;
    int aug_result;
    if (objc != 5) {
        Tcl_WrongNumArgs(interp, 1, objv, USAGE_SETM);
        return TCL_ERROR;
    }
    aug = parse_id(cdata, interp, objv[1], 0);
    if (aug == NULL) {
        return TCL_ERROR;
    }
    base = Tcl_GetString(objv[2]);
    sub = Tcl_GetString(objv[3]);
    value = Tcl_GetString(objv[4]);
    aug_result = aug_setm(aug, base, sub, value);
    if (aug_result > 0) {
        Tcl_SetObjResult(interp, Tcl_NewIntObj(aug_result));
        return TCL_OK;
    } else if (aug_result == 0) {
        Tcl_SetObjResult(interp, Tcl_NewStringObj(ERROR_NO_NODES, -1));
        return TCL_ERROR;
    } else if (aug_result == -1) {
        Tcl_SetObjResult(interp,
                Tcl_NewStringObj("can't set value", -1));
        return TCL_ERROR;
    } else {
        Tcl_SetObjResult(interp, Tcl_NewStringObj(ERROR_UNKNOWN, -1));
        return TCL_ERROR;
    }
}
static int Setm_Cmd ( ClientData cdata , Tcl_Interp * interp , int objc , Tcl_Obj * const objv [ ] ) { augeas * aug ; const char * base ; const char * sub ; const char * value ; int aug_result ; if ( objc != 5 ) { Tcl_WrongNumArgs ( interp , 1 , objv , USAGE_SETM ) ; return TCL_ERROR ; } aug = parse_id ( cdata , interp , objv [ 1 ] , 0 ) ; if ( aug == NULL ) { return TCL_ERROR ; } base = Tcl_GetString ( objv [ 2 ] ) ; sub = Tcl_GetString ( objv [ 3 ] ) ; value = Tcl_GetString ( objv [ 4 ] ) ; aug_result = aug_setm ( aug , base , sub , value ) ; if ( aug_result > 0 ) { Tcl_SetObjResult ( interp , Tcl_NewIntObj ( aug_result ) ) ; return TCL_OK ; } else if ( aug_result == 0 ) { Tcl_SetObjResult ( interp , Tcl_NewStringObj ( ERROR_NO_NODES , -1 ) ) ; return TCL_ERROR ; } else if ( aug_result == -1 ) { Tcl_SetObjResult ( interp , Tcl_NewStringObj ( " " , -1 ) ) ; return TCL_ERROR ; } else { Tcl_SetObjResult ( interp , Tcl_NewStringObj ( ERROR_UNKNOWN , -1 ) ) ; return TCL_ERROR ; } }
Set the values of multiple node that match the expression sub relative to
 path base to one value.
Set the values of multiple node that match the expression sub relative to path base to one value .
/* Return the number of nodes changed. */