zsh-workers
 help / color / mirror / code / Atom feed
* 3.1.6-pws-9 details
@ 1999-11-22 22:06 Peter Stephenson
  1999-11-22 23:04 ` Zefram
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 1999-11-22 22:06 UTC (permalink / raw)
  To: Zsh Hacker's List

This patch is supposed to fix the things noticed by Tanaka Akira and
Bart,
apart from the patch I missed which I've added separately.

Sorry I missed the space in prompt thing --- I saw Geoff's patch, but
thought it fixed something else related.

The remaining 80-column display problem I remember was due to some
terminals adding spaces and some not when the cursor is at the end of
the line.  There was a theory that there was a termcap variable which
could
distinguish the cases, but as far as I can remember there hasn't been
a patch.

By the way, the main difficulty with generating the AIX .export files
automatically is that at the point where they're missed, which is
where they're being imported into a dynamic library, you don't know
which file they're supposed to come from (e.g. is a symbol to be
resolved from zsh itself or from zle.so?)  This makes it hard.  Another
gotcha is that AIX isn't all that informative with errors if something
isn't exported (e.g. from zsh) but is imported (e.g. into zle.so), so if
you fix the .export file so that the library (zle.so) compiles because
it thinks it can get the symbol now, actually it can't unless you
recompile the file that should be exporting it (zsh) too.  It's lucky
Oliver is keeping up with this since I won't be using AIX any more.

--- Completion/Builtins/_vars.fixup	Mon Nov 22 20:30:04 1999
+++ Completion/Builtins/_vars	Mon Nov 22 20:30:08 1999
@@ -22,5 +22,3 @@
 else
   _tags parameters && _parameters
 fi
-
-
--- Completion/User/_make.fixup	Mon Nov 22 20:32:18 1999
+++ Completion/User/_make	Mon Nov 22 20:32:59 1999
@@ -18,11 +18,11 @@
     file=''
   fi
 
-   [[ -n "$file" ]] && _wanted targets expl 'make target' &&
-       compadd "$expl[@]" - \
-           $(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print $1}
- 	         /^\.include  *<bsd\.port\.(subdir\.|pre\.)?mk>/ ||
/^\.include  *".*mk\/bsd\.pkg\.(subdir\.)?mk"/ {
- 	           print "fetch fetch-list extract patch configure build
install reinstall deinstall package describe checkpatch checksum
makesum" }' \
- 	        FS=: $file) && ret=0
+  [[ -n "$file" ]] && _wanted targets expl 'make target' &&
+      compadd "$expl[@]" - \
+          $(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print $1}
+ 	      /^\.include  *<bsd\.port\.(subdir\.|pre\.)?mk>/ || /^\.include 
*".*mk\/bsd\.pkg\.(subdir\.)?mk"/ {
+ 	        print "fetch fetch-list extract patch configure build install
reinstall deinstall package describe checkpatch checksum makesum" }' \
+ 	     FS=: $file) && ret=0
   (( ret )) && { compset -P 1 '*\='; _files }
 fi
--- Doc/Zsh/compsys.yo.fixup	Mon Nov 22 20:34:16 1999
+++ Doc/Zsh/compsys.yo	Mon Nov 22 20:34:21 1999
@@ -2027,12 +2027,6 @@
 taken as the name of an array and its elements will be given to
 functions called to generate matches when executing the
 var(actions). For example, this allows one to give options for the
-tt(compadd) builtin that should be used.
-
-Another option supported is `tt(-O) var(name)'. The var(name) will be
-taken as the name of an array and its elements will be given to
-functions called to generate matches when executing the
-var(actions). For example, this allows one to give options for the
 tt(compadd) builtin that should be used for all var(action)s.
 
 Also, the tt(-M) option followed by a string may be given before the
--- Src/math.c.fixup	Mon Nov 22 20:36:13 1999
+++ Src/math.c	Mon Nov 22 20:36:19 1999
@@ -367,7 +367,7 @@
 #ifdef USE_LOCALE
 		    setlocale(LC_NUMERIC, prev_locale);
 #endif
-		    if (ptr == nptr || *nptr == '.' ) {
+		    if (ptr == nptr || *nptr == '.') {
 			zerr("bad floating point constant", NULL, 0);
 			return EOI;
 		    }
--- configure.in.fixup	Mon Nov 22 20:25:41 1999
+++ configure.in	Mon Nov 22 20:42:11 1999
@@ -398,7 +398,7 @@
 AC_PROG_INSTALL             dnl Check for BSD compatible `install'
 AC_PROG_AWK                 dnl Check for mawk,gawk,nawk, then awk.
 AC_PROG_LN                  dnl Check for working ln, for "make
install"
-AC_CHECK_PROGS([YODL], [yodl], [exit 0; yodl])
+AC_CHECK_PROGS([YODL], [yodl], [: yodl])
 
 dnl ------------------
 dnl CHECK HEADER FILES


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 3.1.6-pws-9 details
  1999-11-22 22:06 3.1.6-pws-9 details Peter Stephenson
@ 1999-11-22 23:04 ` Zefram
  0 siblings, 0 replies; 2+ messages in thread
From: Zefram @ 1999-11-22 23:04 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

Peter Stephenson wrote:
>By the way, the main difficulty with generating the AIX .export files
>automatically is that at the point where they're missed, which is
>where they're being imported into a dynamic library, you don't know
>which file they're supposed to come from (e.g. is a symbol to be
>resolved from zsh itself or from zle.so?)  This makes it hard.

Perhaps I should explain the way I planned to handle this but never
got round to, which was why I never merged the .export patches into
the baseline.

First of all, I was going to have cpp conditionals propagate into the .pro
files, so that there would only be prototypes there for functions that
are actually being compiled.  I see this has now been done.

makepro.awk makes it very easy to automatically generate a list of all the
symbols defined by an object file.  It does actually see all the names --
it has to to do the conditional renaming of module boot/cleanup functions,
and it parses the declarator enough to generate the right prototype.
Generating a plain list of these names as a side effect would be trivial.
(Btw, I have this idea that we could separate the local and external
declarations into separate files, rather than doing preprocessor trickery
with the .pro files.  A system to do that would make getting the symbol
lists out as well much easier.)

So makepro.awk *could* generate simple export lists.  But we can
go further.  makepro.awk knows which file it is processing, and could
equally well be told which module it's in.  I had a vision of it adding
into the external prototypes file lines of the form "#define symbol
zsh_modulename_symbol" for each symbol.  This would mean:

* No more name clashes with the local libraries (we have several renamed
  variables, some renamed via macros).

* No possibility of a name clash between unrelated modules -- every
  imported symbol is effectively tagged with the name of the module it
  is to be imported from.

* That means greater scope for independently written modules.  (Ask me
  about my ideas for hierarchical module names sometime.)

The only downside is that it makes using a debugger trickier, but I
think the solving of namespace problems is well worth it.

And it goes further still.  I had a vague thought that on systems where
symbols in modules are not available to other modules, such as SunOS,
we could effectively do symbol tables by hand.  The basic plan is that
module X contains a massive struct -- a struct type unique to that
module -- that contains pointers to all the functions in the module.
You'd have, for example,

	struct symtab_for_module_zle {
		void (*sym_resetvideo) _((void));
		void (*sym_zrefresh) _((void));
		void (*sym_moveto) _((int, int));
		int (*sym_redisplay) _((char **));
		...
	};

in the .mdh file, and

	struct symtab_for_module_zle symtab_for_module_zle = {
		zsh_zle_resetvideo,
		zsh_zle_zrefresh,
		zsh_zle_moveto,
		zsh_zle_redisplay,
		...
	};

in an automatically generated .c file that ultimately got linked into
the module.  When the module gets loaded, a pointer to its symbol table
structure gets added to the module metadata structure.  Any module Y
that needs to use module X's symbols will have an automatically generated
local variable:

	struct symtab_for_module_zle *symtab_zle;

which during module boot gets initialised by looking up the symbol table
in the module metadata structures.  Lastly we need modified .pro files,
so that instead of seeing "#define zrefresh zsh_zle_zrefresh" and a
prototype it would see "#define zrefresh (*symtab_zle->sym_zrefresh)".
Thus all calls to functions in the unavailable module would go via the
explicit symbol table.  This would mean an extra pointer dereference
on each cross-module function call, so it should only be used where
really necessary -- don't use this mechanism to call functions in the
main executable -- but it makes interdependent modules possible on
systems where at the moment we end up having to compile modules into
the executable.

More!  The last thing I wanted to do: I wanted to distinguish between
"symbols that need to be visible to other object files in this module"
and "symbols that need to be exported to other modules".  I envision a
pseudo-keyword "mod_export" (deliberately slightly unwieldy), which would
be #defined to nothing in zsh.h, but would act as a cue for makepro.awk
to treat it differently.  Only mod_exported symbols would get a place
in the .export files or the symbol table structure described above.
On other systems, other modules would simply not get the #define for
non-mod_exported symbols, thus avoiding polluting their namespace,
and ensuring that accidental uses of a non-mod_exported symbol would
be caught.

That's pretty much everything I had planned to do with symbol tables.
I'm afraid I still don't have time to actually implement any of it,
so anyone else feel free to go ahead.  Any comments, anyone?

-zefram


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-11-22 23:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-22 22:06 3.1.6-pws-9 details Peter Stephenson
1999-11-22 23:04 ` Zefram

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).