summaryrefslogtreecommitdiff
path: root/src/mods/commands/yc_template.cpp
diff options
context:
space:
mode:
authoradmin (centauri.fritz.box) <puppet@mx.buetow.org>2014-07-01 20:17:31 +0200
committeradmin (centauri.fritz.box) <puppet@mx.buetow.org>2014-07-01 20:17:31 +0200
commite5ff213596011443c467a5257ed6fe5847265d7f (patch)
treeb7322e71dd7f2fb1ff6824cb20acc706b84d06c5 /src/mods/commands/yc_template.cpp
parent0b4ccf59b27f0a8de71b10120b50c916fdbc46a0 (diff)
parent13aaf70af703748fe096e0664c305cd202637ad2 (diff)
Diffstat (limited to 'src/mods/commands/yc_template.cpp')
-rw-r--r--src/mods/commands/yc_template.cpp47
1 files changed, 29 insertions, 18 deletions
diff --git a/src/mods/commands/yc_template.cpp b/src/mods/commands/yc_template.cpp
index a49bb69..6612e55 100644
--- a/src/mods/commands/yc_template.cpp
+++ b/src/mods/commands/yc_template.cpp
@@ -1,7 +1,7 @@
/*:*
*: File: ./src/mods/commands/yc_template.cpp
*:
- *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
@@ -22,28 +22,39 @@
*: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*:*/
-#include <iostream>
-#include "../../chat/user.h"
+template<class obj_type>
+tupel<obj_type>::tupel()
+{
+ pthread_mutex_init(&mut_tupel, NULL);
+}
-/*
- gcc -shared -o yc_name.so yc_name.cpp
-*/
+template<class obj_type>
+tupel<obj_type>::tupel(obj_type t_obj)
+{
+ this->t_obj = t_obj;
+ pthread_mutex_init(&mut_tupel, NULL);
+}
-using namespace std;
+template<class obj_type>
+tupel<obj_type>::~tupel()
+{
+ pthread_mutex_destroy(&mut_tupel);
+}
extern "C"
{
- int extern_function(void *v_arg)
- {
- container *c=(container *)v_arg;
-
- user *p_user = (user*)c->elem[1]; // the corresponding user
- vector<string> *params=(vector<string>*)c->elem[2]; // param array
-
- string *quitstring=new string("Text to send<br>");
- p_user->msg_post( quitstring );
+ pthread_mutex_lock(&mut_tupel);
+ obj_type t_ret = t_obj;
+ pthread_mutex_unlock(&mut_tupel);
+ return t_ret;
+}
- return 0;
- }
+template<class obj_type>
+void
+tupel<obj_type>::set_elem(obj_type t_obj)
+{
+ pthread_mutex_lock(&mut_tupel);
+ this->t_obj = t_obj;
+ pthread_mutex_unlock(&mut_tupel);
}