+The hash API is a collection of simple hash table functions. Users are expected
+to implement their own hashing.
+ The hash table structure. The `array` member points to the hash table
+ entries. The `size` member counts the total number of valid and invalid
+ entries in the table. The `nr` member keeps track of the number of
+ An opaque structure representing an entry in the hash table. The `hash`
+ member is the entry's hash key and the `ptr` member is the entry's
+ Initialize the hash table.
+ Release memory associated with the hash table.
+ Insert a pointer into the hash table. If an entry with that hash
+ already exists, a pointer to the existing entry's value is returned.
+ Otherwise NULL is returned. This allows callers to implement
+ Lookup an entry in the hash table. If an entry with that hash exists
+ the entry's value is returned. Otherwise NULL is returned.
+ Call a function for each entry in the hash table. The function is
+ expected to take the entry's value as its only argument and return an
+ int. If the function returns a negative int the loop is aborted
+ immediately. Otherwise, the return value is accumulated and the sum
+ returned upon completion of the loop.
strbufs has some invariants that are very important to keep in mind:
-. The `buf` member is never NULL, so
you it can be used in any usual C
+. The `buf` member is never NULL, so it can be used in any usual C
string operations safely. strbuf's _have_ to be initialized either by
`strbuf_init()` or by `= STRBUF_INIT` before the invariants, though.
-This is string buffer structure. The `len` member can be used to
+This is string buffer structure. The `len` member can be used to
determine the current length of the string, and `buf` member provides access to
comments are considered contents to be removed or not.
+ Launch the user preferred editor to edit a file and fill the buffer
+ with the file's contents upon the user completing their editing. The
+ third argument can be used to set the environment which the editor is
+ run in. If the buffer is NULL the editor is launched as usual but the
+ file's contents are not read into the buffer upon completion.
cp "$TODO" "$TODO".backup
- die "Could not execute editor"
+ die "Could not execute editor"
die_abort "Nothing to do"