Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /***************************************************************************************************
  2.  *  Copyright (C) Vasiliy Kosenko (vkos), 2009                                                     *
  3.  *  This program is free software: you can redistribute it and/or modify it under the terms of the *
  4.  *  GNU 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.  *  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;      *
  8.  *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See  *
  9.  *  the GNU General Public License for more details.                                               *
  10.  *                                                                                                 *
  11.  *  You should have received a copy of the GNU General Public License along with this program.     *
  12.  *  If not, see <http://www.gnu.org/licenses/>.                                                    *
  13.  ***************************************************************************************************/
  14.  
  15. #ifndef _KOLIBRI_H_
  16. #define _KOLIBRI_H_
  17.  
  18. #define KOLIBRI_ACCESS_READ 0x0
  19. #define KOLIBRI_CREATE 0x8
  20.  
  21. #define KOLIBRI_EVENT_IPC_MASK 0x40
  22. #define KOLIBRI_EVENT_IPC 0x7
  23.  
  24. //
  25. struct kolibri_memarea {
  26.         void *addr;
  27.         int error;              // or size
  28.         char *name;
  29. };
  30.  
  31. typedef struct kolibri_memarea kolibri_memarea_t;
  32.  
  33. //
  34. #pragma pack(push,1)
  35. struct kolibri_process_info {
  36.         long cpu_using;                         // +0
  37.         short window_position;                  // +4
  38.         short window_position_slot;             // +6
  39.         short reserved_0;                       // +8
  40.         char name[11];                          // +10
  41.         char reserved_const_0;                  // +21
  42.         unsigned long addr;                     // +22
  43.         long mem_using;                         // +26
  44.         long tid;                               // +30
  45.         long window_x;
  46.         long window_y;
  47.         long window_width;
  48.         long window_height;
  49.         short state;
  50.         short reserved_const_1;
  51.         long window_client_x;
  52.         long window_client_y;
  53.         long window_client_width;
  54.         long window_client_height;
  55.         char window_state;
  56. };
  57. #pragma pack(pop)
  58.  
  59. typedef struct kolibri_process_info kolibri_process_info_t;
  60.  
  61. //
  62. //extern kolibri_IPC_area_t *kolibri_IPC_area;
  63.  
  64. // //
  65. // int kolibri_IPC_set_area(void *area, int size);
  66. // int kolibri_IPC_send(int tid, void *msg, int length);
  67. // void kolibri_IPC_unlock();
  68. // void kolibri_IPC_lock();
  69. // int kolibri_IPC_init(void *area, int size);
  70. // kolibri_IPC_message_t *kolibri_IPC_get_next_message();
  71. // void kolibri_IPC_clear_buff();
  72. int kolibri_event_wait();
  73.  
  74. /*
  75.  * Memory functions
  76.  */
  77.  
  78. kolibri_memarea_t kolibri_new_named_memory(char *name, int size, int flags);
  79. int kolibri_heap_init();
  80. void *kolibri_malloc(int nbytes);
  81.  
  82. /*
  83.  * Events functions
  84.  */
  85. void kolibri_set_event_mask(int mask);
  86.  
  87. #endif
  88.