1296 |
|
|
1297 |
/* [end] can be only argv[4] */ |
/* [end] can be only argv[4] */ |
1298 |
if (argv[4][0] != '-') { |
if (argv[4][0] != '-') { |
1299 |
end_message = atoi(argv[4]); |
if (!strcmp(argv[4], "end" )) |
1300 |
|
end_message = INT_MAX; |
1301 |
|
else |
1302 |
|
end_message = atoi(argv[4]); |
1303 |
} |
} |
1304 |
|
|
1305 |
/* parse all options (beginning with '-' */ |
/* parse all options (beginning with '-' */ |
1512 |
} |
} |
1513 |
break; |
break; |
1514 |
default: |
default: |
1515 |
|
if ((error == GN_ERR_INVALIDLOCATION) && (end_message == INT_MAX) && (count > start_message)) |
1516 |
|
return GN_ERR_NONE; |
1517 |
fprintf(stderr, _("GetSMS %s %d failed! (%s)\n"), memory_type_string, count, gn_error_print(error)); |
fprintf(stderr, _("GetSMS %s %d failed! (%s)\n"), memory_type_string, count, gn_error_print(error)); |
1518 |
if (error == GN_ERR_INVALIDMEMORYTYPE) |
if (error == GN_ERR_INVALIDMEMORYTYPE) |
1519 |
fprintf(stderr, _("See the gnokii manual page for the supported memory types with the phone\nyou use.\n")); |
fprintf(stderr, _("See the gnokii manual page for the supported memory types with the phone\nyou use.\n")); |
1546 |
} |
} |
1547 |
|
|
1548 |
start_message = end_message = atoi(argv[1]); |
start_message = end_message = atoi(argv[1]); |
1549 |
if (argc > 2) end_message = atoi(argv[2]); |
if (argc > 2) { |
1550 |
|
if (!strcmp(argv[2], "end")) |
1551 |
|
end_message = INT_MAX; |
1552 |
|
else |
1553 |
|
end_message = atoi(argv[2]); |
1554 |
|
} |
1555 |
|
|
1556 |
/* Now delete the requested entries. */ |
/* Now delete the requested entries. */ |
1557 |
for (count = start_message; count <= end_message; count++) { |
for (count = start_message; count <= end_message; count++) { |
1563 |
|
|
1564 |
if (error == GN_ERR_NONE) |
if (error == GN_ERR_NONE) |
1565 |
fprintf(stderr, _("Deleted SMS %s %d\n"), memory_type_string, count); |
fprintf(stderr, _("Deleted SMS %s %d\n"), memory_type_string, count); |
1566 |
else |
else { |
1567 |
|
if ((error == GN_ERR_INVALIDLOCATION) && (end_message == INT_MAX) && (count > start_message)) |
1568 |
|
return GN_ERR_NONE; |
1569 |
fprintf(stderr, _("DeleteSMS %s %d failed!(%s)\n\n"), memory_type_string, count, gn_error_print(error)); |
fprintf(stderr, _("DeleteSMS %s %d failed!(%s)\n\n"), memory_type_string, count, gn_error_print(error)); |
1570 |
|
} |
1571 |
} |
} |
1572 |
|
|
1573 |
/* FIXME: We return the value of the last read. |
/* FIXME: We return the value of the last read. |