Subversion Repositories Kolibri OS

Rev

Rev 1238 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1238 vkos 1
/***************************************************************************************************
2
 *  Copyright (C) Vasiliy Kosenko (vkos), 2009                                                     *
3
 *  Kobra is free software: you can redistribute it and/or modify it under the terms of the GNU    *
4
 *  General Public License as published by the Free Software Foundation, either version 3          *
5
 *  of the License, or (at your option) any later version.                                         *
6
 *                                                                                                 *
7
 *  Kobra is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without     *
8
 *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  *
9
 *  General Public License for more details.                                                       *
10
 *                                                                                                 *
11
 *  You should have received a copy of the GNU General Public License along with Kobra.            *
12
 *  If not, see .                                                    *
13
 ***************************************************************************************************/
14
 
15
/***************************************************************************************************
16
 *  Kobra (Kolibri Bus for Reaching Applications) is daemon for advanced & easier applications     *
17
 *  communication.                                                                                 *
18
 *  This is inside header file.
19
 ***************************************************************************************************/
20
 
21
#ifndef _KOBRA_H_
22
#define _KOBRA_H_
23
 
1286 vkos 24
#include 
25
#include 
1238 vkos 26
 
27
#define KOBRA_CMD_REGISTER		'R'
28
#define KOBRA_CMD_JOIN			'J'
29
#define KOBRA_CMD_UNJOIN		'U'
30
#define KOBRA_CMD_SEND			'S'
31
#define KOBRA_CMD_GET_LIST_NAME		'G'
32
 
33
#define KOBRA_MEMAREA_NAME		"kobra_list"
34
#define KOBRA_MEMAREA_NAME_LENGTH	11
35
#define KOBRA_MEM_SIZE			0x1000
36
 
37
struct group_list {
38
	struct group_list *next;
39
	struct group_list *previos;
40
 
41
	char *name;
42
	struct thread_list *thread_list;
43
};
44
 
45
typedef struct group_list group_list_t;
46
 
47
struct thread_list {
48
	struct thread_list *next;
49
	struct thread_list *previos;
50
 
51
	int tid;
52
};
53
 
54
typedef struct thread_list thread_list_t;
55
 
56
void message_handle(kolibri_IPC_message_t *message);
57
thread_list_t *find_tid(group_list_t *group, int tid);
58
void kobra_register(int tid);
59
void add_to_group(group_list_t *group, int tid);
60
void remove_from_group(group_list_t *group, thread_list_t *thread);
61
group_list_t *find_group(char *name);
62
void send_group_message(group_list_t *group, int tid, char *message, int length);
63
void remove_group(group_list_t *group);
64
group_list_t *create_group(char *name);
65
group_list_t *new_group_list(char *name);
66
thread_list_t *new_thread_list(int tid);
67
 
68
#endif
69
 
70
// kolibri_IPC_message_t
71
// bool
72
// IPC const
73
// NULL