sps.c
State arow_cmd(Context ctx) {
    // if argument is not empty
    if (ctx.argStr[0] != '\0')
        return ERR_BAD_SYNTAX;

    State s;
    s = addRow(ctx.table);

    if (s == SUCCESS) {
        // start on the last line
        unsigned start = ctx.table->rows;
        // and swap until you get to the lower bound of selection
        unsigned end = selLowerBound(ctx.table) + 1;
        // move the empty row up to the selection
        s = moveRow(ctx.table, start, end);
    }
    return s;
}
// appends a row after the lower bound of the selection
appends a row after the lower bound of the selection
appends a row after the lower bound of the selection
State arow_cmd(Context ctx) {
    if (ctx.argStr[0] != '\0')
        return ERR_BAD_SYNTAX;
    State s;
    s = addRow(ctx.table);
    if (s == SUCCESS) {
        unsigned start = ctx.table->rows;
        unsigned end = selLowerBound(ctx.table) + 1;
        s = moveRow(ctx.table, start, end);
    }
    return s;
}
State arow_cmd ( Context ctx ) { if ( ctx . argStr [ 0 ] != ' \0 ' ) return ERR_BAD_SYNTAX ; State s ; s = addRow ( ctx . table ) ; if ( s == SUCCESS ) { unsigned start = ctx . table -> rows ; unsigned end = selLowerBound ( ctx . table ) + 1 ; s = moveRow ( ctx . table , start , end ) ; } return s ; }
appends a row after the lower bound of the selection
appends a row after the lower bound of the selection
// if argument is not empty // start on the last line // and swap until you get to the lower bound of selection // move the empty row up to the selection