Fri Feb 18 21:09:29 PST 2000 Michael Jennings <mej@eterm.org>

Okay, I've added a new option to configure.  --config-buffer-size=NNNN
	will set the theme parser's line buffer size.  What does this mean?
	Well, this determines how big a line being parsed can get at any one
	stage of parsing.  So if you use %dirscan() on a large directory, or
	you use %random() on a large list, or you simply have some very large
	lines in your config file, making this buffer size larger will enable
	them to be handled.  The down side to this is that your Eterms will
	appear to take up more memory.  In reality they don't, since all that
	memory gets freed, but it isn't returned to the OS until Eterm exits,
	and the RSS won't go down unless part or all of Eterm is swapped out
	by the OS.  So you've been warned. :-)

	For those who didn't go digging by themselves, what I added yesterday
	were three new builtin functions:

	%get(variable)         Retrieves the value of a theme variable
	%put(variable value)   Sets the value of a theme variable
	%put(variable)         Removes a theme variable
	%dirscan(directory)    Returns a list of the files in a directory

	Everything here should be fairly self-explanatory.  The variables
	are internal to Eterm.  They will last until Eterm exits, so you
	can refer to them in later theme files, unless of course you call
	%put() with a variable but no value (which removes the variable).
	Also note that %dirscan() returns only the filenames, not the
	full pathnames.  This is for two reasons:  One, you already know the
	path to the file since you specified it.  Two, it enables handling of
	directories with larger numbers of files since the path isn't
	uselessly duplicated for each entry it generates.

	These new functions will be the backbone for a new random background
	system since the *.list files are rather clumsy in a lot of ways.  I
	am not yet sure how it will work exactly, but I know I'll need these
	functions to do it. :-)


SVN revision: 2104
eterm-0.10
Michael Jennings 24 years ago
parent 5a2899ac7f
commit d2ca8950e1
  1. 38
      ChangeLog
  2. 1
      acconfig.h
  3. 13
      configure.in
  4. 29
      src/options.c
  5. 3
      src/options.h

@ -3204,3 +3204,41 @@ Thu Feb 17 21:38:23 PST 2000 Michael Jennings <mej@eterm.org>
tried testing it at *all*, so I'm not prepared to talk about it.
-------------------------------------------------------------------------------
Fri Feb 18 21:09:29 PST 2000 Michael Jennings <mej@eterm.org>
Okay, I've added a new option to configure. --config-buffer-size=NNNN
will set the theme parser's line buffer size. What does this mean?
Well, this determines how big a line being parsed can get at any one
stage of parsing. So if you use %dirscan() on a large directory, or
you use %random() on a large list, or you simply have some very large
lines in your config file, making this buffer size larger will enable
them to be handled. The down side to this is that your Eterms will
appear to take up more memory. In reality they don't, since all that
memory gets freed, but it isn't returned to the OS until Eterm exits,
and the RSS won't go down unless part or all of Eterm is swapped out
by the OS. So you've been warned. :-)
For those who didn't go digging by themselves, what I added yesterday
were three new builtin functions:
%get(variable) Retrieves the value of a theme variable
%put(variable value) Sets the value of a theme variable
%put(variable) Removes a theme variable
%dirscan(directory) Returns a list of the files in a directory
Everything here should be fairly self-explanatory. The variables
are internal to Eterm. They will last until Eterm exits, so you
can refer to them in later theme files, unless of course you call
%put() with a variable but no value (which removes the variable).
Also note that %dirscan() returns only the filenames, not the
full pathnames. This is for two reasons: One, you already know the
path to the file since you specified it. Two, it enables handling of
directories with larger numbers of files since the path isn't
uselessly duplicated for each entry it generates.
These new functions will be the backbone for a new random background
system since the *.list files are rather clumsy in a lot of ways. I
am not yet sure how it will work exactly, but I know I'll need these
functions to do it. :-)
-------------------------------------------------------------------------------

@ -328,6 +328,7 @@
#undef ENABLE_PROFILE
#undef KS_HOME
#undef KS_END
#undef CONFIG_BUFF
/* Leave that blank line there!! Autoheader needs it.

@ -506,6 +506,7 @@ AC_ARG_ENABLE(xim,
AC_DEFINE(USE_XIM)
XIM="TRUE"
)
AC_MSG_CHECKING(for Greek keyboard support)
AC_ARG_ENABLE(greek,
[ --enable-greek compile with support for Greek keyboards],
@ -516,6 +517,17 @@ AC_ARG_ENABLE(greek,
AC_MSG_RESULT(no)
fi, AC_MSG_RESULT(no)
)
CONFIG_BUFF_SIZE=20480
AC_MSG_CHECKING(for the buffer size of the config file parser)
AC_ARG_WITH(config-buffer-size,
[ --config-buffer-size specifies the size of the buffer Eterm uses for parsing the config file (default is 20 Kb)],
if test "$withval" != "yes" -a "$withval" != "no"; then
CONFIG_BUFF_SIZE=$withval
fi)
AC_MSG_RESULT($CONFIG_BUFF_SIZE bytes)
AC_DEFINE_UNQUOTED(CONFIG_BUFF, $CONFIG_BUFF_SIZE)
AC_ARG_WITH(terminfo,
[ --without-terminfo do not compile the Eterm terminfo file],
if test "$withval" = "yes"; then
@ -523,6 +535,7 @@ AC_ARG_WITH(terminfo,
else
TIC=true
fi)
AC_ARG_WITH(theme-update,
[ --with-theme-update existing themes will be forceably removed and new ones installed],
if test "$withval" = "yes"; then

@ -1440,7 +1440,9 @@ builtin_get(char *param)
v = conf_get_var(s);
FREE(s);
if (v) {
FREE(f);
if (f) {
FREE(f);
}
return (StrDup(v));
} else if (f) {
return f;
@ -1677,11 +1679,10 @@ shell_expand(char *s)
strncpy(new + j, Output, max - j);
cnt2 = max - j - 1;
j += MIN(l, cnt2);
FREE(Output);
} else {
FREE(Output);
j--;
}
FREE(Output);
} else {
j--;
}
@ -1702,12 +1703,16 @@ shell_expand(char *s)
Command = shell_expand(Command);
Output = builtin_exec(Command);
FREE(Command);
if (Output && *Output) {
l = strlen(Output) - 1;
strncpy(new + j, Output, max - j);
cnt2 = max - j - 1;
j += MIN(l, cnt2);
FREE(Output);
if (Output) {
if (*Output) {
l = strlen(Output) - 1;
strncpy(new + j, Output, max - j);
cnt2 = max - j - 1;
j += MIN(l, cnt2);
} else {
j--;
}
FREE(Output);
} else {
j--;
}
@ -3442,7 +3447,11 @@ conf_parse(char *conf_name, const char *dir, const char *path) {
file_poke_outfile(outfile);
}
} else {
print_error("Parse error in file %s, line %lu: Undefined macro \"%s\"", file_peek_path(), file_peek_line(), buff);
D_OPTIONS(("read_config(): Parsing line #%lu of file %s\n", file_peek_line(), file_peek_path()));
if (file_peek_skip()) {
continue;
}
shell_expand(buff);
}
break;
case 'b':

@ -98,9 +98,6 @@
} \
} while(0)
/* Max length of a line in the config file */
#define CONFIG_BUFF 20480
/* The context table */
#define ctx_name_to_id(the_id, n, i) do { \
for ((i)=0; (i) <= ctx_idx; (i)++) { \

Loading…
Cancel
Save