1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#include <stdio.h>
#include "r_cons.h"
int main() {
char buf[1024];
r_cons_new ();
r_cons_strcat ("Hello World\n");
r_cons_strcat_justify (
"this is pure\n"
"fun and nasty bubble\n"
"so i can enjoy tha time\n"
"dudu du dudu dah\n"
, 10, 0);
r_cons_flush();
while (!r_cons_eof()) {
r_cons_fgets (buf, sizeof (buf), 0, NULL);
r_cons_printf ("%s\n", buf);
r_cons_flush ();
if (strstr (buf, "exit"))
break;
}
r_cons_strcat ("Eof!\n");
r_cons_flush ();
return 0;
}
|