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

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

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

    path = Tcl_GetString(objv[2]);
    value = Tcl_GetString(objv[3]);

    aug_result = aug_set(aug, path, value);

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

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

        return TCL_ERROR;
    }
}
/*
 * Set the value of one node.
 * Usage: set token path value
 * Return value: nothing.
 * Side effects: changes an Augeas object.
 */
Set the value of one node.
Usage: set token path value
Return value: nothing.
Side effects: changes an Augeas object.
Set the value of one node . Usage : set token path value Return value : nothing . Side effects : changes an Augeas object .
static int
Set_Cmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
    augeas* aug;
    const char* path;
    const char* value;
    int aug_result;
    if (objc != 4) {
        Tcl_WrongNumArgs(interp, 1, objv, USAGE_SET);
        return TCL_ERROR;
    }
    aug = parse_id(cdata, interp, objv[1], 0);
    if (aug == NULL) {
        return TCL_ERROR;
    }
    path = Tcl_GetString(objv[2]);
    value = Tcl_GetString(objv[3]);
    aug_result = aug_set(aug, path, value);
    if (aug_result == 0) {
        return TCL_OK;
    } else if (aug_result == -1) {
        Tcl_SetObjResult(interp,
                Tcl_NewStringObj(ERROR_MULTIPLE, -1));
        return TCL_ERROR;
    } else {
        Tcl_SetObjResult(interp, Tcl_NewStringObj(ERROR_UNKNOWN, -1));
        return TCL_ERROR;
    }
}
static int Set_Cmd ( ClientData cdata , Tcl_Interp * interp , int objc , Tcl_Obj * const objv [ ] ) { augeas * aug ; const char * path ; const char * value ; int aug_result ; if ( objc != 4 ) { Tcl_WrongNumArgs ( interp , 1 , objv , USAGE_SET ) ; return TCL_ERROR ; } aug = parse_id ( cdata , interp , objv [ 1 ] , 0 ) ; if ( aug == NULL ) { return TCL_ERROR ; } path = Tcl_GetString ( objv [ 2 ] ) ; value = Tcl_GetString ( objv [ 3 ] ) ; aug_result = aug_set ( aug , path , value ) ; if ( aug_result == 0 ) { return TCL_OK ; } else if ( aug_result == -1 ) { Tcl_SetObjResult ( interp , Tcl_NewStringObj ( ERROR_MULTIPLE , -1 ) ) ; return TCL_ERROR ; } else { Tcl_SetObjResult ( interp , Tcl_NewStringObj ( ERROR_UNKNOWN , -1 ) ) ; return TCL_ERROR ; } }
Set the value of one node.
Set the value of one node .