Commit graph

31 commits

Author SHA1 Message Date
oguillaumin
574cb4ac0f Add utility functions
- `canonicalize_path` returns destination array
  allow for destination to overlap source
- `qe_strcollate` compare directory name before contents
  this fixes the pathnames sorting
- add `get_relativename(filename, dirname)`
2024-08-31 13:49:00 +02:00
Charlie Gordon
3852fb9c19 Update copyrights 2024-07-28 00:00:03 +02:00
Charlie Gordon
1df739bcb0 ocumentation
* add documentation comments
* `dbuf_init` and `dbuf_init2` return the object
* usr portable `memcpy` based approach for unaligned word access
2024-07-28 00:00:03 +02:00
Charlie Gordon
fcf4c46321 Add regex support for search and replace
* import libunicode and libregexp from QuickJS
* add utility functions:
  min/max_uint32, min/max_int64 clz/ctz/32/64
  bswap12/32/64
* add packed get and put inline functions
* add DynBuf package (dbuf_xxx)
* add unicode_to/from_utf8()
* add regex support in eb_search
* add partial regex support in query_replace: no subexpressions support
* bumped VERSION to 6.1.0
2023-03-05 13:34:19 +01:00
oguillaumin
f36144d6a8 Change license to MIT
* bumped VERSION to 6.0.0
2023-03-05 02:04:02 +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
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
a402c88341 Start a Quick Emacs Manual
- add tools/scandoc utility to extract doc comments from source code
- add qe-manual.c documentation framework
- add qe-manual.md target for convenient repository documentation
- document some utility functions
- add strtod_c(str, endp) for const strings
- add Makefile target qe-manual.md
- bump VERSION to 5.3.4r
2022-09-13 15:29:40 +02:00
Charlie Gordon
3bbee69742 Multiple improvements
improve command and bindings registration:
- simplify command and binding registration APIs
- add bindings member in ModeDef structures
- rename qe_register_cmd_table() as qe_register_commands(), change API
- add qe_register_bindings() taking mode, command-name and bindings string
- rename qe_mode_set_key() as qe_register_command_binding()

improve buffer listing:
- add BF_SHELL buffer flag for shell buffers
- show current directory of shell buffers in bufed

improve dired:
- add dired-hide-details-mode on "("
- use details_mask to control long listing

improve trace doctor:
- add EB_TRACE_DEBUG trace flag for debugging traces
- add do_set_trace_flags()
- change do_start_trace_mode() to do_toggle_trace_mode() with arg

misc:
- fix make_user_path() for pathnames without a trailing slash
- use separate commands for prefix_argument handling
- improve strstart(), strend(), pstrcpy(), pstrncpy(), get_dirname()
- add strmatchword() like strstart with check for word boundary
- bumped version to 5.3.3d
2022-08-22 17:13:26 +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
d0b9f3dad4 bumped copyrights on modified files 2020-10-17 21:09:49 +00:00
Charlie Gordon
2e10113f01 add pstrncat 2020-10-14 23:27:41 +00:00
Charlie Gordon
c5a3bb8ecb updated heading 2017-03-25 18:14:59 +00:00
Charlie Gordon
d5e10dfe77 update copyrights, TODO list 2016-06-09 16:24:10 +00:00
Charlie Gordon
325c03eda1 add strend to match string suffix 2014-02-04 03:28:14 +00:00
Charlie Gordon
5c678f0236 make pstrcpy return destination buffer 2013-12-03 17:31:49 +00:00
Charlie Gordon
a454cbc152 moved get_basename, get_extension, and get_dirname to cutils.h/c
added wrappers for get_basename_nc and get_basename_offset
added wrappers for get_extension_nc and get_extension_offset
added strip_extension
use these where appropriate
remove duplicate definitions in stand-alone utilities
2008-04-22 08:11:55 +00:00
Charlie Gordon
a5eae3ed92 bumped copyrights, some cosmetics 2008-01-08 16:37:54 +00:00
Charlie Gordon
4743fa1308 added remove_slash and append_slash path utilities
renamed canonize to canonicalize
added crude support for ~user -> /home/user
added win32 specific stuff in basename
added C-/ as an alias for C-_
some cosmetics, moved code
create files with mode 0644 in raw_save_buffer
untabified, removed redundant spaces
modified code generators to the same effect
2008-01-03 09:51:29 +00:00
Charlie Gordon
7856ba0630 cosmetics 2007-12-18 12:13:02 +00:00
Charlie Gordon
5768f42cd8 no longer use ctype.h macros and functions
- ctype.h has strong constraints on arguments
- ctype.h implements bogus irrelevant inefficient locale specific behaviour
- use replacement css_xxx functions
- all take int arguments: can be any value, yet only test ASCII subset
- all css_isxxx return true boolean (1 or 0)
- removed utoupper(int) -> css_toupper(int) has same functionality

resolved ffmpeg clash on string functions from cutils.c module
- added #defines to make them local
- renamed some strixxx functions to strxxxx (extended behaviour)
- moved case insensitive stuff to util.c

fixed bug in strtokey: C-M-x combinations were not recognized
improved eb_changecase
fixed C comment parsing in css parser
2007-12-15 16:02:47 +00:00
Charlie Gordon
a064ff97a0 more ctype unsigned char fixes 2007-12-06 17:59:23 +00:00
Charlie Gordon
6c65411200 added missing headings, cosmetics 2007-12-03 16:10:38 +00:00
Charlie Gordon
c150f0a9a7 Added missing headings
Cosmetics
Fixed Makefile details
2007-12-03 10:40:21 +00:00
Charlie Gordon
494e9f7866 include cflags.mk for extra gcc warnings if present
utf8_encode now returns the number of characters copied,
  simplified code accordingly
made local functions static
tagged unused function arguments
fixed shadowing issues
added support for GCC attributes for unused arguments and format strings
use snprintf() instead of sprintf()
moved scattered declarations to qe.h
removed duplicate declarations in header files
eb_write() payload argument is now const
fixed crash bug: reset trace_buffer upon deletion
improved trace_buffer readability: trace all pseudo tty streams separately
added missing structure initializers
removed buffered string handling from cutils.h
added new buffered string API for statically allocated buffers (should unify)
small improvements in X11 initialization
improved consistency in tty.c (function names...)
  added STDIN and STDOUT streams in QEditScreen to stop using stdin and stdout
  use unlocked stream I/O if available (faster)
  changed and documented terminal setup and exit sequences
  improved charset handling
mode_line functions now return the character count (like snprintf)
2006-12-31 19:34:00 +00:00
Charlie Gordon
20c9993c3d changed stristart to ignore space, - and _
addded stricmp: same as strcasecmp, and ignore , - and _
2006-12-11 23:03:21 +00:00
Charlie Gordon
3551c36226 fixed typos, comments 2006-12-09 19:02:07 +00:00
Charlie Gordon
5c37cc9049 moved utility functions from cutils.c to util.c to fix conflict with
ffmpeg's own cutils.c module
fixed Makefile to skip cutils when linking with ffmpeg
2005-05-13 09:56:44 +00:00
Charlie Gordon
33c43fccbf removed pathname()
moved pstrncpy() to cutils.h/cutils.c
allow NULL pointers in splitpath for extraction for dirname or basename alone
changed sizes of filename or pathname buffers to MAX_FILENAME_SIZE
2005-05-10 18:53:03 +00:00
Charlie Gordon
59e89b08b3 added missing string.h include file 2004-11-30 10:18:00 +00:00
Charlie Gordon
3dd0f5660c Initial revision 2004-05-29 10:17:37 +00:00