2016-04-18 12:00:57 -04:00
|
|
|
#include <stdio.h>
|
2016-04-18 18:39:56 -04:00
|
|
|
#include <stdlib.h>
|
2016-04-18 12:00:57 -04:00
|
|
|
#include "nms.h"
|
|
|
|
|
|
|
|
int main(void) {
|
2016-04-27 11:01:41 -04:00
|
|
|
char *input = NULL;
|
2016-04-20 17:24:11 -04:00
|
|
|
NmsArgs args = INIT_NMSARGS;
|
2016-04-18 18:39:56 -04:00
|
|
|
|
2016-04-18 12:00:57 -04:00
|
|
|
// Geting input
|
2016-04-18 18:39:56 -04:00
|
|
|
int c, inSize = 0;
|
2016-04-18 12:00:57 -04:00
|
|
|
while ((c = getchar()) != EOF) {
|
2016-04-18 18:39:56 -04:00
|
|
|
++inSize;
|
|
|
|
input = realloc(input, inSize + 1);
|
|
|
|
input[inSize - 1] = c;
|
|
|
|
input[inSize] = '\0';
|
2016-04-18 12:00:57 -04:00
|
|
|
}
|
2016-04-18 18:39:56 -04:00
|
|
|
|
2016-04-20 17:08:35 -04:00
|
|
|
// Set needed args
|
|
|
|
args.src = input;
|
2016-04-20 18:16:19 -04:00
|
|
|
args.show_cursor = true;
|
2016-04-20 17:08:35 -04:00
|
|
|
|
2016-04-18 18:39:56 -04:00
|
|
|
// Display characters
|
2016-04-20 17:55:07 -04:00
|
|
|
nms_exec(&args);
|
2016-04-18 18:39:56 -04:00
|
|
|
|
|
|
|
// Don't forget to free the allocated memory!
|
|
|
|
free(input);
|
2016-04-18 12:00:57 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|