aboutsummaryrefslogtreecommitdiff
path: root/libcmix/cmix.c
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-08-26 11:21:41 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-08-26 11:21:41 +0200
commit00ab2cf6add2976b3a4e8f8cc488777ad5c27808 (patch)
treeb9399bf912d949c289ff31edae8af2303dff7d26 /libcmix/cmix.c
downloadcmix-00ab2cf6add2976b3a4e8f8cc488777ad5c27808.tar.gz
cmix-00ab2cf6add2976b3a4e8f8cc488777ad5c27808.tar.bz2
cmix-00ab2cf6add2976b3a4e8f8cc488777ad5c27808.zip
Initial commit, just some ideas and testing.
Diffstat (limited to 'libcmix/cmix.c')
-rw-r--r--libcmix/cmix.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libcmix/cmix.c b/libcmix/cmix.c
new file mode 100644
index 0000000..944ac9c
--- /dev/null
+++ b/libcmix/cmix.c
@@ -0,0 +1,28 @@
+
+#include "cmix.h"
+
+#include <string.h>
+
+enum cmix_error permutation(struct CMixBuffer b) {
+ return no_error;
+}
+
+enum cmix_error get_message(char* message, struct CMixBuffer b, unsigned int index)
+{
+ if(index >= b.message_length) {
+ return index_out_of_range;
+ }
+
+ strncpy(message, b.buffer + index * b.message_length, b.message_length);
+
+ return no_error;
+}
+
+enum cmix_error set_message(char const* message, struct CMixBuffer b, unsigned int index)
+{
+ if(index >= b.message_length) {
+ return index_out_of_range;
+ }
+
+ strncpy(b.buffer + index * b.message_length, message, b.message_length);
+}