Skip to content
Snippets Groups Projects
Commit b10e585a authored by deuce's avatar deuce
Browse files

Add raw write test to example.c

Allow the data_len to be specified as -1 to use strlen() on data.
parent 7483ea84
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,13 @@ int main(int argc, char **argv)
cprintf("Drop path: %s\r\n",xpd_info.drop.path?xpd_info.drop.path:"<Unknown>");
cprintf("Welcome %s!\r\n\r\n",xpd_info.drop.user.full_name?xpd_info.drop.user.full_name:"<unknown>");
cputs("Press <ENTER> to try out raw writes...");
getch();
xpd_rwrite("\x1b[2J\x1b[1;1H\x1b[32mTest\r\n", -1);
cputs("Press <ENTER> to exit: ");
cputs("\r\nPress <ENTER> to exit: ");
getch();
cputs("\r\n");
xpd_exit();
......
......@@ -321,6 +321,9 @@ int xpd_rwrite(const char *data, int data_len)
{
struct text_info ti;
if(data_len == -1)
data_len=strlen(data);
/* Set up cterm to match conio */
gettextinfo(&ti);
cterm.x=ti.winleft+ti.curx-1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment