diff options
| author | 2019-04-13 12:40:52 -0400 | |
|---|---|---|
| committer | 2019-04-13 12:40:52 -0400 | |
| commit | 55bfff7cf6541caac172b43186cf14405185b14d (patch) | |
| tree | c1ae99d2b39f8df8933d81ec2e61e81050bdb410 /frontends/calculator/CEdev/examples/fileio_detect/src | |
| parent | 761462861fc1228e65546c4e0f877d5212320082 (diff) | |
| download | cetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.gz cetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.bz2 cetris-55bfff7cf6541caac172b43186cf14405185b14d.zip | |
fix curses on linux
Diffstat (limited to 'frontends/calculator/CEdev/examples/fileio_detect/src')
| -rw-r--r-- | frontends/calculator/CEdev/examples/fileio_detect/src/main.c | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/frontends/calculator/CEdev/examples/fileio_detect/src/main.c b/frontends/calculator/CEdev/examples/fileio_detect/src/main.c index d3be5a5..b249c7f 100644 --- a/frontends/calculator/CEdev/examples/fileio_detect/src/main.c +++ b/frontends/calculator/CEdev/examples/fileio_detect/src/main.c @@ -1,47 +1,47 @@ -#include <stdbool.h> -#include <stddef.h> -#include <stdint.h> -#include <tice.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <fileioc.h> - -/* Function prototypes */ -void printText(int8_t xpos, int8_t ypos, const char *text); - -/* Main Function */ -void main(void) { - /* Declare some variables -- search_pos must be NULL to begin with */ - uint8_t *search_pos = NULL; - int8_t y = 0; - ti_var_t myVar; - char *var_name; - - /* First couple bytes of the LibLoad AppVar, which is known to exist * - /* Technically is a null-terminated string, if an odd looking one */ - const char search_string[] = { 0xBF, 0xFE, 0x00 }; - - /* Clear the homescreen */ - os_ClrHome(); - - /* Find all of the variables that start with this string */ - while ((var_name = ti_Detect(&search_pos, search_string)) != NULL) { - /* Print the name of the variable (Should be LibLoad) */ - printText(0, y++, var_name); - } - - /* Wait for a key */ - while (!os_GetCSC()); - - /* Close all open files */ - ti_CloseAll(); -} - -/* Draw text on the homescreen at the given X/Y location */ -void printText(int8_t xpos, int8_t ypos, const char *text) { - os_SetCursorPos(ypos, xpos); - os_PutStrFull(text); -} +#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <tice.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <fileioc.h>
+
+/* Function prototypes */
+void printText(int8_t xpos, int8_t ypos, const char *text);
+
+/* Main Function */
+void main(void) {
+ /* Declare some variables -- search_pos must be NULL to begin with */
+ uint8_t *search_pos = NULL;
+ int8_t y = 0;
+ ti_var_t myVar;
+ char *var_name;
+
+ /* First couple bytes of the LibLoad AppVar, which is known to exist *
+ /* Technically is a null-terminated string, if an odd looking one */
+ const char search_string[] = { 0xBF, 0xFE, 0x00 };
+
+ /* Clear the homescreen */
+ os_ClrHome();
+
+ /* Find all of the variables that start with this string */
+ while ((var_name = ti_Detect(&search_pos, search_string)) != NULL) {
+ /* Print the name of the variable (Should be LibLoad) */
+ printText(0, y++, var_name);
+ }
+
+ /* Wait for a key */
+ while (!os_GetCSC());
+
+ /* Close all open files */
+ ti_CloseAll();
+}
+
+/* Draw text on the homescreen at the given X/Y location */
+void printText(int8_t xpos, int8_t ypos, const char *text) {
+ os_SetCursorPos(ypos, xpos);
+ os_PutStrFull(text);
+}
|