Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  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 <http://www.gnu.org/licenses/>.                                                    *
  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.  
  24. #include "kolibri.h"
  25.  
  26. #define KOBRA_CMD_REGISTER              'R'
  27. #define KOBRA_CMD_JOIN                  'J'
  28. #define KOBRA_CMD_UNJOIN                'U'
  29. #define KOBRA_CMD_SEND                  'S'
  30. #define KOBRA_CMD_GET_LIST_NAME         'G'
  31.  
  32. #define KOBRA_MEMAREA_NAME              "kobra_list"
  33. #define KOBRA_MEMAREA_NAME_LENGTH       11
  34. #define KOBRA_MEM_SIZE                  0x1000
  35.  
  36. struct group_list {
  37.         struct group_list *next;
  38.         struct group_list *previos;
  39.        
  40.         char *name;
  41.         struct thread_list *thread_list;
  42. };
  43.  
  44. typedef struct group_list group_list_t;
  45.  
  46. struct thread_list {
  47.         struct thread_list *next;
  48.         struct thread_list *previos;
  49.        
  50.         int tid;
  51. };
  52.  
  53. typedef struct thread_list thread_list_t;
  54.  
  55. void message_handle(kolibri_IPC_message_t *message);
  56. thread_list_t *find_tid(group_list_t *group, int tid);
  57. void kobra_register(int tid);
  58. void add_to_group(group_list_t *group, int tid);
  59. void remove_from_group(group_list_t *group, thread_list_t *thread);
  60. group_list_t *find_group(char *name);
  61. void send_group_message(group_list_t *group, int tid, char *message, int length);
  62. void remove_group(group_list_t *group);
  63. group_list_t *create_group(char *name);
  64. group_list_t *new_group_list(char *name);
  65. thread_list_t *new_thread_list(int tid);
  66.  
  67. #endif
  68.  
  69. // kolibri_IPC_message_t
  70. // bool
  71. // IPC const
  72. // NULL
  73.