From fdb1d0a4df496e7a3232a950d5c72231363cf67a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 8 Oct 2014 08:33:00 -0600 Subject: Remove non-portable references to syslog from apps/examples --- apps/examples/nx/nx_events.c | 48 +++++++-------- apps/examples/nx/nx_internal.h | 20 ------- apps/examples/nx/nx_kbdin.c | 14 ++--- apps/examples/nx/nx_main.c | 132 ++++++++++++++++++++--------------------- apps/examples/nx/nx_server.c | 18 +++--- 5 files changed, 106 insertions(+), 126 deletions(-) (limited to 'apps/examples/nx') diff --git a/apps/examples/nx/nx_events.c b/apps/examples/nx/nx_events.c index 934d4491a..7d2213f32 100644 --- a/apps/examples/nx/nx_events.c +++ b/apps/examples/nx/nx_events.c @@ -139,13 +139,13 @@ static inline void nxeg_fillwindow(NXEGWINDOW hwnd, ret = nx_fill(hwnd, rect, st->color); if (ret < 0) { - message("nxeg_fillwindow: nx_fill failed: %d\n", errno); + printf("nxeg_fillwindow: nx_fill failed: %d\n", errno); } #else ret = nxtk_fillwindow(hwnd, rect, st->color); if (ret < 0) { - message("nxeg_fillwindow: nxtk_fillwindow failed: %d\n", errno); + printf("nxeg_fillwindow: nxtk_fillwindow failed: %d\n", errno); } #endif #ifdef CONFIG_NX_KBD @@ -167,7 +167,7 @@ static inline void nxeg_filltoolbar(NXTKWINDOW htb, ret = nxtk_filltoolbar(htb, rect, color); if (ret < 0) { - message("nxeg_filltoolbar: nxtk_filltoolbar failed: %d\n", errno); + printf("nxeg_filltoolbar: nxtk_filltoolbar failed: %d\n", errno); } } #endif @@ -180,10 +180,10 @@ static void nxeg_redraw(NXEGWINDOW hwnd, FAR const struct nxgl_rect_s *rect, bool more, FAR void *arg) { FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg; - message("nxeg_redraw%d: hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n", - st->wnum, hwnd, - rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y, - more ? "true" : "false"); + printf("nxeg_redraw%d: hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n", + st->wnum, hwnd, + rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y, + more ? "true" : "false"); nxeg_fillwindow(hwnd, rect, st); } @@ -201,9 +201,9 @@ static void nxeg_position(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size, /* Report the position */ - message("nxeg_position%d: hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n", - st->wnum, hwnd, size->w, size->h, pos->x, pos->y, - bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y); + printf("nxeg_position%d: hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n", + st->wnum, hwnd, size->w, size->h, pos->x, pos->y, + bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y); /* Have we picked off the window bounds yet? */ @@ -216,7 +216,7 @@ static void nxeg_position(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size, b_haveresolution = true; sem_post(&g_semevent); - message("nxeg_position2: Have xres=%d yres=%d\n", g_xres, g_yres); + printf("nxeg_position2: Have xres=%d yres=%d\n", g_xres, g_yres); } } @@ -229,8 +229,8 @@ static void nxeg_mousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos, uint8_t buttons, FAR void *arg) { FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg; - message("nxeg_mousein%d: hwnd=%p pos=(%d,%d) button=%02x\n", - st->wnum, hwnd, pos->x, pos->y, buttons); + printf("nxeg_mousein%d: hwnd=%p pos=(%d,%d) button=%02x\n", + st->wnum, hwnd, pos->x, pos->y, buttons); } #endif @@ -243,10 +243,10 @@ static void nxeg_tbredraw(NXEGWINDOW hwnd, FAR const struct nxgl_rect_s *rect, bool more, FAR void *arg) { FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg; - message("nxeg_tbredraw%d: hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n", - st->wnum, hwnd, - rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y, - more ? "true" : "false"); + printf("nxeg_tbredraw%d: hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n", + st->wnum, hwnd, + rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y, + more ? "true" : "false"); nxeg_filltoolbar(hwnd, rect, g_tbcolor); } #endif @@ -265,9 +265,9 @@ static void nxeg_tbposition(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size, /* Report the position */ - message("nxeg_ptbosition%d: hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n", - st->wnum, hwnd, size->w, size->h, pos->x, pos->y, - bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y); + printf("nxeg_ptbosition%d: hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n", + st->wnum, hwnd, size->w, size->h, pos->x, pos->y, + bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y); } #endif @@ -282,8 +282,8 @@ static void nxeg_tbmousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos, { FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg; - message("nxeg_tbmousein%d: hwnd=%p pos=(%d,%d) button=%02x\n", - st->wnum, hwnd, pos->x, pos->y, buttons); + printf("nxeg_tbmousein%d: hwnd=%p pos=(%d,%d) button=%02x\n", + st->wnum, hwnd, pos->x, pos->y, buttons); } #endif #endif @@ -320,7 +320,7 @@ FAR void *nx_listenerthread(FAR void *arg) * the server. */ - message("nx_listenerthread: Lost server connection: %d\n", errno); + printf("nx_listenerthread: Lost server connection: %d\n", errno); exit(NXEXIT_LOSTSERVERCONN); } @@ -330,7 +330,7 @@ FAR void *nx_listenerthread(FAR void *arg) { g_connected = true; sem_post(&g_semevent); - message("nx_listenerthread: Connected\n"); + printf("nx_listenerthread: Connected\n"); } } } diff --git a/apps/examples/nx/nx_internal.h b/apps/examples/nx/nx_internal.h index 53f1763b4..67504227a 100644 --- a/apps/examples/nx/nx_internal.h +++ b/apps/examples/nx/nx_internal.h @@ -164,26 +164,6 @@ #define NXTK_MAXKBDCHARS 16 -/* Debug ********************************************************************/ - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# define message(...) lowsyslog(__VA_ARGS__) -# define msgflush() -# else -# define message(...) printf(__VA_ARGS__) -# define msgflush() fflush(stdout) -# endif -#else -# ifdef CONFIG_DEBUG -# define message lowsyslog -# define msgflush() -# else -# define message printf -# define msgflush() fflush(stdout) -# endif -#endif - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/apps/examples/nx/nx_kbdin.c b/apps/examples/nx/nx_kbdin.c index df4a0faa1..67a90d03a 100644 --- a/apps/examples/nx/nx_kbdin.c +++ b/apps/examples/nx/nx_kbdin.c @@ -127,7 +127,7 @@ static void nxeg_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, (unsigned int)bm->glyph->stride); if (ret < 0) { - message("nxeg_fillchar: nxtk_bitmapwindow failed: %d\n", errno); + printf("nxeg_fillchar: nxtk_bitmapwindow failed: %d\n", errno); } #else ret = nx_bitmap((NXWINDOW)hwnd, &intersection, &src, @@ -135,7 +135,7 @@ static void nxeg_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, (unsigned int)bm->glyph->stride); if (ret < 0) { - message("nxeg_fillchar: nx_bitmapwindow failed: %d\n", errno); + printf("nxeg_fillchar: nx_bitmapwindow failed: %d\n", errno); } #endif } @@ -162,7 +162,7 @@ nxeg_renderglyph(FAR struct nxeg_state_s *st, /* Make sure that there is room for another glyph */ - message("nxeg_renderglyph: ch=%02x\n", ch); + printf("nxeg_renderglyph: ch=%02x\n", ch); if (st->nglyphs < NXTK_MAXKBDCHARS) { /* Allocate the glyph */ @@ -242,7 +242,7 @@ nxeg_renderglyph(FAR struct nxeg_state_s *st, { /* Actually, the RENDERER never returns a failure */ - message("nxeg_renderglyph: RENDERER failed\n"); + printf("nxeg_renderglyph: RENDERER failed\n"); free(glyph->bitmap); glyph->bitmap = NULL; glyph = NULL; @@ -428,7 +428,7 @@ void nxeg_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch, FAR void *arg) { FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg; - message("nxeg_kbdin%d: hwnd=%p nch=%d\n", st->wnum, hwnd, nch); + printf("nxeg_kbdin%d: hwnd=%p nch=%d\n", st->wnum, hwnd, nch); nxeg_addchars(hwnd, st, nch, ch); } @@ -440,8 +440,8 @@ void nxeg_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch, void nxeg_tbkbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg) { FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg; - message("nxeg_tbkbdin: ERROR -- toolbar should not received keyboard input\n"); - message("nxeg_tbkbdin%d: hwnd=%p nch=%d\n", st->wnum, hwnd, nch); + printf("nxeg_tbkbdin: ERROR -- toolbar should not received keyboard input\n"); + printf("nxeg_tbkbdin%d: hwnd=%p nch=%d\n", st->wnum, hwnd, nch); } #endif diff --git a/apps/examples/nx/nx_main.c b/apps/examples/nx/nx_main.c index 8fad0bee5..1111d4ee2 100644 --- a/apps/examples/nx/nx_main.c +++ b/apps/examples/nx/nx_main.c @@ -153,7 +153,7 @@ static void nxeg_drivemouse(void) { for (y = 0; y < g_yres; y += ystep) { - message("nxeg_drivemouse: Mouse left button at (%d,%d)\n", x, y); + printf("nxeg_drivemouse: Mouse left button at (%d,%d)\n", x, y); (void)nx_mousein(g_hnx, x, y, NX_MOUSE_LEFTBUTTON); } } @@ -231,7 +231,7 @@ static inline NXEGWINDOW nxeg_openwindow(FAR const struct nx_callback_s *cb, hwnd = nx_openwindow(g_hnx, cb, (FAR void *)state); if (!hwnd) { - message("nxeg_openwindow: nx_openwindow failed: %d\n", errno); + printf("nxeg_openwindow: nx_openwindow failed: %d\n", errno); g_exitcode = NXEXIT_NXOPENWINDOW; } return hwnd; @@ -245,7 +245,7 @@ static inline NXEGWINDOW nxeg_openwindow(FAR const struct nx_callback_s *cb, hwnd = nxtk_openwindow(g_hnx, cb, (FAR void *)state); if (!hwnd) { - message("nxeg_openwindow: nxtk_openwindow failed: %d\n", errno); + printf("nxeg_openwindow: nxtk_openwindow failed: %d\n", errno); g_exitcode = NXEXIT_NXOPENWINDOW; } return hwnd; @@ -262,7 +262,7 @@ static inline int nxeg_closewindow(NXEGWINDOW hwnd, FAR struct nxeg_state_s *sta int ret = nx_closewindow(hwnd); if (ret < 0) { - message("nxeg_closewindow: nx_closewindow failed: %d\n", errno); + printf("nxeg_closewindow: nx_closewindow failed: %d\n", errno); g_exitcode = NXEXIT_NXCLOSEWINDOW; } return ret; @@ -273,7 +273,7 @@ static inline int nxeg_closewindow(NXEGWINDOW hwnd, FAR struct nxeg_state_s *sta int ret = nxtk_closewindow(hwnd); if (ret < 0) { - message("nxeg_closewindow: nxtk_closewindow failed: %d\n", errno); + printf("nxeg_closewindow: nxtk_closewindow failed: %d\n", errno); g_exitcode = NXEXIT_NXCLOSEWINDOW; } nxeg_freestate(state); @@ -291,7 +291,7 @@ static inline int nxeg_setsize(NXEGWINDOW hwnd, FAR struct nxgl_size_s *size) int ret = nx_setsize(hwnd, size); if (ret < 0) { - message("nxeg_setsize: nx_setsize failed: %d\n", errno); + printf("nxeg_setsize: nx_setsize failed: %d\n", errno); g_exitcode = NXEXIT_NXSETSIZE; } return ret; @@ -302,7 +302,7 @@ static inline int nxeg_setsize(NXEGWINDOW hwnd, FAR struct nxgl_size_s *size) int ret = nxtk_setsize(hwnd, size); if (ret < 0) { - message("nxeg_setsize: nxtk_setsize failed: %d\n", errno); + printf("nxeg_setsize: nxtk_setsize failed: %d\n", errno); g_exitcode = NXEXIT_NXSETSIZE; } return ret; @@ -319,7 +319,7 @@ static inline int nxeg_setposition(NXEGWINDOW hwnd, FAR struct nxgl_point_s *pos int ret = nx_setposition(hwnd, pos); if (ret < 0) { - message("nxeg_setposition: nx_setposition failed: %d\n", errno); + printf("nxeg_setposition: nx_setposition failed: %d\n", errno); g_exitcode = NXEXIT_NXSETPOSITION; } return ret; @@ -330,7 +330,7 @@ static inline int nxeg_setposition(NXEGWINDOW hwnd, FAR struct nxgl_point_s *pos int ret = nxtk_setposition(hwnd, pos); if (ret < 0) { - message("nxeg_setposition: nxtk_setposition failed: %d\n", errno); + printf("nxeg_setposition: nxtk_setposition failed: %d\n", errno); g_exitcode = NXEXIT_NXSETPOSITION; } return ret; @@ -350,7 +350,7 @@ static inline int nxeq_opentoolbar(NXEGWINDOW hwnd, nxgl_coord_t height, ret = nxtk_opentoolbar(hwnd, height, cb, (FAR void *)state); if (ret < 0) { - message("nxeq_opentoolbar: nxtk_opentoolbar failed: %d\n", errno); + printf("nxeq_opentoolbar: nxtk_opentoolbar failed: %d\n", errno); g_exitcode = NXEXIT_NXOPENTOOLBAR; } return ret; @@ -367,7 +367,7 @@ static inline int nxeg_lower(NXEGWINDOW hwnd) int ret = nx_lower(hwnd); if (ret < 0) { - message("nxeg_lower: nx_lower failed: %d\n", errno); + printf("nxeg_lower: nx_lower failed: %d\n", errno); g_exitcode = NXEXIT_NXLOWER; } return ret; @@ -378,7 +378,7 @@ static inline int nxeg_lower(NXEGWINDOW hwnd) int ret = nxtk_lower(hwnd); if (ret < 0) { - message("nxeg_lower: nxtk_lower failed: %d\n", errno); + printf("nxeg_lower: nxtk_lower failed: %d\n", errno); g_exitcode = NXEXIT_NXLOWER; } return ret; @@ -395,7 +395,7 @@ static inline int nxeg_raise(NXEGWINDOW hwnd) int ret = nx_raise(hwnd); if (ret < 0) { - message("nxeg_raise: nx_raise failed: %d\n", errno); + printf("nxeg_raise: nx_raise failed: %d\n", errno); g_exitcode = NXEXIT_NXRAISE; } return ret; @@ -406,7 +406,7 @@ static inline int nxeg_raise(NXEGWINDOW hwnd) int ret = nxtk_raise(hwnd); if (ret < 0) { - message("nxeg_raise: nxtk_raise failed: %d\n", errno); + printf("nxeg_raise: nxtk_raise failed: %d\n", errno); g_exitcode = NXEXIT_NXRAISE; } return ret; @@ -425,11 +425,11 @@ static inline int nxeg_suinitialize(void) #if defined(CONFIG_EXAMPLES_NX_EXTERNINIT) /* Use external graphics driver initialization */ - message("nxeg_initialize: Initializing external graphics device\n"); + printf("nxeg_initialize: Initializing external graphics device\n"); dev = up_nxdrvinit(CONFIG_EXAMPLES_NX_DEVNO); if (!dev) { - message("nxeg_initialize: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO); + printf("nxeg_initialize: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO); g_exitcode = NXEXIT_EXTINITIALIZE; return ERROR; } @@ -439,11 +439,11 @@ static inline int nxeg_suinitialize(void) /* Initialize the LCD device */ - message("nxeg_initialize: Initializing LCD\n"); + printf("nxeg_initialize: Initializing LCD\n"); ret = up_lcdinitialize(); if (ret < 0) { - message("nxeg_initialize: up_lcdinitialize failed: %d\n", -ret); + printf("nxeg_initialize: up_lcdinitialize failed: %d\n", -ret); g_exitcode = NXEXIT_LCDINITIALIZE; return ERROR; } @@ -453,7 +453,7 @@ static inline int nxeg_suinitialize(void) dev = up_lcdgetdev(CONFIG_EXAMPLES_NX_DEVNO); if (!dev) { - message("nxeg_initialize: up_lcdgetdev failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO); + printf("nxeg_initialize: up_lcdgetdev failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO); g_exitcode = NXEXIT_LCDGETDEV; return ERROR; } @@ -466,11 +466,11 @@ static inline int nxeg_suinitialize(void) /* Initialize the frame buffer device */ - message("nxeg_initialize: Initializing framebuffer\n"); + printf("nxeg_initialize: Initializing framebuffer\n"); ret = up_fbinitialize(); if (ret < 0) { - message("nxeg_initialize: up_fbinitialize failed: %d\n", -ret); + printf("nxeg_initialize: up_fbinitialize failed: %d\n", -ret); g_exitcode = NXEXIT_FBINITIALIZE; return ERROR; } @@ -478,7 +478,7 @@ static inline int nxeg_suinitialize(void) dev = up_fbgetvplane(CONFIG_EXAMPLES_NX_VPLANE); if (!dev) { - message("nxeg_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NX_VPLANE); + printf("nxeg_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NX_VPLANE); g_exitcode = NXEXIT_FBGETVPLANE; return ERROR; } @@ -486,11 +486,11 @@ static inline int nxeg_suinitialize(void) /* Then open NX */ - message("nxeg_initialize: Open NX\n"); + printf("nxeg_initialize: Open NX\n"); g_hnx = nx_open(dev); if (!g_hnx) { - message("nxeg_suinitialize: nx_open failed: %d\n", errno); + printf("nxeg_suinitialize: nx_open failed: %d\n", errno); g_exitcode = NXEXIT_NXOPEN; return ERROR; } @@ -516,19 +516,19 @@ static inline int nxeg_muinitialize(void) ret = sched_setparam(0, ¶m); if (ret < 0) { - message("nxeg_initialize: sched_setparam failed: %d\n" , ret); + printf("nxeg_initialize: sched_setparam failed: %d\n" , ret); g_exitcode = NXEXIT_SCHEDSETPARAM; return ERROR; } /* Start the server task */ - message("nxeg_initialize: Starting nx_servertask task\n"); + printf("nxeg_initialize: Starting nx_servertask task\n"); servrid = task_create("NX Server", CONFIG_EXAMPLES_NX_SERVERPRIO, CONFIG_EXAMPLES_NX_STACKSIZE, nx_servertask, NULL); if (servrid < 0) { - message("nxeg_initialize: Failed to create nx_servertask task: %d\n", errno); + printf("nxeg_initialize: Failed to create nx_servertask task: %d\n", errno); g_exitcode = NXEXIT_TASKCREATE; return ERROR; } @@ -575,7 +575,7 @@ static inline int nxeg_muinitialize(void) } else { - message("nxeg_initialize: nx_connect failed: %d\n", errno); + printf("nxeg_initialize: nx_connect failed: %d\n", errno); g_exitcode = NXEXIT_NXCONNECT; return ERROR; } @@ -633,10 +633,10 @@ int nx_main(int argc, char *argv[]) /* Initialize */ ret = nxeg_initialize(); - message("nx_main: NX handle=%p\n", g_hnx); + printf("nx_main: NX handle=%p\n", g_hnx); if (!g_hnx || ret < 0) { - message("nx_main: Failed to get NX handle: %d\n", errno); + printf("nx_main: Failed to get NX handle: %d\n", errno); g_exitcode = NXEXIT_NXOPEN; goto errout; } @@ -646,29 +646,29 @@ int nx_main(int argc, char *argv[]) g_fonthandle = nxf_getfonthandle(CONFIG_EXAMPLES_NX_FONTID); if (!g_fonthandle) { - message("nx_main: Failed to get font handle: %d\n", errno); + printf("nx_main: Failed to get font handle: %d\n", errno); g_exitcode = NXEXIT_FONTOPEN; goto errout; } /* Set the background to the configured background color */ - message("nx_main: Set background color=%d\n", CONFIG_EXAMPLES_NX_BGCOLOR); + printf("nx_main: Set background color=%d\n", CONFIG_EXAMPLES_NX_BGCOLOR); color = CONFIG_EXAMPLES_NX_BGCOLOR; ret = nx_setbgcolor(g_hnx, &color); if (ret < 0) { - message("nx_main: nx_setbgcolor failed: %d\n", errno); + printf("nx_main: nx_setbgcolor failed: %d\n", errno); g_exitcode = NXEXIT_NXSETBGCOLOR; goto errout_with_nx; } /* Create window #1 */ - message("nx_main: Create window #1\n"); + printf("nx_main: Create window #1\n"); nxeg_initstate(&g_wstate[0], 1, CONFIG_EXAMPLES_NX_COLOR1); hwnd1 = nxeg_openwindow(&g_nxcb, &g_wstate[0]); - message("nx_main: hwnd1=%p\n", hwnd1); + printf("nx_main: hwnd1=%p\n", hwnd1); if (!hwnd1) { goto errout_with_nx; @@ -680,14 +680,14 @@ int nx_main(int argc, char *argv[]) { (void)sem_wait(&g_semevent); } - message("nx_main: Screen resolution (%d,%d)\n", g_xres, g_yres); + printf("nx_main: Screen resolution (%d,%d)\n", g_xres, g_yres); /* Set the size of the window 1 */ size.w = g_xres / 2; size.h = g_yres / 2; - message("nx_main: Set window #1 size to (%d,%d)\n", size.w, size.h); + printf("nx_main: Set window #1 size to (%d,%d)\n", size.w, size.h); ret = nxeg_setsize(hwnd1, &size); if (ret < 0) { @@ -699,7 +699,7 @@ int nx_main(int argc, char *argv[]) * actually do them! */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(1); /* Set the position of window #1 */ @@ -707,7 +707,7 @@ int nx_main(int argc, char *argv[]) pt.x = g_xres / 8; pt.y = g_yres / 8; - message("nx_main: Set window #1 position to (%d,%d)\n", pt.x, pt.y); + printf("nx_main: Set window #1 position to (%d,%d)\n", pt.x, pt.y); ret = nxeg_setposition(hwnd1, &pt); if (ret < 0) { @@ -716,13 +716,13 @@ int nx_main(int argc, char *argv[]) /* Sleep a bit */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(1); /* Open the toolbar */ #ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS - message("nx_main: Add toolbar to window #1\n"); + printf("nx_main: Add toolbar to window #1\n"); ret = nxeq_opentoolbar(hwnd1, CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT, &g_tbcb, &g_wstate[0]); if (ret < 0) { @@ -731,16 +731,16 @@ int nx_main(int argc, char *argv[]) /* Sleep a bit */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(1); #endif /* Create window #2 */ - message("nx_main: Create window #2\n"); + printf("nx_main: Create window #2\n"); nxeg_initstate(&g_wstate[1], 2, CONFIG_EXAMPLES_NX_COLOR2); hwnd2 = nxeg_openwindow(&g_nxcb, &g_wstate[1]); - message("nx_main: hwnd2=%p\n", hwnd2); + printf("nx_main: hwnd2=%p\n", hwnd2); if (!hwnd2) { goto errout_with_hwnd1; @@ -748,12 +748,12 @@ int nx_main(int argc, char *argv[]) /* Sleep a bit */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(1); /* Set the size of the window 2 == size of window 1*/ - message("nx_main: Set hwnd2 size to (%d,%d)\n", size.w, size.h); + printf("nx_main: Set hwnd2 size to (%d,%d)\n", size.w, size.h); ret = nxeg_setsize(hwnd2, &size); if (ret < 0) { @@ -762,7 +762,7 @@ int nx_main(int argc, char *argv[]) /* Sleep a bit */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(1); /* Set the position of window #2 */ @@ -770,7 +770,7 @@ int nx_main(int argc, char *argv[]) pt.x = g_xres - size.w - pt.x; pt.y = g_yres - size.h - pt.y; - message("nx_main: Set hwnd2 position to (%d,%d)\n", pt.x, pt.y); + printf("nx_main: Set hwnd2 position to (%d,%d)\n", pt.x, pt.y); ret = nxeg_setposition(hwnd2, &pt); if (ret < 0) { @@ -779,11 +779,11 @@ int nx_main(int argc, char *argv[]) /* Sleep a bit */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(1); #ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS - message("nx_main: Add toolbar to window #2\n"); + printf("nx_main: Add toolbar to window #2\n"); ret = nxeq_opentoolbar(hwnd2, CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT, &g_tbcb, &g_wstate[1]); if (ret < 0) { @@ -792,30 +792,30 @@ int nx_main(int argc, char *argv[]) /* Sleep a bit */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(1); #endif /* Give keyboard input to the top window -- should be window #2 */ #ifdef CONFIG_NX_KBD - message("nx_main: Send keyboard input: %s\n", g_kbdmsg1); + printf("nx_main: Send keyboard input: %s\n", g_kbdmsg1); ret = nx_kbdin(g_hnx, strlen((FAR const char *)g_kbdmsg1), g_kbdmsg1); if (ret < 0) { - message("nx_main: nx_kbdin failed: %d\n", errno); + printf("nx_main: nx_kbdin failed: %d\n", errno); goto errout_with_hwnd2; } /* Sleep a bit */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(1); #endif /* Lower window 2 */ - message("nx_main: Lower window #2\n"); + printf("nx_main: Lower window #2\n"); ret = nxeg_lower(hwnd2); if (ret < 0) { @@ -824,7 +824,7 @@ int nx_main(int argc, char *argv[]) /* Sleep a bit */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(1); /* Put mouse left-button clicks all over the screen and see who responds */ @@ -834,30 +834,30 @@ int nx_main(int argc, char *argv[]) /* Sleep a bit */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(1); #endif /* Give keyboard input to the top window -- should be window #1 */ #ifdef CONFIG_NX_KBD - message("nx_main: Send keyboard input: %s\n", g_kbdmsg2); + printf("nx_main: Send keyboard input: %s\n", g_kbdmsg2); ret = nx_kbdin(g_hnx, strlen((FAR const char *)g_kbdmsg2), g_kbdmsg2); if (ret < 0) { - message("nx_main: nx_kbdin failed: %d\n", errno); + printf("nx_main: nx_kbdin failed: %d\n", errno); goto errout_with_hwnd2; } /* Sleep a bit */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(1); #endif /* Raise window 2 */ - message("nx_main: Raise window #2\n"); + printf("nx_main: Raise window #2\n"); ret = nxeg_raise(hwnd2); if (ret < 0) { @@ -872,31 +872,31 @@ int nx_main(int argc, char *argv[]) /* Sleep a bit */ - message("nx_main: Sleeping\n\n"); + printf("nx_main: Sleeping\n\n"); sleep(2); /* Close the window 2 */ errout_with_hwnd2: - message("nx_main: Close window #2\n"); + printf("nx_main: Close window #2\n"); (void)nxeg_closewindow(hwnd2, &g_wstate[1]); /* Close the window1 */ errout_with_hwnd1: - message("nx_main: Close window #1\n"); + printf("nx_main: Close window #1\n"); (void)nxeg_closewindow(hwnd1, &g_wstate[0]); errout_with_nx: #ifdef CONFIG_NX_MULTIUSER /* Disconnect from the server */ - message("nx_main: Disconnect from the server\n"); + printf("nx_main: Disconnect from the server\n"); nx_disconnect(g_hnx); #else /* Close the server */ - message("nx_main: Close NX\n"); + printf("nx_main: Close NX\n"); nx_close(g_hnx); #endif errout: diff --git a/apps/examples/nx/nx_server.c b/apps/examples/nx/nx_server.c index 0cf3066de..5a4aa4096 100644 --- a/apps/examples/nx/nx_server.c +++ b/apps/examples/nx/nx_server.c @@ -91,11 +91,11 @@ int nx_servertask(int argc, char *argv[]) #if defined(CONFIG_EXAMPLES_NX_EXTERNINIT) /* Use external graphics driver initialization */ - message("nxeg_initialize: Initializing external graphics device\n"); + printf("nxeg_initialize: Initializing external graphics device\n"); dev = up_nxdrvinit(CONFIG_EXAMPLES_NX_DEVNO); if (!dev) { - message("nxeg_initialize: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO); + printf("nxeg_initialize: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO); g_exitcode = NXEXIT_EXTINITIALIZE; return ERROR; } @@ -103,11 +103,11 @@ int nx_servertask(int argc, char *argv[]) #elif defined(CONFIG_NX_LCDDRIVER) /* Initialize the LCD device */ - message("nx_servertask: Initializing LCD\n"); + printf("nx_servertask: Initializing LCD\n"); ret = up_lcdinitialize(); if (ret < 0) { - message("nx_servertask: up_lcdinitialize failed: %d\n", -ret); + printf("nx_servertask: up_lcdinitialize failed: %d\n", -ret); return 1; } @@ -116,7 +116,7 @@ int nx_servertask(int argc, char *argv[]) dev = up_lcdgetdev(CONFIG_EXAMPLES_NX_DEVNO); if (!dev) { - message("nx_servertask: up_lcdgetdev failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO); + printf("nx_servertask: up_lcdgetdev failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO); return 2; } @@ -126,18 +126,18 @@ int nx_servertask(int argc, char *argv[]) #else /* Initialize the frame buffer device */ - message("nx_servertask: Initializing framebuffer\n"); + printf("nx_servertask: Initializing framebuffer\n"); ret = up_fbinitialize(); if (ret < 0) { - message("nx_servertask: up_fbinitialize failed: %d\n", -ret); + printf("nx_servertask: up_fbinitialize failed: %d\n", -ret); return 1; } dev = up_fbgetvplane(CONFIG_EXAMPLES_NX_VPLANE); if (!dev) { - message("nx_servertask: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NX_VPLANE); + printf("nx_servertask: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NX_VPLANE); return 2; } #endif @@ -145,7 +145,7 @@ int nx_servertask(int argc, char *argv[]) /* Then start the server */ ret = nx_run(dev); - message("nx_servertask: nx_run returned: %d\n", errno); + printf("nx_servertask: nx_run returned: %d\n", errno); return 3; } -- cgit v1.2.3