Commit graph

79 commits

Author SHA1 Message Date
oguillaumin
cb5fbbce4e Merge qfribidi into unicode_join
* remove qfribidi.h and qfribidi.c
* simplify get_mirror_char(), use table from Unicode 15.0
* improve bidir_get_type(), compact_list()
* use combined type tests for 3, 4 and 6 types
* bumped VERSION to 5.4.2
2023-03-05 01:12:14 +01:00
Charlie Gordon
d0f7b7a904 Various improvements for consistency
* add -Wno-packed compiler option
* add CONFIG_REGEX flag, undefined for tiny build
* disable regex commands in tiny build
* add documentation for some search commands and APIs
* reorder search tags for readability
* add isearch_yank_char
* use emacs names for:
  isearch-repeat-backward, isearch-repeat-forward,
  isearch-ring-advance, isearch-ring-retreat,
  isearch-yank-word-or-char
* add occur alias for list-matching-lines
* add char32_to_utf8()
* restored some macros in cutils.h:
  likely(x), unlikely(x), __maybe_unused, BOOL, FALSE, TRUE
* remove max(), min(), maxp(), minp(), clampp()
* add typed arithmetic functions:
   min_int(), max_int(), clamp_int(), min3_int(), max3_int()
   min_offset(), max_offset(), clamp_offset()
* use typed functions everywhere

* bump version to 5.4.1d
2022-11-21 00:20:18 +01:00
Charlie Gordon
216b3ff8b7 Fix gcc 12.2 insane optimisation issues fixes issue #11
* use memcpy and other value casts to avoid strict aliasing violations.
  gcc 12.2 was wrongly assuming that utf8_decode(&p) did not modify p
  because *pp was never explicitly set, albeit *(const u8 **)pp = p; was
  storing te updated value of p into it and the code generated for that
  was produced.  The code generator was miscompiling strtokey1 because
  the compiler relied on bogus code analysis at the call site.

  The gcc team is wasting many hours of valuable debugging time.
  They should at least issue a warning about aliasing rules violations.

* fix compiler warning on missing Xvideo header

* fix compiler warning on missing fallthrough

* bump version to 5.4.1c
2022-11-11 17:49:50 +01:00
Charlie Gordon
60390867ae Use wide char specific classification and case functions
* qe_toupper and qe_tolower handle only ASCII subset
* add qe_wtolower() and qe_wtoupper() for Unicode case conversions
  current implementation is partial
* handle accents in qe_wtolower() and qe_wtoupper() only
* add qe_iswalpha(), qe_iswlower() and qe_iswupper()
* restrict filename lowercasing kludge in reduce_filename()
* restrict qe_findchar() and qe_indexof() to ASCII subset
* rename functions:
   eb_match_str  => eb_match_str_utf8
   eb_match_istr => eb_match_istr_utf8
   strimatch_pat => utf8_strimatch_pat
   ustr_get_word => utf8_get_word
   wctoupper     => qe_wctoupper
   wctolower     => qe_wctolower
   strimatch_pat => utf8_strimatch_pat
   str_get_word  => str_get_word7
* handle accented letters in buffer casing functions
2022-11-01 01:19:32 +01:00
Charlie Gordon
7e70e611b6 Use char32_t for all code point variables and arrays
- char32_t is defined in cutils.h but may conflict with <uchar.h>
- all qe_isxxx functions take a char32_t
- add etf8x encoding for full range of char32_t type
- add utf8_decode_strict()
- add ustr_match_keyword()
- utf8_encode() / utf8_decode() handle up to 32 bits
- improve detect_charset():
  - detect utf8 and utf8x
  - avoid failure on partial utf8 sequence at end of buffer
  - detect overlong utf8 sequences
- fix display bugs for code points beyond MAX_UNICODE_DISPLAY
- simplify do_compare_windows(), avoid magic char values.
- rename functions:
    eb_encode_uchar -> eb_encode_char32
    eb_insert_uchar -> eb_insert_char32
    eb_insert_uchars -> eb_insert_char32_n
    eb_match_uchar -> eb_match_char32
    eb_delete_uchar -> eb_delete_char32
    eb_replace_uchar -> eb_replace_char32
    utf8_to_unicode -> utf8_to_char32
- use char32_t for all variables and arrays holding code-points
- fix some language syntax parsers.
- fix detect_eol_type_32bit(), used uint16_t instead of uint32_t
- bump VERSION to 5.4.0
2022-10-29 19:43:38 +02:00
Charlie Gordon
0099f138c9 Move UTF-8 utility functions to util.c
- simplify utf8_decode()
- simplify longest common prefix code in do_minibuffer_complete
- remove redundant include files
2022-10-17 18:38:21 +02:00
Charlie Gordon
c561a42273 Reduce header file dependencies
- remove redundant include files
- no longer include qe.h in charset.c, libqhtml
- add unicode_join.h for bidir definitions
- move QASSERT, MAX_WORD_SIZE, MAX_FILENAME_SIZE from qe.h to util.h
- move CompleteState and CompleteFunc to util.h
- bump VERSION to 5.3.4z
2022-10-15 19:32:59 +02:00
Charlie Gordon
d1fb4dde64 Add macros for block comparison, copy and move
After spending a few hours debugging a stupid memcpy size error, I
decided to use a typed version of memcpy, memcmp and memmove wherever
the array type size is greater than 1.

- add blockcmp(p1, p2, n), blockcpy(p1, p2, n), blockmove(p1, p2, n)
  for operation on typed arrays
- add max_uint() and min_uint()
- bumped VERSION to 5.3.4w
2022-09-27 09:32:41 +02:00
Charlie Gordon
bd50376780 Various improvements
- add charset.h
- add tools/unitable.c to compute unicode_width.h
- add tools/unicode_gen.c to compute more unicode tables
- use Unicode 15.0.0
- add rules to compute width tables from Unicode tables and TTY
- move basic definitions from util.h to cutils.h
- use CONFIG_SESSION for session support (undefined if CONFIG_TINY)
- define CompleteFunc and CT_xxx flags for completion functions
- pass CompleteFunc to xxx_complete() functions
  this allows more generic implemetation, without including qe.h
- rename fill_border() as fill_window_slack() for readability
- add QELEVEL environment variable to detect recursive invocation
- use stricter parser for load_ligatures()
- bump VERSION to 5.3.4u
2022-09-19 15:16:59 +02:00
Charlie Gordon
b8f81236cd Split util module
- split color/css functions from util.c into color.c
- add util.h and color.h for declarations
- util.c no longer includes qe.h
- move get_clock_ms() and get_clock_usec() to unix.c
- remove unused QString functions
- bump VERSION to 5.3.4s
2022-09-15 11:28:34 +02:00
Charlie Gordon
d052ab31ff Fix many compilation warnings for clang -Weverything
- made some local objects static
- fix many const cast issues
- fix comma operator warnings
- add const correct strtol_c(), strtoll_c(), strtold_c()
- add unconst(t) to override const removal warnings
- comment VLAs and flexible arrays
- use get_basename_offset() to enable const correct
  get_basename() and get_basename_nc()
- use get_extension_offset() to enable const correct
  get_extension() and get_extension_nc()
- always include config.h
- use size_t for some size arguments:
  umemmove(), umemcpy(), umemcmp(), qe_memicmp()
- add qe-doc.info and qe-doc.pdf targets
- fix shadowing bug in buf_write: used tor return 0 instead of byte count
- bumped version to 5.3.1e
2022-08-10 18:50:19 +02:00
Charlie Gordon
e08de03499 updated credits and copyrights 2022-08-03 17:00:38 +02:00
Charlie Gordon
b72b1773db Fix gcc compilation
- be more careful about snprintf target arrays
- fix bug in qe_load_file(): was testing local array instead of argument
- remove unused indent variable in clang.c
- pass pointer to CSSFile in css_close()
2022-08-03 16:47:12 +02:00
Charlie Gordon
e2e290ec72 Improve libqhtml build
- add dependencies
- support expression syntax in csstoqe
2021-02-03 09:03:51 +01:00
Charlie Gordon
da22ee7f3b Improve build process
- factorize target rules,
- use recursion for different targets
- make debug versions for all targets
- add help target
2021-02-01 20:38:29 +01:00
Charlie Gordon
fcf9136fdb Improve naming consistency
- rename qe_skip_spaces() as eb_skip_spaces() and take EditBuffer
- rename skip_spaces() as qe_skip_spaces()
- use qe_skip_spaces() return value to simplify loops
2020-11-25 18:55:15 +01:00
Charlie Gordon
46d9be3442 Reorganize repository tree
- move language syntax handling to `lang` directory
- move other modes to `modes` directory
- move tools to `tools` directory
- compile tools to `bin` directory
- bump version to 5.3alpha
- remove duplicate node names in qe-doc
- update Makefiles
2020-11-11 19:31:07 +01:00
Charlie Gordon
c6b4d90b80 Initial post on github
- renamed README as README.md and improved description
2020-10-24 23:59:54 +02:00
Charlie Gordon
e13fcfb543 remove trailing blanks 2020-10-21 15:01:52 +00:00
Charlie Gordon
c36cccd4bf build: group all intermediary targets in .objs directory
- each architecture has a specific subdirectory
- object files for qe, xqe and tqe are each in an arch specific subdirectory
- libraries are generated in .objs with an arch specific name
2017-05-08 10:15:43 +00:00
Charlie Gordon
e08867b692 basic: reduce global variable clutter
- make more registered objects static
- document some non static global objects
- remove some global variables
2017-04-16 21:51:19 +00:00
Charlie Gordon
84547c6209 build: fix compile time warning
- fix some warnings on unused variables and variables potentially
  used before set
- force definition of va_copy() and atomic_get_and_set() for haiku
2017-04-15 09:39:02 +00:00
Charlie Gordon
5d463eb5ad styles: improve consistency
- rename font styles QE_STYLE_xxx to QE_FONT_STYLE_xxx
- rename font family QE_FAMILY_xxx to QE_FONT_FAMILY_xxx
- improve tests/16colors.pl: display bold italics combination
- improve tests/color-spaces.pl: compare true color and palette dumps
- add colortest target in Makefile to produce various color patterns
2017-04-11 06:46:13 +00:00
Charlie Gordon
24769141f4 updated headings 2017-03-25 18:04:51 +00:00
Charlie Gordon
f74938305c build: improvements
- generate libqhtml object files in target dependant directories
- make multiple targets coexist
- fix .cvsignore file
- fix clean and distclean targets
2016-12-27 11:40:40 +00:00
Charlie Gordon
1f5a77a784 portability: stop defining symbols starting with __ 2015-09-16 22:18:22 +00:00
Charlie Gordon
81bca980fe cosmetics: untabify, remove trailing spaces 2015-08-30 11:27:12 +00:00
Charlie Gordon
8fc273ccc6 libqhtml: parse hex html entities 2015-08-19 14:26:34 +00:00
Charlie Gordon
1f3e90a940 fix clean target 2014-06-01 17:34:39 +00:00
Charlie Gordon
8765dae3d4 improve make output
* produce less verbose make output
* use `make V=1` or `make VERBOSE=1` to produce full output
2014-05-30 21:31:46 +00:00
Charlie Gordon
0d3e4999f2 suppress compilation warning 2014-05-29 06:32:00 +00:00
Charlie Gordon
e03177996e suppress warnings 2014-05-26 13:57:20 +00:00
Charlie Gordon
a7853b3dff add support for end of line types
* support 3 types of end of line: Unix, Dos and old style Mac
* detect eol type automatically in detect_charset
* set buffer eol_type together with charset
* transparently convert eol sequence to \n upon reading buffers
  characters in eb_nextc().
* transparently convert \n to eol sequence in eb_encode_uchar()
* handle eol types in convert-file-buffer-coding-system: either preserve
  current value or force it via charset suffix -unix, -doc and -mac
* change read_charset() to accept eol_type suffix
* add eol_type and eol_char to CharsetDecodeState
* change charset methods to take CharsetDecodeState instead of charset pointers
* display eol_type in mode line if not unix
2014-02-05 00:56:48 +00:00
Charlie Gordon
e967914b5a improve consistency in new/delete methodology
* use qe_mallocz for all structures
* prevent spurious uses of malloc/free/realloc
* pass pointers to pointers to all deletion functions
* use consistent patterns for list deletions
* add more dependencies in Makefiles
2014-01-23 12:56:22 +00:00
Charlie Gordon
18c514edd6 fix typo 2014-01-23 12:36:35 +00:00
Charlie Gordon
8ed0526efe remove dSYM directories on target clean 2013-11-23 10:54:32 +00:00
Charlie Gordon
0bdafcb61e ignore dSYM debugging info inrectories 2013-11-22 19:48:37 +00:00
Charlie Gordon
ce8d7ff0ad moved object files to .objs subtree 2008-06-04 08:49:24 +00:00
Charlie Gordon
9cf6a3cb87 simplified buffer decoding methods: pass ptr in CharsetDecodeState 2008-05-02 17:05:38 +00:00
Charlie Gordon
e493a2e99c fixed many problems with charset encodings
added charset methods for buffer line and position computations
added QECharset fields for char_size and variable_size indicator
use charset's eol_char to count lines in buffers: this should fix EBCDIC support
added support for ucs2 and ucs4 little and big endian encodings
charset's decode_func call no longer be NULL
eb_nextc and eb_prev now require non NULL third parameter
2008-05-02 16:04:09 +00:00
Charlie Gordon
cf58a654a3 use union to avoid non portable casts
some simplifications and clarifications
added copyrights
2008-04-24 14:02:42 +00:00
Charlie Gordon
a4de8812b2 removed ugly metamorphic kludge on CSSBox content 2008-04-23 17:05:51 +00:00
Charlie Gordon
ff889c53f3 remark about portability issue 2008-04-23 15:31:44 +00:00
Charlie Gordon
180f61a8b9 use c99 syntax for varadic macros 2008-04-20 11:54:36 +00:00
Charlie Gordon
58b5872c52 fixed OpenBSD compile issues:
- check OpenBSD as uname output
- no longer use strcpy, strcat, sprintf
- added CONFIG_PTSNAME to disable Unix98 API under BSD
- fixed crash bug in tty.c on empty window
2008-04-15 23:24:03 +00:00
Charlie Gordon
0cb0552601 fixed 32/64 bit compilation issues 2008-04-09 16:27:15 +00:00
Charlie Gordon
2d0783cfd9 renames basename to get_basename to avoid conflicts 2008-04-08 06:54:44 +00:00
Charlie Gordon
a5eae3ed92 bumped copyrights, some cosmetics 2008-01-08 16:37:54 +00:00
Charlie Gordon
98939ddcac changed API for completion functions:
- use CompleteState struct
- use complete_test for each potential match with simple prefix comparison
added new smart string compare function qe_collate to sort strings in
  lexicographical order but sort numeric portions in numerical order
use qe_collate in popup lists and dired
removed redundant alias "iso8859-2"
added strequal(a,b) as an alias for !strcmp(a,b)
  this function makes string collation with strcmp more explicit
  this even fixed a spurious bug in do_set_emulation
2008-01-08 03:42:53 +00:00
Charlie Gordon
ae163f897b fixed crash on charset_completion
renamed css_strtolower -> qe_strtolower
use offsetof for SAVED_DATA_SIZE macro (this stuff must go)
cosmetics in css_get_enum
remarks
fixed text-mode colorization bug: because of saved_data stuff,
  must reset colorization function after mode restore.  This saved data
  stuff is bogus and should be rewritten
smaller version of roman numeral converter
fixed alpha converter
smaller implementation of css_counter_str
fixed list_mode name: no longer generates extra mode completion entry
2008-01-07 16:25:22 +00:00