sps.c
State swap_cmd(Context ctx) {
    unsigned row, col;
    State s = parseCoords(ctx.argStr, &row, &col);
    if (s != SUCCESS)
        return s;

    Cell *c1 = getCellPtr(ctx.table, row, col);
    Cell *c2 = selectedCell(ctx.table);

    if (c1 == NULL)
        return ERR_BAD_SYNTAX;

    if (c2 == NULL)
        return ERR_BAD_SELECTION;

    swapCell(c1, c2);
    return SUCCESS;
}
// swaps selected cell with the cell specified by argument
swaps selected cell with the cell specified by argument
swaps selected cell with the cell specified by argument
State swap_cmd(Context ctx) {
    unsigned row, col;
    State s = parseCoords(ctx.argStr, &row, &col);
    if (s != SUCCESS)
        return s;
    Cell *c1 = getCellPtr(ctx.table, row, col);
    Cell *c2 = selectedCell(ctx.table);
    if (c1 == NULL)
        return ERR_BAD_SYNTAX;
    if (c2 == NULL)
        return ERR_BAD_SELECTION;
    swapCell(c1, c2);
    return SUCCESS;
}
State swap_cmd ( Context ctx ) { unsigned row , col ; State s = parseCoords ( ctx . argStr , & row , & col ) ; if ( s != SUCCESS ) return s ; Cell * c1 = getCellPtr ( ctx . table , row , col ) ; Cell * c2 = selectedCell ( ctx . table ) ; if ( c1 == NULL ) return ERR_BAD_SYNTAX ; if ( c2 == NULL ) return ERR_BAD_SELECTION ; swapCell ( c1 , c2 ) ; return SUCCESS ; }
swaps selected cell with the cell specified by argument
swaps selected cell with the cell specified by argument