payredu

Cross-platform ledger GUI written in c99
git clone git@getsh.org:payredu.git
Log | Files | Refs | README

commit 89afeaddea83864f4d35cd341cae45575056394c
parent 34aa80ed625f1a513f591ad93eb8791b72efe96b
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date:   Sun, 14 Apr 2024 13:44:43 +0530

fmt README HACKING

Diffstat:
MHACKING | 56++++++++++++++++++++++++++++++++++++++++----------------
MREADME | 16+++++++++++-----
2 files changed, 51 insertions(+), 21 deletions(-)

diff --git a/HACKING b/HACKING @@ -7,34 +7,55 @@ yyyy/mm/dd <till \n> ...\n\n // mark posting on \n\n -payredu can be bulit as a standalone library(libpayredu) or can be built as an executable. +payredu can be bulit as a standalone library(libpayredu) or can be +built as +an executable. make libpayredu.a make libpayredu.so make payredu -You can control what you want to build by invoking it separately. By default builds everything. +You can control what you want to build by invoking it separately. By +default +builds everything. Makefile -------- -This project strives to use the same Makefile to work on both gmake and bmake. +This project strives to use the same Makefile to work on both gmake +and bmake. -If you want to add any ${CC} specific flags, check the part under "#if ${CC}" in Makefile. +If you want to add any ${CC} specific flags, check the part under +"#if ${CC}" +in Makefile. commit.c -------- -The original ledger-cli does not do edits, to make the runtime simple but since the database is completely ASCII and unorganized, consequent and programmatic writes creates a stress on the CPU and RAM, making it unsuitable for building touch friendly GUIs or general clients on top of it without comprosing UX. - -To prevent this, payredu exposes a commit API which can be used by text editors and other frontends to validate added content before saving it to the file. - -Once you are done with the changes in the text editor or other GUI, you can commit the data to payredu using the APIs +The original ledger-cli does not do edits, to make the runtime simple +but since +the database is completely ASCII and unorganized, consequent and +programmatic +writes creates a stress on the CPU and RAM, making it unsuitable for +building +touch friendly GUIs or general clients on top of it without comprosing UX. + +To prevent this, payredu exposes a commit API which can be used by +text editors +and other frontends to validate added content before saving it to +the file. + +Once you are done with the changes in the text editor or other GUI, +you can +commit the data to payredu using the APIs int ledger_commit_text(new_text, new_text_len) int ledger_commit_post(timestamp, comment, comment_len, entries**) -The first variant can be used by text editors where the structure of the parsed text is not understood. +The first variant can be used by text editors where the structure of the +parsed text is not understood. -The second variant can be used when frontend is a GUI or other UI where the user input is controlled. +The second variant can be used when frontend is a GUI or other UI +where the +user input is controlled. RETURN VALUE ------------ @@ -43,7 +64,8 @@ Both variants return PARSE_OK if suceeded, and -1 on failure. payredu.c --------- Similar to ledger-cli -payredu follows the UNIX style option arguments to make the parsing easy and to combine multiple options +payredu follows the UNIX style option arguments to make the parsing easy +and to combine multiple options parse.c @@ -55,9 +77,13 @@ There are two parsers written for the The parser is written entirely by hand to reduce dependencies. -The `state` variable at any given time holds the information 'what we are trying to parse'. If the `state` has the value `DATE`, it means we are in a condition where we expect DATE to occur such as when starting the parser or when a posting is parsed. +The `state` variable at any given time holds the information 'what we are +trying to parse'. If the `state` has the value `DATE`, it means we are in +a condition where we expect DATE to occur such as when starting the parser +or when a posting is parsed. -There aren't as many states as the ledger format itself is quite minimal. These are currently the states, +There aren't as many states as the ledger format itself is quite minimal. +These are currently the states, DATE COMMENT @@ -65,5 +91,3 @@ ENTRY_WHO ENTRY_AMOUNT ENTRY_END - - diff --git a/README b/README @@ -3,9 +3,12 @@ payredu பேரேடு ====== -payredu is a cross-platform frontend to ledger(pta) with emphasis on simplicity. payredu means ledger in Tamil. It is written in c99 and works on top of nuklear making it lightweight and fast. +payredu is a cross-platform frontend to ledger(pta) with emphasis on +simplicity. payredu means ledger in Tamil. It is written in c99 and +works on top of nuklear making it lightweight and fast. -NOTE: The quality of the software is beta in the least, it's still in development. +NOTE: The quality of the software is beta in the least, it's still +in development. To build and run, @@ -15,11 +18,14 @@ To build and run, Why payredu when ledger-cli exists? ------------------------------------ -ledger-cli by itself is pretty lightweight but it has a handful of dependencies and features which I don't particularly care about. +ledger-cli by itself is pretty lightweight but it has a handful of +dependencies and features which I don't particularly care about. -payredu follows a very suckless approach to ledger and does NOT provide some of the advanced features ledger provides. +payredu follows a very suckless approach to ledger and does NOT provide +some of the advanced features ledger provides. -It should be noted that payredu is usually faster than ledger-cli as it does not provide some of the niceties that ledger-cil provides. +It should be noted that payredu is usually faster than ledger-cli as it +does not provide some of the niceties that ledger-cil provides. Goals -----