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

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

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

    src = Tcl_GetString(objv[2]);
    dst = Tcl_GetString(objv[3]);

    aug_result = aug_mv(aug, src, dst);

    if (aug_result == 0) {
        return TCL_OK;
    } else if (aug_result == 1) {
        Tcl_SetObjResult(interp,
                Tcl_NewStringObj("can't move subtree", -1));

        return TCL_ERROR;
    } else { /* aug_result < 0 */
        Tcl_SetObjResult(interp, Tcl_NewStringObj(ERROR_UNKNOWN, -1));

        return TCL_ERROR;
    }
}
/*
 * Move subtree src to dst.
 * Usage: mv token src dst
 * Return value: nothing.
 * Side effects: changes an Augeas object.
 */
Move subtree src to dst.
Usage: mv token src dst
Return value: nothing.
Side effects: changes an Augeas object.
Move subtree src to dst . Usage : mv token src dst Return value : nothing . Side effects : changes an Augeas object .
static int
Mv_Cmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
    augeas* aug;
    const char* src;
    const char* dst;
    int aug_result;
    if (objc != 4) {
        Tcl_WrongNumArgs(interp, 1, objv, USAGE_MV);
        return TCL_ERROR;
    }
    aug = parse_id(cdata, interp, objv[1], 0);
    if (aug == NULL) {
        return TCL_ERROR;
    }
    src = Tcl_GetString(objv[2]);
    dst = Tcl_GetString(objv[3]);
    aug_result = aug_mv(aug, src, dst);
    if (aug_result == 0) {
        return TCL_OK;
    } else if (aug_result == 1) {
        Tcl_SetObjResult(interp,
                Tcl_NewStringObj("can't move subtree", -1));
        return TCL_ERROR;
    } else { 
        Tcl_SetObjResult(interp, Tcl_NewStringObj(ERROR_UNKNOWN, -1));
        return TCL_ERROR;
    }
}
static int Mv_Cmd ( ClientData cdata , Tcl_Interp * interp , int objc , Tcl_Obj * const objv [ ] ) { augeas * aug ; const char * src ; const char * dst ; int aug_result ; if ( objc != 4 ) { Tcl_WrongNumArgs ( interp , 1 , objv , USAGE_MV ) ; return TCL_ERROR ; } aug = parse_id ( cdata , interp , objv [ 1 ] , 0 ) ; if ( aug == NULL ) { return TCL_ERROR ; } src = Tcl_GetString ( objv [ 2 ] ) ; dst = Tcl_GetString ( objv [ 3 ] ) ; aug_result = aug_mv ( aug , src , dst ) ; if ( aug_result == 0 ) { return TCL_OK ; } 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 ; } }
Move subtree src to dst.
Move subtree src to dst .
/* aug_result < 0 */