Age | Commit message (Collapse) | Author |
|
The old note_list process used inefficient code design. It required all
of the metadata for each note in the note list to be allocated and
determined before any actions were taken. This was slow, inefficient,
and could potentially have required an enormous amount of memory if
enough notes were available.
The new process uses the file descriptor stream concept from the glibc
readdir function. This enables easy traversal of the note list without
having to store the entire list in memory (we only need to store the
current note metadata).
Also removed all occurences of "Schlemiel the painter algorithm" by
replacing all occurences of strcpy/strcat/strcat/... in the note_list
process with sprintf.
Renamed the note_list_t type to note_list, note_t to note, and config_t
to config.
Moved note_edit function into common.h and renamed to file_edit, as this
is a common function not specific to notes.
Cleaned up old commented out code, including legacy c++ code (I can't
believe this thing used to be written in c++).
|
|
|
|
This one begins the refactoring of the note struct and related functions
Updated note_list functions to work with the new note struct
Refactored note edit, note_list get note id function
More c++ cleanup work done
Updated function comments for afforementioned functions
|
|
This version currently supports the ls,list command.
Commented out the c++ code that hasn't been refactored yet in note_list.
|
|
Created config struct and complimentary functions. Can check if a config
variable is set and can get values along with a variable count. Also
successfully handles blank (or empty) lines as well as lines that are commented
out and lines that have inline comments.
Updated main calls to old c++ config class to work with the new c struct and
related functions.
Moved get_user_editor function into common.c and created appropriate header
file.
|
|
Add warnings, c standard variable (set to 99), and updated library source
paths. Also made compiler a variable for later autodetection.
|
|
This is the first commit in a long line, for converting from c++ to c. This
particular change will fail compiling as all of the code is still c++. This is
just a rename.
|
|
Path seems more fitting given it's used for more than just a filename string.
Converted note, main, and note_list to use new path class.
Added .exists() method to path (wasn't in File).
|
|
Currently just parses out directories into a vector and the filename into
file.name (imaginative, I know).
Also updated Makefile to build file object.
|
|
Now we don't have to have an empty directory as a part of the repo. It will be
created on compile.
|
|
Currently, ls/list actions work along with edit.
|