]> Kevux Git Server - fll/commitdiff
Update: add support for array_length arrays
authorKevin Day <kevin@kevux.org>
Thu, 7 Jun 2012 05:33:03 +0000 (00:33 -0500)
committerKevin Day <kevin@kevux.org>
Thu, 7 Jun 2012 05:33:03 +0000 (00:33 -0500)
Because this uses memory operations it was moved to a separate file called types_arrays.h
This adds a dependency on f_memory.
While the dependency is circular, f_types will never provide source files.
Therefore chicken and the egg issues should not be a problem (f_types is always installed before f_memory).

level_0/f_types/c/types_array.h [new file with mode: 0644]
level_0/f_types/data/build/settings

diff --git a/level_0/f_types/c/types_array.h b/level_0/f_types/c/types_array.h
new file mode 100644 (file)
index 0000000..c44cb26
--- /dev/null
@@ -0,0 +1,51 @@
+/* FLL - Level 0
+ * Project:       Types Array
+ * Version:       0.3.x
+ * Licenses:      lgplv2.1
+ * Programmers:   Kevin Day
+ * Documentation:
+ *
+ * Provides datatypes that are arrays of some sort and require memory operations.
+ */
+#ifndef _F_types_array_h
+#define _F_types_array_h
+
+// libc includes
+#include <sys/stat.h> // contains mode_t, dev_t, gid_t, uid_t, etc..
+#include <signal.h>
+
+// fll includes
+#include <level_0/types.h>
+#include <level_0/memory.h>
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+#ifndef _di_f_array_lengths_
+  typedef struct {
+    f_array_length *array;
+    f_array_length  size;  // total amount of allocated space
+    f_array_length  used;  // total number of allocated spaces used
+  } f_array_lengths;
+
+  #define f_array_lengths_initialize { f_array_length_initialize, f_array_length_initialize, f_array_length_initialize }
+
+  #define f_delete_array_lengths(status, lengths) \
+    f_delete_structure(status, lengths, f_array_length)
+
+  #define f_destroy_array_lengths(status, lengths) \
+    f_destroy_structure(status, lengths, f_array_length)
+
+  #define f_resize_array_lengths(status, lengths, new_length) \
+    f_resize_structure(status, lengths, f_array_length, new_length)
+
+  #define f_adjust_array_lengths(status, lengths, new_length) \
+    f_adjust_structure(status, lengths, f_array_length, new_length)
+#endif // _di_f_array_lengths_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_types_array_h
index b9e4c55b36eeab5fb844e82266185ce20e3e9a57..79e1cbd7f7fa483b4d2d9f27502690ca2fe78ed4 100644 (file)
@@ -8,10 +8,10 @@ version_minor 3
 version_micro 0
 
 build_compiler gcc
-build_libraries -lc 
-build_sources_library 
-build_sources_program 
-build_sources_headers types.h
+build_libraries -lc
+build_sources_library
+build_sources_program
+build_sources_headers types.h types_array.h
 build_shared yes
 
 flags_all -z now