| Commit message (Collapse) | Author | Age | Lines | |
|---|---|---|---|---|
| * | base64: add base64_encode_oneshot() | Daniel Eklöf | 2026-05-22 | -14/+110 |
| | | | | | | | | | | | | | | | | | | | Convenience function for base64_encode() + base64_encode_final(). Internally, we also add base64_encode_to_buffer() This is an internal function that encodes a multiple-of-three long input into a user allocated buffer. base64_encode() and base64_encode_oneshot() uses the new function to do the bulk of the encoding. This allows base64_encode_oneshot() to do a single allocation. This patch also adds unit tests for both base64_encode() and base64_encode_oneshot() (but _not_ for base64_encode_final()). Finally, the type of the 'data' parameter is changed to 'void*'. | |||
| * | osc: kitty notifications: updated support for icons | Daniel Eklöf | 2024-07-23 | -1/+11 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the suggested protocol discussed in https://github.com/kovidgoyal/kitty/issues/7657. Icons are handled by loading a cache. Both in-band PNG data, and symbolic names are allowed. Applications use a graphical ID to reference the icon both when loading the cache, and when showing a notification. * 'g' is the graphical ID * 'n' is optional, and assigns a symbolic name to the icon * 'p=icon' - the payload is icon PNG data. It needs to be base64 encoded, but this is *not* implied. I.e. the application *must* use e=1 explicitly. To load an icon (in-band PNG data): printf '\e]99;g=123:p=icon;<base64-encoded-png-data>\e\\' or (symbolic name) printf '\e]99;g=123:n=firefox:p=icon;\e\\' Of course, we can combine the two, assigning *both* a symbolic name, *and* PNG data: printf '\e]99;g=123:n=firefox:p=icon;<base64-encoded-png>\e\\' Then, to use the icon in a notification: printf '\e]99;g=123;this is a notification\e\\' Foot also allows a *symbolic* icon to be defined and used at the same time: printf '\e]99;g=123:n=firefox;this is a notification\e\\' This obviously won't work with PNG data, since it uses the payload portion of the escape sequence. | |||
| * | base64: simplify lookup table initializer | Craig Barnes | 2024-03-17 | -6/+3 |
| | | ||||
| * | debug: rename assert() to xassert(), to avoid clashing with <assert.h> | Craig Barnes | 2021-01-16 | -3/+3 |
| | | ||||
| * | Print stack trace on assert() failure or when calling fatal_error() | Craig Barnes | 2021-01-16 | -1/+1 |
| | | | | | | | Note: this uses the __sanitizer_print_stack_trace() function from the AddressSanitizer runtime, so it only works when AddressSanitizer is in use. | |||
| * | base64: only allow padding bytes at the end of a string when decoding | Craig Barnes | 2020-11-30 | -6/+17 |
| | | ||||
| * | base64: optimize error checking in base64_decode() | Craig Barnes | 2020-11-29 | -32/+27 |
| | | ||||
| * | Convert most dynamic allocations to use functions from xmalloc.h | Craig Barnes | 2020-08-08 | -2/+10 |
| | | ||||
| * | base64: simplify is_valid() by using reverse_lookup table | Craig Barnes | 2020-08-08 | -5/+2 |
| | | ||||
| * | base64: implement encode() | Daniel Eklöf | 2019-07-19 | -2/+68 |
| | | ||||
| * | base64: initial base64 decode implementation | Daniel Eklöf | 2019-07-19 | -0/+88 |
