eina hamster++
authorraster <raster>
Thu, 13 Aug 2009 00:47:55 +0000 (00:47 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 13 Aug 2009 00:47:55 +0000 (00:47 +0000)
<dieb_> weird, undefined refernce to eina_cpu_count
<raster> you have no cpus!
<dieb_> dammit!
<Sachiel> try eina_hamster_count
<dieb_> lo
<raster> oh god
<raster> now u did it
<raster> i have to add that
<dieb_> heheheh

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@41727 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/include/Eina.h
src/include/Makefile.am
src/include/eina_hamster.h [new file with mode: 0644]
src/lib/Makefile.am
src/lib/eina_hamster.c [new file with mode: 0644]

index 997e0d4..d953d50 100644 (file)
@@ -166,6 +166,7 @@ extern "C" {
 #include "eina_convert.h"
 #include "eina_cpu.h"
 #include "eina_tiler.h"
+#include "eina_hamster.h"
 
 #ifdef __cplusplus
 }
index c02a04d..e0dc39a 100644 (file)
@@ -33,7 +33,8 @@ eina_trash.h \
 eina_iterator.h \
 eina_main.h \
 eina_cpu.h \
-eina_tiler.h
+eina_tiler.h \
+eina_hamster.h
 
 installed_mainheaderdir = $(includedir)/eina-@VMAJ@
 dist_installed_mainheader_DATA = Eina.h eina_config.h
diff --git a/src/include/eina_hamster.h b/src/include/eina_hamster.h
new file mode 100644 (file)
index 0000000..84682ce
--- /dev/null
@@ -0,0 +1,44 @@
+/* EINA - EFL data type library
+ * Copyright (C) 2008 Cedric Bail
+ *
+ * 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 EINA_HAMSTER_H_
+#define EINA_HAMSTER_H_
+
+/**
+ * @addtogroup Eina_Core_Group Core
+ *
+ * @{
+ */
+
+/**
+ * @defgroup Eina_Main_Group Hamster
+ *
+ * @{
+ */
+
+EAPI int eina_hamster_count(void);
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+#endif /* EINA_HAMSTER_H_ */
index 9076b20..5aebda5 100644 (file)
@@ -32,7 +32,8 @@ eina_benchmark.c \
 eina_rectangle.c \
 eina_stringshare.c \
 eina_cpu.c \
-eina_tiler.c
+eina_tiler.c \
+eina_hamster.c
 
 if EINA_STATIC_BUILD_CHAINED_POOL
 
diff --git a/src/lib/eina_hamster.c b/src/lib/eina_hamster.c
new file mode 100644 (file)
index 0000000..7769b6d
--- /dev/null
@@ -0,0 +1,82 @@
+/* EINA - EFL data type library
+ * Copyright (C) 2008 Cedric Bail
+ *
+ * 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/>.
+ */
+
+#include <stdio.h>
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "eina_types.h"
+#include "eina_main.h"
+#include "eina_error.h"
+#include "eina_hash.h"
+#include "eina_stringshare.h"
+#include "eina_list.h"
+#include "eina_array.h"
+#include "eina_counter.h"
+#include "eina_benchmark.h"
+#include "eina_magic.h"
+#include "eina_rectangle.h"
+
+/*============================================================================*
+ *                                  Local                                     *
+ *============================================================================*/
+
+/**
+ * @cond LOCAL
+ */
+
+static int _eina_hamsters = 7;
+
+/**
+ * @endcond
+ */
+
+/*============================================================================*
+ *                                 Global                                     *
+ *============================================================================*/
+
+/*============================================================================*
+ *                                   API                                      *
+ *============================================================================*/
+
+/**
+ * @addtogroup Eina_Main_Group Hamster
+ *
+ * @brief These functions provide hamster calls.
+ *
+ * @{
+ */
+
+/**
+ * @brief Get the hamster count.
+ *
+ * @return The number of available hamsters.
+ *
+ * This function returns how many hamsters you have.
+ */
+EAPI int
+eina_hamster_count(void)
+{
+   return _eina_hamsters;
+}
+
+/**
+ * @}
+ */