Kevin Day [Wed, 21 Mar 2012 03:01:23 +0000 (22:01 -0500)]
Bugfix: delimit whitespaces on write
I believe I had a mental lapse on this one.
The previous code was acting like a read operation in certain cases when dealing with whitespace.
When doing a write if a white space exists treat don't ignore it; instead, wrap it in quotes so that object names can contain spaces.
For example " " is a valid object name which is a object whose name is a single space.
Kevin Day [Tue, 20 Mar 2012 03:25:45 +0000 (22:25 -0500)]
Bugfix: remove default from switch to avoid returning f_unknown
While it is good practice to always have a default: in switch, I believe this is a case where it is not.
Do not provide a default switch so that the default return statement is always false.
This prevents having to return f_unknown at the end of the function as it is now possible to get to the end of the function.
Kevin Day [Tue, 20 Mar 2012 03:14:18 +0000 (22:14 -0500)]
Update: handle eol when doing writes
If the buffer being read from contains an eol, then do not process any further.
This prevents writing newlines without ignoring them entirely.
This returns f_none_on_eol, which does not exist yet.
A commit following this one will add the eol return codes.
Kevin Day [Tue, 20 Mar 2012 03:10:50 +0000 (22:10 -0500)]
Bugfix: add buffer overflow checks
When I added the input parameter to the write functions I forgot to do buffer size checks now that the input size could be different than the buffer size.
Kevin Day [Fri, 16 Mar 2012 22:00:06 +0000 (17:00 -0500)]
Cleanup: mass change ){ into ) {
I have decided that the syntax style should have a space between ){ from now on.
I did this change in mass via a sed script.
I did not notice any incorrect changes, but there is more to review than I am willing to review.
Kevin Day [Fri, 16 Mar 2012 21:54:24 +0000 (16:54 -0500)]
Bugfix: process quotes at the start of a basic object
This was overlooked.
If the first character is a single quote or a double quote, then it must be delimited.
If the first character is a slash, followed by any number of slashes and then followed by a single or double quote, then all slashes and the quote must be delimited.
Starting slashed that are not followed by a single or double quote must not be delimited.
Kevin Day [Fri, 16 Mar 2012 03:50:36 +0000 (22:50 -0500)]
Update: add write support for fss basic
This adds the write functions for converting a dynamic string that represents an fss basic object into a valid object.
This adds the write functions for converting a dynamic string that represents an fss basic content into a valid content.
Kevin Day [Fri, 16 Mar 2012 02:06:22 +0000 (21:06 -0500)]
Update: use the error code source name instead of a human friendly name for error code translation
The human friendly variant is more convenient, but it is probably better to use the machien name directly on error output.
This should make things script-friendly and also allow for distinguishing something simimarl to f_my_error and fl_my_error.
With f_my_error and fl_my_error, using the previous method, both would report as "my error", when in fact they are different errors.
The down side is that this now requires 1 more step to convert the codes into a human friendly name.
Kevin Day [Thu, 15 Mar 2012 01:46:29 +0000 (20:46 -0500)]
Cleanup: remove useless code
I was considering to use status to return true or false, but later changed my mind.
There was a line of code where I was initialize status, this code is no longer needed.
Kevin Day [Thu, 15 Mar 2012 01:45:20 +0000 (20:45 -0500)]
Bugfix: correct linkage agains fll_execute
The fll_execute used to be fl_execute, when it was changed the projects that depended on it did not get changed.
This updates the build settings to link to the proper library.
Kevin Day [Tue, 13 Mar 2012 03:03:13 +0000 (22:03 -0500)]
Update: rename *error_code projects to *return_code
This should make the applications make a little more sense.
That is, when testing for not-error codes, it makes more sense to say not-error return codes than to say not-error error codes.
Kevin Day [Mon, 12 Mar 2012 16:48:49 +0000 (11:48 -0500)]
Update: add support for identifying errors, warnings, and okays
Add three new parameters: is_okay, is_warning, and is_error.
These should test to see if the error code is in fact an error, a warning, or not an error.
Kevin Day [Mon, 12 Mar 2012 16:23:33 +0000 (11:23 -0500)]
Update: change return codes enum to start at 131
This should makes things sort of compatible with bash shell scripts.
Bash limits its return states to 255, so the fss return codes may still not always function..
This at least allows for some sort of compatibility.
Kevin Day [Sun, 11 Mar 2012 05:31:03 +0000 (23:31 -0600)]
Update: return the literal error code
The error code was being converted into 0 if the code was f_none.
Stop doing this behavior, all the scripts need to be fll return state aware from this point forward.
Kevin Day [Sun, 11 Mar 2012 02:58:10 +0000 (20:58 -0600)]
Bugfix: fix logic flaws with file input buffers
The first mistake made was that when adding the fread result to the buffer, the actual size of each read byte needs to be taken into mind.
If the characters were wide characters with a byte size of 2 instead of 1, then the buffer->used counter would increase at a rate of 2x of what was actually in use.
The second mistake made was that the fread max read size was being set to the entire buffer size instead of what was available.
This should have been producing some sort of buffer overflow, but none was reported.
Instead of request a read of (buffer->size - 1), only request a size
equal to that of the available allocated space (buffer->size - buffer->used - 1).
The third mistake made was not performing sanity checking on the buffer->used and buffer->size variables.
Kevin Day [Sat, 10 Mar 2012 20:59:38 +0000 (14:59 -0600)]
Add Project: pipe
This adds the level 0 implementation of project pipe.
At this time, all it does is provide a way to tell if the current instance of some program has piped data being passed to it.
Kevin Day [Sat, 10 Mar 2012 20:56:38 +0000 (14:56 -0600)]
Update: add all types of file open modes
This also changes f_file_read_write to not create the file if it does not exist.
To create the file if it does not exist, use f_file_read_write_create.
Kevin Day [Sat, 10 Mar 2012 17:08:52 +0000 (11:08 -0600)]
Update: add pipe console parameter
The fll standard console arguments now inclide +p, ++pipe.
This pipe command requires a single numeric argument that represents the size of the pipe.
When this is specified, it tells the application to read from pipe in byte chunks of the specified size.
The default pipe size is left up to the application when this is not specified.
Kevin Day [Fri, 9 Mar 2012 01:27:55 +0000 (19:27 -0600)]
Update: implement fll_execute_program and fix fll_execute_path
This adds fll_execute_program and changes how fll_execute_path works to function properly.
Prior to this change, fll_execute_path did not set the first argument which would cause the programs argv[0] to not be equivalent to the program name.
This also corrects a few mistakes where level_1 syntax and comments were not changed to level_2.
Kevin Day [Thu, 8 Mar 2012 03:53:36 +0000 (21:53 -0600)]
Update: rework and cleanup serialized project
Simplify the serialize functions by:
- replace f_serialized data type with f_dynamic_string
- remove the serialized strategy and change serialized function names to communicate the strategy.
Fixed a few logic flaws and mistakes with the serialized functions.
Kevin Day [Thu, 8 Mar 2012 03:37:38 +0000 (21:37 -0600)]
Bugfix: fix definition of array_length_printf macros
Use ifndef and not ifdef for _di_f_array_length_printf_ because using #ifdef _di_f_array_length_printf_ is completely wrong.
Use #define and not typedef as these are not data types, but instead are strings.
Kevin Day [Thu, 8 Mar 2012 00:07:40 +0000 (18:07 -0600)]
Update: change version number in settings file to 0.3.0
The version number in the settings files is the actual version number of the given project.
Assign this value for all projects to 0.3.0.
All micro releases will have their micro number changed immediately prior to officially releasing a given micro version..
Kevin Day [Wed, 7 Mar 2012 23:53:34 +0000 (17:53 -0600)]
Update: switch to 0.3.x version
This is now the development release series 0.3.x.
The version number for the source files will now end in an x instead of a number to make project management simpler.
Kevin Day [Wed, 7 Mar 2012 04:55:12 +0000 (22:55 -0600)]
Bugfix: -t -n (somename) should show total of (somename) not all objects
This fixes an oversight or logic flaw where the total count was returned in all cases.
When a specific object name is requested, the total count should be the total number of objects that match the given name.
Kevin Day [Wed, 7 Mar 2012 04:46:54 +0000 (22:46 -0600)]
Bugfix: fix the argc argument for the *_read_main() functions
The commit 8fef4128c71a3010d4facf05f0d801118add5f7a changed the argc argument from f_s_int to f_array_length.
The header files were not updated and thus making the header definitions inconsistent.
Kevin Day [Wed, 7 Mar 2012 04:40:57 +0000 (22:40 -0600)]
Bugfix: build headers first
It is entirely possible that building the headers first is the smarter thing to do.
Afterall, the source files may in fact actually use the headers they provide.
kevin day [Sun, 4 Mar 2012 01:31:14 +0000 (19:31 -0600)]
Update: relocate the 'strategy' variable
Why waste space by putting the strategy in every variable.
Sure it can be very convenient and is probably a good object-oriented approach, but favor simplicity in this the variable typedef.
The cost of doing this is making the function call less simple by adding an additional parameter.
Do not alter the function disabling macros.
Allow for forcing secure or insecure on individual blocks of code by removing the function disabling macros.
The following should not be possible:
int main(){
normal_allocations();
Kevin Day [Thu, 1 Mar 2012 04:51:38 +0000 (22:51 -0600)]
Update: initialize string locations to {1, 0}
This is done so that the start position is always after the stop position.
In such a case, this means that the range is undefined.
Originally. -1 was used, but that does not work if the position integers are unsigned.
Using {1, 0} allows for assigning an undefined state with unsigned integers.
Also note that the default of {0, 0} means start at 0 and stop at 0, which would return the value at position 0 and no other values after that first value.
Kevin Day [Thu, 1 Mar 2012 03:36:13 +0000 (21:36 -0600)]
Update: add f_array_length_small and f_array_length_large
This adds short and long versions of the f_array_length typedef.
Having this provides additional context granularity so that the size of arrays can be more easily adjusted to suit ones needs at compile time.
Kevin Day [Thu, 1 Mar 2012 01:29:07 +0000 (19:29 -0600)]
Update: replace f_string_length with f_array_length where appropriate
The f_string_lengths length variable should be an f_array_length (this would otherwise be called f_string_lengths_length)
Replace all code that used the f_string_lengths length variables with f_array_length.
Kevin Day [Thu, 1 Mar 2012 01:05:49 +0000 (19:05 -0600)]
Update: add f_array_length typedef
It makes more sense to define a default array length size variable instead of using things like f_string_length for the lenght variable that represents string lengths.
It is also easier to read than doing something like f_string_length_length.
Kevin Day [Tue, 28 Feb 2012 01:43:54 +0000 (19:43 -0600)]
Import Commit: mass import fll project
This is not an import from the svn repository, but instead an import from the latest individual 0.2.* release for each project.
This also has a few patches that I had applied or backported from kevux to fix bugs in the latest official releases.
I did this because I am completely out of sync with whatever I was doing in the project.
I was probably in the middle of making some major changes, but I do not remember what they were.
Therefore, I am starting on a hopefully stable base to pick up from.