2019-10-30 05:31:38 +01:00
|
|
|
/*
|
2024-07-22 23:56:06 +02:00
|
|
|
* small proggy for testing some functions
|
2019-10-30 05:31:38 +01:00
|
|
|
*/
|
2024-07-22 23:56:06 +02:00
|
|
|
|
|
|
|
|
2019-10-30 05:31:38 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2019-10-31 15:47:54 +01:00
|
|
|
|
|
|
|
#include "ffuncs.h"
|
2019-10-30 05:31:38 +01:00
|
|
|
|
2024-07-22 23:56:06 +02:00
|
|
|
int verbosity = 1;
|
2019-10-30 05:31:38 +01:00
|
|
|
|
2024-07-22 23:56:06 +02:00
|
|
|
int test_of_the_trim_funcs(int foo)
|
|
|
|
{
|
|
|
|
char buffer[200];
|
2019-10-30 05:31:38 +01:00
|
|
|
|
2024-07-22 23:56:06 +02:00
|
|
|
printf(" --- %s ---\n\n", __func__);
|
2019-10-30 05:31:38 +01:00
|
|
|
|
2024-07-22 23:56:06 +02:00
|
|
|
strcpy(buffer, "nothing to trim");
|
|
|
|
dump(buffer, NULL);
|
|
|
|
puts("");
|
|
|
|
|
|
|
|
strcpy(buffer, "trailing spaces ");
|
|
|
|
dump(buffer, NULL);
|
|
|
|
rtrim(buffer);
|
|
|
|
dump(buffer, NULL);
|
|
|
|
puts("");
|
|
|
|
|
|
|
|
strcpy(buffer, " leading spaces");
|
|
|
|
dump(buffer, NULL);
|
|
|
|
ltrim(buffer);
|
|
|
|
dump(buffer, NULL);
|
|
|
|
puts("");
|
|
|
|
|
|
|
|
return 0;
|
2019-10-30 05:31:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
|
2024-07-22 23:56:06 +02:00
|
|
|
(void)test_of_the_trim_funcs(0);
|
2019-10-30 05:31:38 +01:00
|
|
|
|
|
|
|
|
2019-11-03 18:58:21 +01:00
|
|
|
|
2019-10-30 05:31:38 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|