diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-03 08:33:39 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-03 08:33:39 -0600 |
commit | b617ac1c3e500d248fa7afd583ddbf1660aeb567 (patch) | |
tree | 17d6bff17b8298fc880cd06c03fe0d8cb43eb47d | |
parent | a6c6119c811c117bbeda3edb6a82bd310b0ac3e6 (diff) | |
download | px4-nuttx-b617ac1c3e500d248fa7afd583ddbf1660aeb567.tar.gz px4-nuttx-b617ac1c3e500d248fa7afd583ddbf1660aeb567.tar.bz2 px4-nuttx-b617ac1c3e500d248fa7afd583ddbf1660aeb567.zip |
Remove dependencies on environ, fstat, GETTEXt, TERMCAP, ncurse, syscfg
-rw-r--r-- | apps/interpreters/bas/Kconfig | 20 | ||||
-rw-r--r-- | apps/interpreters/bas/auto.c | 7 | ||||
-rw-r--r-- | apps/interpreters/bas/bas.c | 14 | ||||
-rw-r--r-- | apps/interpreters/bas/config.h | 9 | ||||
-rw-r--r-- | apps/interpreters/bas/error.h | 7 | ||||
-rw-r--r-- | apps/interpreters/bas/fs.c | 35 | ||||
-rw-r--r-- | apps/interpreters/bas/global.c | 18 | ||||
-rw-r--r-- | apps/interpreters/bas/main.c | 17 | ||||
-rw-r--r-- | apps/interpreters/bas/program.c | 12 | ||||
-rw-r--r-- | apps/interpreters/bas/statement.c | 9 | ||||
-rw-r--r-- | apps/interpreters/bas/value.c | 31 | ||||
-rw-r--r-- | apps/interpreters/bas/var.c | 12 |
12 files changed, 39 insertions, 152 deletions
diff --git a/apps/interpreters/bas/Kconfig b/apps/interpreters/bas/Kconfig index 3542f7303..19f82dde1 100644 --- a/apps/interpreters/bas/Kconfig +++ b/apps/interpreters/bas/Kconfig @@ -35,25 +35,5 @@ config INTERPRETERS_BAS if INTERPRETERS_BAS -config INTERPRETER_BAS_HAVE_ENVIRON - bool - default n - depends on EXPERIMENTAL - ---help--- - NuttX does not support the environ variable - -config INTERPRETER_BAS_HAVE_FSTAT - bool - default n - depends on EXPERIMENTAL - ---help--- - NuttX does not support the fstat() function - -config INTERPRETER_BAS_HAVE_SYSCFG - bool - default n - depends on EXPERIMENTAL - ---help--- - NuttX does not support the syscfg() function endif diff --git a/apps/interpreters/bas/auto.c b/apps/interpreters/bas/auto.c index 0dda108b3..d49570ad2 100644 --- a/apps/interpreters/bas/auto.c +++ b/apps/interpreters/bas/auto.c @@ -65,12 +65,6 @@ #include <assert.h> #include <ctype.h> -#ifdef HAVE_GETTEXT -# include <libintl.h> -# define _(String) gettext(String) -#else -# define _(String) String -#endif #include <stdlib.h> #include <string.h> @@ -81,6 +75,7 @@ ****************************************************************************/ #define INCREASE_STACK 16 +#define _(String) String /**************************************************************************** * Public Functions diff --git a/apps/interpreters/bas/bas.c b/apps/interpreters/bas/bas.c index e81b0f34d..c60c127d1 100644 --- a/apps/interpreters/bas/bas.c +++ b/apps/interpreters/bas/bas.c @@ -11,12 +11,6 @@ #include <ctype.h> #include <errno.h> #include <fcntl.h> -#ifdef HAVE_GETTEXT -# include <libintl.h> -# define _(String) gettext(String) -#else -# define _(String) String -#endif #include <limits.h> #include <math.h> #include <string.h> @@ -41,9 +35,7 @@ ****************************************************************************/ #define DIRECTMODE (pc.line== -1) -#ifndef __GNUC__ -# define inline -#endif +#define _(String) String /**************************************************************************** * Private Types @@ -1862,10 +1854,6 @@ more: void bas_init(int backslash_colon, int restricted, int uppercase, int lpfd) { -#ifdef HAVE_GETTEXT - bindtextdomain("bas", LOCALEDIR); - textdomain("bas"); -#endif stack.begindata.line = -1; Token_init(backslash_colon, uppercase); Global_new(&globals); diff --git a/apps/interpreters/bas/config.h b/apps/interpreters/bas/config.h index 9572b11c8..3de84427f 100644 --- a/apps/interpreters/bas/config.h +++ b/apps/interpreters/bas/config.h @@ -5,12 +5,6 @@ /* The package name. */ #define PACKAGE "bas" -/* Should we need to include termcap.h? */ -/* #undef HAVE_TERMCAP_H */ - -/* Should we need to include curses.h? */ -/* #undef HAVE_CURSES_H */ - /* Is there a tgmath.h? */ /* #undef HAVE_TGMATH_H */ @@ -30,8 +24,5 @@ /* #undef _FILE_OFFSET_BITS */ /* #undef _LARGE_FILES */ -/* Define if you have the msgfmt(1) program and the gettext(3) function. */ -/* #undef HAVE_GETTEXT */ - /* Define if timeouts do not work in your termios (broken termios). */ /* #undef USE_SELECT */ diff --git a/apps/interpreters/bas/error.h b/apps/interpreters/bas/error.h index cb796707d..3f3e5e26a 100644 --- a/apps/interpreters/bas/error.h +++ b/apps/interpreters/bas/error.h @@ -1,14 +1,7 @@ #ifndef ERROR_H #define ERROR_H -//#include "config.h" - -#ifdef HAVE_GETTEXT -#include <libintl.h> -#define _(String) gettext(String) -#else #define _(String) String -#endif #define STATIC 100 diff --git a/apps/interpreters/bas/fs.c b/apps/interpreters/bas/fs.c index f4302e55d..2471e167c 100644 --- a/apps/interpreters/bas/fs.c +++ b/apps/interpreters/bas/fs.c @@ -67,21 +67,9 @@ #include <sys/time.h> #include <sys/types.h> -#ifdef CONFIG_INTERPRETER_BAS_HAVE_FSTAT -# include <sys/stat.h> -#endif - #include <assert.h> #include <errno.h> #include <fcntl.h> - -#ifdef HAVE_GETTEXT -# include <libintl.h> -# define _(String) gettext(String) -#else -# define _(String) String -#endif - #include <math.h> #include <signal.h> #include <stdio.h> @@ -89,12 +77,6 @@ #include <string.h> #include <termios.h> #include <time.h> -#ifdef HAVE_TERMCAP_H -# include <termcap.h> -#endif -#ifdef HAVE_CURSES_H -# include <curses.h> -#endif #include <unistd.h> #include "fs.h" @@ -106,6 +88,8 @@ #define LINEWIDTH 80 #define COLWIDTH 14 +#define _(String) String + /**************************************************************************** * Private Data ****************************************************************************/ @@ -1532,12 +1516,8 @@ long int FS_loc(int chn) long int FS_lof(int chn) { -#ifdef CONFIG_INTERPRETER_BAS_HAVE_FSTAT - struct stat buf; -#else off_t curpos; off_t endpos; -#endif int fd; if (opened(chn, -1) == -1) @@ -1565,16 +1545,6 @@ long int FS_lof(int chn) assert(fd != -1); /* Get the size of the file */ - -#ifdef CONFIG_INTERPRETER_BAS_HAVE_FSTAT - if (fstat(fd, &buf) == -1) - { - FS_errmsg = strerror(errno); - return -1; - } - - return (long int)(buf.st_size / file[chn]->recLength); -#else /* Save the current file position */ curpos = lseek(fd, 0, SEEK_CUR); @@ -1603,7 +1573,6 @@ long int FS_lof(int chn) } return (long int)(endpos / file[chn]->recLength); -#endif } long int FS_recLength(int chn) diff --git a/apps/interpreters/bas/global.c b/apps/interpreters/bas/global.c index cb6ead7a7..cf017393a 100644 --- a/apps/interpreters/bas/global.c +++ b/apps/interpreters/bas/global.c @@ -1,5 +1,5 @@ /* Global variables and functions. */ -/* #includes */ /*{{{C}}}*//*{{{*/ + #include <nuttx/config.h> #include "config.h" @@ -7,12 +7,6 @@ #include <ctype.h> #include <dirent.h> #include <errno.h> -#ifdef HAVE_GETTEXT -#include <libintl.h> -#define _(String) gettext(String) -#else -#define _(String) String -#endif #include <math.h> #include <stdarg.h> #include <stdlib.h> @@ -35,14 +29,12 @@ #endif /*}}}*/ -#ifdef CONFIG_INTERPRETER_BAS_HAVE_ENVIRON -extern char **environ; -#endif - #ifndef RAND_MAX # define RAND_MAX 32767 #endif +#define _(String) String + static int wildcardmatch(const char *a, const char *pattern) /*{{{*/ { while (*pattern) @@ -1340,11 +1332,7 @@ static struct Value *fn_tan(struct Value *v, struct Auto *stack) /*{{{*/ /*}}}*/ static struct Value *fn_timei(struct Value *v, struct Auto *stack) /*{{{*/ { -#ifdef CONFIG_INTERPRETER_BAS_HAVE_SYSCFG - return Value_new_INTEGER(v,(unsigned long)(clock_systimer()/(sysconf(_SC_CLK_TCK)/100.0))); -#else return Value_new_INTEGER(v,(unsigned long)(clock_systimer()/(CLK_TCK/100.0))); -#endif } /*}}}*/ static struct Value *fn_times(struct Value *v, struct Auto *stack) /*{{{*/ diff --git a/apps/interpreters/bas/main.c b/apps/interpreters/bas/main.c index 5d0bc5f6b..9f9f6c388 100644 --- a/apps/interpreters/bas/main.c +++ b/apps/interpreters/bas/main.c @@ -65,12 +65,6 @@ #include <unistd.h> #include <errno.h> #include <fcntl.h> -#ifdef HAVE_GETTEXT -# include <libintl.h> -# define _(String) gettext(String) -#else -# define _(String) String -#endif #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -78,6 +72,12 @@ #include "bas.h" /**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define _(String) String + +/**************************************************************************** * Public Functions ****************************************************************************/ @@ -96,11 +96,6 @@ int bas_main(int argc, char *argv[]) int restricted = 0; int lpfd; -#ifdef HAVE_GETTEXT - bindtextdomain("bas", LOCALEDIR); - textdomain("bas"); -#endif - /* parse arguments */ while ((o = getopt(argc, argv, ":bl:ruVh")) != EOF) diff --git a/apps/interpreters/bas/program.c b/apps/interpreters/bas/program.c index f24318979..a39aee406 100644 --- a/apps/interpreters/bas/program.c +++ b/apps/interpreters/bas/program.c @@ -65,12 +65,6 @@ #include <assert.h> #include <errno.h> -#ifdef HAVE_GETTEXT -# include <libintl.h> -# define _(String) gettext(String) -#else -# define _(String) String -#endif #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -81,6 +75,12 @@ #include "program.h" /**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define _(String) String + +/**************************************************************************** * Private Types ****************************************************************************/ diff --git a/apps/interpreters/bas/statement.c b/apps/interpreters/bas/statement.c index 3279e6c9b..532adcbc2 100644 --- a/apps/interpreters/bas/statement.c +++ b/apps/interpreters/bas/statement.c @@ -1,14 +1,9 @@ #include "config.h" -#ifdef HAVE_GETTEXT -#include <libintl.h> -#define _(String) gettext(String) -#else -#define _(String) String -#endif - #include "statement.h" +#define _(String) String + struct Value *stmt_CALL(struct Value *value) { ++pc.token; diff --git a/apps/interpreters/bas/value.c b/apps/interpreters/bas/value.c index d7c591442..e4e31656b 100644 --- a/apps/interpreters/bas/value.c +++ b/apps/interpreters/bas/value.c @@ -66,27 +66,8 @@ #include <ctype.h> #include <errno.h> #include <float.h> - -#ifdef HAVE_GETTEXT -# include <libintl.h> -# define _(String) gettext(String) -#else -# define _(String) String -#endif - #include <limits.h> #include <math.h> - -/* Buggy on some systems */ - -#if 0 -# ifdef HAVE_TGMATH_H -# include <tgmath.h> -# endif -#else -extern long int lrint(double x); -#endif - #include <stdarg.h> #include <stdio.h> #include <stdlib.h> @@ -96,6 +77,18 @@ extern long int lrint(double x); #include "value.h" /**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define _(String) String + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +extern long int lrint(double x); + +/**************************************************************************** * Private Data ****************************************************************************/ diff --git a/apps/interpreters/bas/var.c b/apps/interpreters/bas/var.c index f148de88b..a103b663f 100644 --- a/apps/interpreters/bas/var.c +++ b/apps/interpreters/bas/var.c @@ -5,12 +5,6 @@ #include "config.h" #include <assert.h> -#ifdef HAVE_GETTEXT -# include <libintl.h> -# define _(String) gettext(String) -#else -# define _(String) String -#endif #include <math.h> #include <stdlib.h> @@ -18,6 +12,12 @@ #include "var.h" /**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define _(String) String + +/**************************************************************************** * Public Functions ****************************************************************************/ |