You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/08/25 05:48:40 UTC
[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #839: system/termcurses: Add terminate operation into the termcurses_ops_s interface
xiaoxiang781216 commented on a change in pull request #839:
URL: https://github.com/apache/incubator-nuttx-apps/pull/839#discussion_r695413077
##########
File path: system/termcurses/tcurses_vt100.c
##########
@@ -1479,3 +1485,29 @@ FAR struct termcurses_s *tcurses_vt100_initialize(int in_fd, int out_fd)
return (FAR struct termcurses_s *) priv;
}
+
+/************************************************************************************
+ * Name: tcurses_vt100_terminate
+ *
+ * Description:
+ * Terminates a specific instance of the VT100 TermCurses handler.
+ *
+ ************************************************************************************/
+
+static int tcurses_vt100_terminate(FAR struct termcurses_s *dev)
+{
+ FAR struct tcurses_vt100_s *priv;
+ int fd;
+
+ priv = (FAR struct tcurses_vt100_s *) dev;
+ fd = priv->out_fd;
+
+ /*
+ Set default foreground and background colors.
+ (Ignore the return result.)
+ */
+
+ write(fd, g_setdefcolors, strlen(g_setdefcolors));
+
+ return OK;
+}
Review comment:
add newline
##########
File path: include/system/termcurses.h
##########
@@ -157,7 +161,7 @@ extern "C"
****************************************************************************/
int termcurses_initterm(FAR const char *term_type, int in_fd, int out_fd,
- FAR struct termcurses_s **dev);
+ FAR struct termcurses_s **term);
Review comment:
why change to term? It looks bad to mix dev and term for the same thing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org