Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/lib/libedit



Module Name:    src
Committed By:   christos
Date:           Sun May 22 19:44:26 UTC 2016

Modified Files:
        src/lib/libedit: chared.c chared.h common.c el.c read.c read.h

Log Message:
Stop the read module from poking the el_chared.c_macro data structure
currently belonging to the chared module.  The read module does so
from three of its functions, while no other module uses the macro
data, not even the chared module itself.  That's quite logical
because macros are a feature of input handling, all of which is
done by the read module, and none by the chared module.  So move
the data into the read modules's own opaque data structure, struct
el_read_t.

That simplifies internal interfaces in several respects: The
semi-public chared.h has one fewer struct, one fewer #define, and
one fewer member in struct el_chared_t; all three move to one single
C file, read.c, and are now module-local.  And the internal interface
function ch_reset() needs one fewer argument, making the code of many
functions in various modules more readable.

The price is one additional internal interface function, read_end(),
10 lines long including comments, called publicly from exactly one
place: el_end() in el.c.  That's hardly an increase in complexity
since most other modules already have their *_end() function, read.c
was the odd one out not having one.

>From Ingo Schwarze


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/lib/libedit/chared.c
cvs rdiff -u -r1.29 -r1.30 src/lib/libedit/chared.h
cvs rdiff -u -r1.46 -r1.47 src/lib/libedit/common.c
cvs rdiff -u -r1.91 -r1.92 src/lib/libedit/el.c
cvs rdiff -u -r1.96 -r1.97 src/lib/libedit/read.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libedit/read.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index