summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-21 16:06:12 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-21 16:06:12 +0200
commit376544017bf7627b5d5e0fa180778ef209591144 (patch)
tree61faed1511f80bff0b57db6e7d34553a336e531f /src/include
parent5c2347eb55eb0b6d661a3efddc5e3aff93dd6c2e (diff)
downloadedoors-376544017bf7627b5d5e0fa180778ef209591144.zip
edoors-376544017bf7627b5d5e0fa180778ef209591144.tar.gz
add headers
Diffstat (limited to 'src/include')
-rw-r--r--src/include/Eiotas.h42
-rw-r--r--src/include/eiotas_board.h38
-rw-r--r--src/include/eiotas_door.h37
-rw-r--r--src/include/eiotas_iota.h49
-rw-r--r--src/include/eiotas_link.h27
-rw-r--r--src/include/eiotas_main.h39
-rw-r--r--src/include/eiotas_particle.h31
-rw-r--r--src/include/eiotas_room.h36
-rw-r--r--src/include/eiotas_spin.h46
-rw-r--r--src/include/eiotas_userbits.h45
10 files changed, 390 insertions, 0 deletions
diff --git a/src/include/Eiotas.h b/src/include/Eiotas.h
new file mode 100644
index 0000000..4ae6c2c
--- /dev/null
+++ b/src/include/Eiotas.h
@@ -0,0 +1,42 @@
+/* EIOTAS
+ * Copyright (C) 2012 Jérémy Zurcher
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __EIOTAS_H__
+#define __EIOTAS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "eiotas_main.h"
+
+#include "eiotas_particle.h"
+#include "eiotas_iota.h"
+#include "eiotas_link.h"
+#include "eiotas_room.h"
+#include "eiotas_door.h"
+#include "eiotas_board.h"
+#include "eiotas_spin.h"
+
+#include "eiotas_userbits.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __EIOTAS_H__
diff --git a/src/include/eiotas_board.h b/src/include/eiotas_board.h
new file mode 100644
index 0000000..3234287
--- /dev/null
+++ b/src/include/eiotas_board.h
@@ -0,0 +1,38 @@
+/* EIOTAS
+ * Copyright (C) 2012 Jérémy Zurcher
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __EIOTAS_BOARD_H__
+#define __EIOTAS_BOARD_H__
+
+#include "eiotas_iota.h"
+#include "eiotas_room.h"
+#include "eiotas_userbits.h"
+
+#include <eina_hash.h>
+
+typedef struct _Eiotas_Board Eiotas_Board;
+
+struct _Eiotas_Board {
+ Eiotas_Iota iota; /* structural info */
+ Eiotas_User_Bits user_bits; /* user bits */
+ Eina_Hash *postponed; /* TODO Particles */
+};
+
+EAPI Eiotas_Board* eiotas_board_add(const char* name, Eiotas_Room *parent, Eiotas_User_Bits *user_bits);
+
+#endif // __EIOTAS_BOARD_H__
diff --git a/src/include/eiotas_door.h b/src/include/eiotas_door.h
new file mode 100644
index 0000000..aadcbd1
--- /dev/null
+++ b/src/include/eiotas_door.h
@@ -0,0 +1,37 @@
+/* EIOTAS
+ * Copyright (C) 2012 Jérémy Zurcher
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __EIOTAS_DOOR_H__
+#define __EIOTAS_DOOR_H__
+
+#include "eiotas_iota.h"
+#include "eiotas_room.h"
+#include "eiotas_userbits.h"
+
+#include <eina_types.h>
+
+typedef struct _Eiotas_Door Eiotas_Door;
+
+struct _Eiotas_Door {
+ Eiotas_Iota iota; /* structural info */
+ Eiotas_User_Bits user_bits; /* user bits */
+};
+
+EAPI Eiotas_Door* eiotas_door_add(const char* name, Eiotas_Room *parent, Eiotas_User_Bits *user_bits);
+
+#endif // __EIOTAS_DOOR_H__
diff --git a/src/include/eiotas_iota.h b/src/include/eiotas_iota.h
new file mode 100644
index 0000000..cd65013
--- /dev/null
+++ b/src/include/eiotas_iota.h
@@ -0,0 +1,49 @@
+/* EIOTAS
+ * Copyright (C) 2012 Jérémy Zurcher
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __EIOTAS_IOTA_H__
+#define __EIOTAS_IOTA_H__
+
+#include <eina_stringshare.h>
+
+typedef enum _Eiotas_Type
+{
+ EIOTAS_TYPE_SPIN=0,
+ EIOTAS_TYPE_ROOM,
+ EIOTAS_TYPE_BOARD,
+ EIOTAS_TYPE_DOOR,
+ EIOTAS_TYPE_COUNT
+} Eiotas_Type;
+
+typedef struct _Eiotas_Iota Eiotas_Iota;
+
+struct _Eiotas_Iota {
+ Eiotas_Type type; /* type of the iota */
+ Eiotas_Iota *spin; /* top level iota which is a Eiota_Spin */
+ Eiotas_Iota *parent; /* direct parent in the hierarchy */
+ Eina_Stringshare *name; /* iota's name */
+ Eina_Stringshare *path; /* full path to this iota */
+};
+
+EAPI void eiotas_iota_show(Eiotas_Iota *iota);
+
+#define eiotas_iota_require_particle(_iota) eiotas_spin_require_particle((Eiotas_Spin*)(_iota)->spin)
+
+#define eiotas_iota_release_particle(_iota,_particle) eiotas_spin_release_particle((Eiotas_Spin*)(_iota)->spin,_particle)
+
+#endif // __EIOTAS_IOTA_H__
diff --git a/src/include/eiotas_link.h b/src/include/eiotas_link.h
new file mode 100644
index 0000000..7bdb5b2
--- /dev/null
+++ b/src/include/eiotas_link.h
@@ -0,0 +1,27 @@
+/* EIOTAS
+ * Copyright (C) 2012 Jérémy Zurcher
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __EIOTAS_LINK_H__
+#define __EIOTAS_LINK_H__
+
+typedef struct _Eiotas_Link Eiotas_Link;
+
+struct _Eiotas_Link {
+};
+
+#endif // __EIOTAS_LINK_H__
diff --git a/src/include/eiotas_main.h b/src/include/eiotas_main.h
new file mode 100644
index 0000000..d7ef48c
--- /dev/null
+++ b/src/include/eiotas_main.h
@@ -0,0 +1,39 @@
+/* EIOTAS
+ * Copyright (C) 2012 Jérémy Zurcher
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __EIOTAS_MAIN_H__
+#define __EIOTAS_MAIN_H__
+
+#include <eina_types.h>
+
+typedef struct _Eiotas_Version
+{
+ int major; /**< Major component of the version */
+ int minor; /**< Minor component of the version */
+ int micro; /**< Micro component of the version */
+} Eiotas_Version;
+
+EAPI extern Eiotas_Version *eiotas_version;
+
+EAPI extern int _eiotas_log_dom;
+
+EAPI int eiotas_init();
+
+EAPI int eiotas_shutdown();
+
+#endif // __EIOTAS_MAIN_H__
diff --git a/src/include/eiotas_particle.h b/src/include/eiotas_particle.h
new file mode 100644
index 0000000..d4dfaaf
--- /dev/null
+++ b/src/include/eiotas_particle.h
@@ -0,0 +1,31 @@
+/* EIOTAS
+ * Copyright (C) 2012 Jérémy Zurcher
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __EIOTAS_PARTICLE_H__
+#define __EIOTAS_PARTICLE_H__
+
+#include <eina_types.h>
+#include <eina_stringshare.h>
+
+typedef struct _Eiotas_Particle Eiotas_Particle;
+
+struct _Eiotas_Particle {
+ Eina_Stringshare *src; /* TODO */
+};
+
+#endif // __EIOTAS_PARTICLE_H__
diff --git a/src/include/eiotas_room.h b/src/include/eiotas_room.h
new file mode 100644
index 0000000..da40f3c
--- /dev/null
+++ b/src/include/eiotas_room.h
@@ -0,0 +1,36 @@
+/* EIOTAS
+ * Copyright (C) 2012 Jérémy Zurcher
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __EIOTAS_ROOM_H__
+#define __EIOTAS_ROOM_H__
+
+#include "eiotas_iota.h"
+
+#include <eina_hash.h>
+
+typedef struct _Eiotas_Room Eiotas_Room;
+
+struct _Eiotas_Room {
+ Eiotas_Iota iota; /* structural info */
+ Eina_Hash *links; /* TODO */
+ Eina_Hash *children; /* stringshared values optimized hash table holding Rooms, Doors and Boards */
+};
+
+EAPI Eiotas_Room* eiotas_room_add(const char* name, Eiotas_Room *parent);
+
+#endif // __EIOTAS_ROOM_H__
diff --git a/src/include/eiotas_spin.h b/src/include/eiotas_spin.h
new file mode 100644
index 0000000..63cff05
--- /dev/null
+++ b/src/include/eiotas_spin.h
@@ -0,0 +1,46 @@
+/* EIOTAS
+ * Copyright (C) 2012 Jérémy Zurcher
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __EIOTAS_SPIN_H__
+#define __EIOTAS_SPIN_H__
+
+#include "eiotas_room.h"
+#include "eiotas_particle.h"
+
+#include <eina_array.h>
+
+typedef struct _Eiotas_Spin Eiotas_Spin;
+
+struct _Eiotas_Spin {
+ Eiotas_Room room; /* higher level Room */
+ Eina_Array *free_particles; /* lifo of free to reuse Particles TODO support different particle types, use an Eina_Hash */
+ Eina_Array *app_fifo; /* fifo of application priority particles */
+ Eina_Array *sys_fifo; /* fifo of system priority particles */
+};
+
+EAPI void eiotas_spin_free(Eiotas_Spin *spin);
+
+EAPI Eiotas_Spin* eiotas_spin_add(const char* name, unsigned int step);
+
+EAPI Eiotas_Particle* eiotas_spin_require_particle(Eiotas_Spin *spin);
+
+EAPI Eiotas_Particle* eiotas_spin_release_particle(Eiotas_Spin *spin, Eiotas_Particle *particle);
+
+EAPI void eiotas_spin_send_particle(Eiotas_Spin *spin, Eiotas_Particle *particle, Eina_Bool system);
+
+#endif // __EIOTAS_SPIN_H__
diff --git a/src/include/eiotas_userbits.h b/src/include/eiotas_userbits.h
new file mode 100644
index 0000000..e0405d9
--- /dev/null
+++ b/src/include/eiotas_userbits.h
@@ -0,0 +1,45 @@
+/* EIOTAS
+ * Copyright (C) 2012 Jérémy Zurcher
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __EIOTAS_USERBITS_H__
+#define __EIOTAS_USERBITS_H__
+
+#include "eiotas_iota.h"
+#include "eiotas_particle.h"
+
+typedef struct _Eiotas_User_Bits Eiotas_User_Bits;
+
+typedef void Eiotas_User_Data;
+typedef void (*Eiotas_User_Data_Free)(Eiotas_User_Data*);
+typedef void (*Eiotas_Receive_Particle)(Eiotas_Iota *iota, Eiotas_Particle *particle, Eiotas_User_Data *data);
+typedef void (*Eiotas_Start)(Eiotas_Iota *iota, Eiotas_User_Data *data);
+typedef void (*Eiotas_Suspend)(Eiotas_Iota *iota, Eiotas_User_Data *data);
+typedef void (*Eiotas_Resume)(Eiotas_Iota *iota, Eiotas_User_Data *data);
+typedef void (*Eiotas_Stop)(Eiotas_Iota *iota, Eiotas_User_Data *data);
+
+struct _Eiotas_User_Bits {
+ Eiotas_User_Data *data;
+ Eiotas_User_Data_Free free_fct;
+ Eiotas_Receive_Particle recv_fct;
+ Eiotas_Start start_fct;
+ Eiotas_Stop stop_fct;
+ Eiotas_Suspend suspend_fct;
+ Eiotas_Resume resume_fct;
+};
+
+#endif // __EIOTAS_USERBITS_H__