Changeset 8fb1bf82 in mainline for uspace/lib/c/include
- Timestamp:
- 2010-11-25T13:42:50Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8df8415
- Parents:
- a93d79a (diff), eb667613 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/lib/c/include
- Files:
-
- 5 added
- 23 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/char_map.h
ra93d79a r8fb1bf82 48 48 typedef struct char_map char_map_t; 49 49 50 /** Type definition of the character string to integer map pointer.51 * @see char_map52 */53 typedef char_map_t *char_map_ref;54 55 50 /** Character string to integer map item. 56 51 * … … 69 64 int next; 70 65 /** Next character array. */ 71 char_map_ ref*items;66 char_map_t **items; 72 67 /** Consistency check magic value. */ 73 68 int magic; 74 69 }; 75 70 76 extern int char_map_initialize(char_map_ ref);77 extern void char_map_destroy(char_map_ ref);78 extern int char_map_exclude(char_map_ ref, const char *, size_t);79 extern int char_map_add(char_map_ ref, const char *, size_t, const int);80 extern int char_map_find(const char_map_ ref, const char *, size_t);81 extern int char_map_update(char_map_ ref, const char *, size_t, const int);71 extern int char_map_initialize(char_map_t *); 72 extern void char_map_destroy(char_map_t *); 73 extern int char_map_exclude(char_map_t *, const char *, size_t); 74 extern int char_map_add(char_map_t *, const char *, size_t, const int); 75 extern int char_map_find(const char_map_t *, const char *, size_t); 76 extern int char_map_update(char_map_t *, const char *, size_t, const int); 82 77 83 78 #endif -
uspace/lib/c/include/adt/dynamic_fifo.h
ra93d79a r8fb1bf82 44 44 typedef struct dyn_fifo dyn_fifo_t; 45 45 46 /** Type definition of the dynamic fifo queue pointer.47 * @see dyn_fifo48 */49 typedef dyn_fifo_t *dyn_fifo_ref;50 51 46 /** Dynamic first in first out positive integer queue. 52 47 * Possitive integer values only. … … 66 61 }; 67 62 68 extern int dyn_fifo_initialize(dyn_fifo_ ref, int);69 extern int dyn_fifo_destroy(dyn_fifo_ ref);70 extern int dyn_fifo_push(dyn_fifo_ ref, int, int);71 extern int dyn_fifo_pop(dyn_fifo_ ref);72 extern int dyn_fifo_value(dyn_fifo_ ref);63 extern int dyn_fifo_initialize(dyn_fifo_t *, int); 64 extern int dyn_fifo_destroy(dyn_fifo_t *); 65 extern int dyn_fifo_push(dyn_fifo_t *, int, int); 66 extern int dyn_fifo_pop(dyn_fifo_t *); 67 extern int dyn_fifo_value(dyn_fifo_t *); 73 68 74 69 #endif -
uspace/lib/c/include/adt/generic_char_map.h
ra93d79a r8fb1bf82 40 40 #include <unistd.h> 41 41 #include <errno.h> 42 #include <err.h>43 42 44 43 #include <adt/char_map.h> … … 56 55 \ 57 56 typedef struct name name##_t; \ 58 typedef name##_t *name##_ref; \59 57 \ 60 58 struct name { \ … … 64 62 }; \ 65 63 \ 66 int name##_add(name##_ ref, const char *, const size_t, type *); \67 int name##_count(name##_ ref); \68 void name##_destroy(name##_ ref); \69 void name##_exclude(name##_ ref, const char *, const size_t); \70 type *name##_find(name##_ ref, const char *, const size_t); \71 int name##_initialize(name##_ ref); \72 int name##_is_valid(name##_ ref);64 int name##_add(name##_t *, const char *, const size_t, type *); \ 65 int name##_count(name##_t *); \ 66 void name##_destroy(name##_t *); \ 67 void name##_exclude(name##_t *, const char *, const size_t); \ 68 type *name##_find(name##_t *, const char *, const size_t); \ 69 int name##_initialize(name##_t *); \ 70 int name##_is_valid(name##_t *); 73 71 74 72 /** Character string to generic type map implementation. … … 82 80 GENERIC_FIELD_IMPLEMENT(name##_items, type) \ 83 81 \ 84 int name##_add(name##_ refmap, const char *name, const size_t length, \82 int name##_add(name##_t *map, const char *name, const size_t length, \ 85 83 type *value) \ 86 84 { \ 87 ERROR_DECLARE; \85 int rc; \ 88 86 int index; \ 89 87 if (!name##_is_valid(map)) \ … … 92 90 if (index < 0) \ 93 91 return index; \ 94 if (ERROR_OCCURRED(char_map_add(&map->names, name, length,\95 index))) { \92 rc = char_map_add(&map->names, name, length, index); \ 93 if (rc != EOK) { \ 96 94 name##_items_exclude_index(&map->values, index); \ 97 return ERROR_CODE; \95 return rc; \ 98 96 } \ 99 97 return EOK; \ 100 98 } \ 101 99 \ 102 int name##_count(name##_ refmap) \100 int name##_count(name##_t *map) \ 103 101 { \ 104 102 return name##_is_valid(map) ? \ … … 106 104 } \ 107 105 \ 108 void name##_destroy(name##_ refmap) \106 void name##_destroy(name##_t *map) \ 109 107 { \ 110 108 if (name##_is_valid(map)) { \ … … 114 112 } \ 115 113 \ 116 void name##_exclude(name##_ refmap, const char *name, \114 void name##_exclude(name##_t *map, const char *name, \ 117 115 const size_t length) \ 118 116 { \ … … 126 124 } \ 127 125 \ 128 type *name##_find(name##_ refmap, const char *name, \126 type *name##_find(name##_t *map, const char *name, \ 129 127 const size_t length) \ 130 128 { \ … … 139 137 } \ 140 138 \ 141 int name##_initialize(name##_ refmap) \139 int name##_initialize(name##_t *map) \ 142 140 { \ 143 ERROR_DECLARE; \141 int rc; \ 144 142 if (!map) \ 145 143 return EINVAL; \ 146 ERROR_PROPAGATE(char_map_initialize(&map->names)); \ 147 if (ERROR_OCCURRED(name##_items_initialize(&map->values))) { \ 144 rc = char_map_initialize(&map->names); \ 145 if (rc != EOK) \ 146 return rc; \ 147 rc = name##_items_initialize(&map->values); \ 148 if (rc != EOK) { \ 148 149 char_map_destroy(&map->names); \ 149 return ERROR_CODE; \150 return rc; \ 150 151 } \ 151 152 map->magic = GENERIC_CHAR_MAP_MAGIC_VALUE; \ … … 153 154 } \ 154 155 \ 155 int name##_is_valid(name##_ refmap) \156 int name##_is_valid(name##_t *map) \ 156 157 { \ 157 158 return map && (map->magic == GENERIC_CHAR_MAP_MAGIC_VALUE); \ -
uspace/lib/c/include/adt/generic_field.h
ra93d79a r8fb1bf82 53 53 #define GENERIC_FIELD_DECLARE(name, type) \ 54 54 typedef struct name name##_t; \ 55 typedef name##_t *name##_ref; \56 55 \ 57 56 struct name { \ … … 62 61 }; \ 63 62 \ 64 int name##_add(name##_ ref, type *); \65 int name##_count(name##_ ref); \66 void name##_destroy(name##_ ref); \67 void name##_exclude_index(name##_ ref, int); \68 type **name##_get_field(name##_ ref); \69 type *name##_get_index(name##_ ref, int); \70 int name##_initialize(name##_ ref); \71 int name##_is_valid(name##_ ref);63 int name##_add(name##_t *, type *); \ 64 int name##_count(name##_t *); \ 65 void name##_destroy(name##_t *); \ 66 void name##_exclude_index(name##_t *, int); \ 67 type **name##_get_field(name##_t *); \ 68 type *name##_get_index(name##_t *, int); \ 69 int name##_initialize(name##_t *); \ 70 int name##_is_valid(name##_t *); 72 71 73 72 /** Generic type field implementation. … … 79 78 */ 80 79 #define GENERIC_FIELD_IMPLEMENT(name, type) \ 81 int name##_add(name##_ reffield, type *value) \80 int name##_add(name##_t *field, type *value) \ 82 81 { \ 83 82 if (name##_is_valid(field)) { \ … … 99 98 } \ 100 99 \ 101 int name##_count(name##_ reffield) \100 int name##_count(name##_t *field) \ 102 101 { \ 103 102 return name##_is_valid(field) ? field->next : -1; \ 104 103 } \ 105 104 \ 106 void name##_destroy(name##_ reffield) \105 void name##_destroy(name##_t *field) \ 107 106 { \ 108 107 if (name##_is_valid(field)) { \ … … 117 116 } \ 118 117 \ 119 void name##_exclude_index(name##_ reffield, int index) \118 void name##_exclude_index(name##_t *field, int index) \ 120 119 { \ 121 120 if (name##_is_valid(field) && (index >= 0) && \ … … 126 125 } \ 127 126 \ 128 type *name##_get_index(name##_ reffield, int index) \127 type *name##_get_index(name##_t *field, int index) \ 129 128 { \ 130 129 if (name##_is_valid(field) && (index >= 0) && \ … … 134 133 } \ 135 134 \ 136 type **name##_get_field(name##_ reffield) \135 type **name##_get_field(name##_t *field) \ 137 136 { \ 138 137 return name##_is_valid(field) ? field->items : NULL; \ 139 138 } \ 140 139 \ 141 int name##_initialize(name##_ reffield) \140 int name##_initialize(name##_t *field) \ 142 141 { \ 143 142 if (!field) \ … … 153 152 } \ 154 153 \ 155 int name##_is_valid(name##_ reffield) \154 int name##_is_valid(name##_t *field) \ 156 155 { \ 157 156 return field && (field->magic == GENERIC_FIELD_MAGIC_VALUE); \ -
uspace/lib/c/include/adt/int_map.h
ra93d79a r8fb1bf82 56 56 #define INT_MAP_DECLARE(name, type) \ 57 57 typedef struct name name##_t; \ 58 typedef name##_t *name##_ref; \59 58 typedef struct name##_item name##_item_t; \ 60 typedef name##_item_t *name##_item_ref; \61 59 \ 62 60 struct name##_item { \ … … 69 67 int size; \ 70 68 int next; \ 71 name##_item_ refitems; \69 name##_item_t *items; \ 72 70 int magic; \ 73 71 }; \ 74 72 \ 75 int name##_add(name##_ ref, int, type *); \76 void name##_clear(name##_ ref); \77 int name##_count(name##_ ref); \78 void name##_destroy(name##_ ref); \79 void name##_exclude(name##_ ref, int); \80 void name##_exclude_index(name##_ ref, int); \81 type *name##_find(name##_ ref, int); \82 int name##_update(name##_ ref, int, int); \83 type *name##_get_index(name##_ ref, int); \84 int name##_initialize(name##_ ref); \85 int name##_is_valid(name##_ ref); \86 void name##_item_destroy(name##_item_ ref); \87 int name##_item_is_valid(name##_item_ ref);73 int name##_add(name##_t *, int, type *); \ 74 void name##_clear(name##_t *); \ 75 int name##_count(name##_t *); \ 76 void name##_destroy(name##_t *); \ 77 void name##_exclude(name##_t *, int); \ 78 void name##_exclude_index(name##_t *, int); \ 79 type *name##_find(name##_t *, int); \ 80 int name##_update(name##_t *, int, int); \ 81 type *name##_get_index(name##_t *, int); \ 82 int name##_initialize(name##_t *); \ 83 int name##_is_valid(name##_t *); \ 84 void name##_item_destroy(name##_item_t *); \ 85 int name##_item_is_valid(name##_item_t *); 88 86 89 87 /** Integer to generic type map implementation. … … 95 93 */ 96 94 #define INT_MAP_IMPLEMENT(name, type) \ 97 int name##_add(name##_ refmap, int key, type *value) \95 int name##_add(name##_t *map, int key, type *value) \ 98 96 { \ 99 97 if (name##_is_valid(map)) { \ 100 98 if (map->next == (map->size - 1)) { \ 101 name##_item_ reftmp; \102 tmp = (name##_item_ ref) realloc(map->items, \99 name##_item_t *tmp; \ 100 tmp = (name##_item_t *) realloc(map->items, \ 103 101 sizeof(name##_item_t) * 2 * map->size); \ 104 102 if (!tmp) \ … … 117 115 } \ 118 116 \ 119 void name##_clear(name##_ refmap) \117 void name##_clear(name##_t *map) \ 120 118 { \ 121 119 if (name##_is_valid(map)) { \ … … 132 130 } \ 133 131 \ 134 int name##_count(name##_ refmap) \132 int name##_count(name##_t *map) \ 135 133 { \ 136 134 return name##_is_valid(map) ? map->next : -1; \ 137 135 } \ 138 136 \ 139 void name##_destroy(name##_ refmap) \137 void name##_destroy(name##_t *map) \ 140 138 { \ 141 139 if (name##_is_valid(map)) { \ … … 152 150 } \ 153 151 \ 154 void name##_exclude(name##_ refmap, int key) \152 void name##_exclude(name##_t *map, int key) \ 155 153 { \ 156 154 if (name##_is_valid(map)) { \ … … 166 164 } \ 167 165 \ 168 void name##_exclude_index(name##_ refmap, int index) \166 void name##_exclude_index(name##_t *map, int index) \ 169 167 { \ 170 168 if (name##_is_valid(map) && (index >= 0) && \ … … 175 173 } \ 176 174 \ 177 type *name##_find(name##_ refmap, int key) \175 type *name##_find(name##_t *map, int key) \ 178 176 { \ 179 177 if (name##_is_valid(map)) { \ … … 189 187 } \ 190 188 \ 191 int name##_update(name##_ refmap, int key, int new_key) \189 int name##_update(name##_t *map, int key, int new_key) \ 192 190 { \ 193 191 if (name##_is_valid(map)) { \ … … 208 206 } \ 209 207 \ 210 type *name##_get_index(name##_ refmap, int index) \208 type *name##_get_index(name##_t *map, int index) \ 211 209 { \ 212 210 if (name##_is_valid(map) && (index >= 0) && \ … … 218 216 } \ 219 217 \ 220 int name##_initialize(name##_ refmap) \218 int name##_initialize(name##_t *map) \ 221 219 { \ 222 220 if (!map) \ … … 224 222 map->size = 2; \ 225 223 map->next = 0; \ 226 map->items = (name##_item_ ref) malloc(sizeof(name##_item_t) * \224 map->items = (name##_item_t *) malloc(sizeof(name##_item_t) * \ 227 225 map->size); \ 228 226 if (!map->items) \ … … 233 231 } \ 234 232 \ 235 int name##_is_valid(name##_ refmap) \233 int name##_is_valid(name##_t *map) \ 236 234 { \ 237 235 return map && (map->magic == INT_MAP_MAGIC_VALUE); \ 238 236 } \ 239 237 \ 240 void name##_item_destroy(name##_item_ refitem) \238 void name##_item_destroy(name##_item_t *item) \ 241 239 { \ 242 240 if (name##_item_is_valid(item)) { \ … … 249 247 } \ 250 248 \ 251 int name##_item_is_valid(name##_item_ refitem) \249 int name##_item_is_valid(name##_item_t *item) \ 252 250 { \ 253 251 return item && (item->magic == INT_MAP_ITEM_MAGIC_VALUE); \ -
uspace/lib/c/include/adt/measured_strings.h
ra93d79a r8fb1bf82 43 43 44 44 /** Type definition of the character string with measured length. 45 * 45 * @see measured_string 46 46 */ 47 47 typedef struct measured_string measured_string_t; 48 49 /** Type definition of the character string with measured length pointer.50 * @see measured_string51 */52 typedef measured_string_t *measured_string_ref;53 48 54 49 /** Character string with measured length. … … 59 54 struct measured_string { 60 55 /** Character string data. */ 61 char * 56 char *value; 62 57 /** Character string length. */ 63 58 size_t length; 64 59 }; 65 60 66 extern measured_string_ refmeasured_string_create_bulk(const char *, size_t);67 extern measured_string_ ref measured_string_copy(measured_string_ref);68 extern int measured_strings_receive(measured_string_ ref*, char **, size_t);69 extern int measured_strings_reply(const measured_string_ ref, size_t);70 extern int measured_strings_return(int, measured_string_ ref*, char **, size_t);71 extern int measured_strings_send(int, const measured_string_ ref, size_t);61 extern measured_string_t *measured_string_create_bulk(const char *, size_t); 62 extern measured_string_t *measured_string_copy(measured_string_t *); 63 extern int measured_strings_receive(measured_string_t **, char **, size_t); 64 extern int measured_strings_reply(const measured_string_t *, size_t); 65 extern int measured_strings_return(int, measured_string_t **, char **, size_t); 66 extern int measured_strings_send(int, const measured_string_t *, size_t); 72 67 73 68 #endif -
uspace/lib/c/include/ddi.h
ra93d79a r8fb1bf82 42 42 extern int iospace_enable(task_id_t, void *, unsigned long); 43 43 extern int pio_enable(void *, size_t, void **); 44 extern int interrupt_enable(int); 45 extern int interrupt_disable(int); 44 46 45 47 #endif -
uspace/lib/c/include/device/char.h
ra93d79a r8fb1bf82 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2010 Lenka Trochtova 3 3 * All rights reserved. 4 4 * … … 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 29 /** @addtogroup packet 30 * 28 29 /** @addtogroup libc 30 * @{ 31 31 */ 32 33 32 /** @file 34 33 */ 34 35 #ifndef LIBC_DEVICE_HW_RES_H_ 36 #define LIBC_DEVICE_HW_RES_H_ 35 37 36 #ifndef __NET_PACKET_LOCAL_H__ 37 #define __NET_PACKET_LOCAL_H__ 38 typedef enum { 39 CHAR_READ_DEV = 0, 40 CHAR_WRITE_DEV 41 } hw_res_funcs_t; 38 42 39 #include <net/packet.h> 40 41 /** @name Packet local interface 42 */ 43 /*@{*/ 44 45 extern int packet_translate_local(int, packet_ref, packet_id_t); 46 extern packet_t packet_get_4_local(int, size_t, size_t, size_t, size_t); 47 extern packet_t packet_get_1_local(int, size_t); 48 extern void pq_release_local(int, packet_id_t); 49 50 /*@}*/ 43 int read_dev(int dev_phone, void *buf, size_t len); 44 int write_dev(int dev_phone, void *buf, size_t len); 51 45 52 46 #endif -
uspace/lib/c/include/devman.h
ra93d79a r8fb1bf82 1 1 /* 2 * Copyright (c) 2009 Lukas Mejdrech 2 * Copyright (c) 2009 Jiri Svoboda 3 * Copyright (c) 2010 Lenka Trochtova 3 4 * All rights reserved. 4 5 * … … 27 28 */ 28 29 29 /** @addtogroup ip30 /** @addtogroup libc 30 31 * @{ 31 32 */ 33 /** @file 34 */ 32 35 33 #ifndef NET_IP_LOCAL_H_34 #define NET_IP_LOCAL_H_36 #ifndef LIBC_DEVMAN_H_ 37 #define LIBC_DEVMAN_H_ 35 38 39 #include <ipc/devman.h> 36 40 #include <async.h> 37 #include < ipc/services.h>41 #include <bool.h> 38 42 39 #include <net/ip_codes.h>40 #include <net/inet.h>41 #include <net/in.h>42 43 43 extern int ip_received_error_msg_local(int, device_id_t, packet_t, services_t, 44 services_t); 45 extern int ip_set_gateway_req_local(int, device_id_t, in_addr_t); 46 extern int ip_packet_size_req_local(int, device_id_t, packet_dimension_ref); 47 extern int ip_received_error_msg_local(int, device_id_t, packet_t, services_t, 48 services_t); 49 extern int ip_device_req_local(int, device_id_t, services_t); 50 extern int ip_add_route_req_local(int, device_id_t, in_addr_t, in_addr_t, 51 in_addr_t); 52 extern int ip_send_msg_local(int, device_id_t, packet_t, services_t, 53 services_t); 54 extern int ip_get_route_req_local(int, ip_protocol_t, const struct sockaddr *, 55 socklen_t, device_id_t *, void **, size_t *); 44 extern int devman_get_phone(devman_interface_t, unsigned int); 45 extern void devman_hangup_phone(devman_interface_t); 46 47 extern int devman_driver_register(const char *, async_client_conn_t); 48 extern int devman_child_device_register(const char *, match_id_list_t *, 49 devman_handle_t, devman_handle_t *); 50 51 extern int devman_device_connect(devman_handle_t, unsigned int); 52 extern int devman_parent_device_connect(devman_handle_t, unsigned int); 53 54 extern int devman_device_get_handle(const char *, devman_handle_t *, 55 unsigned int); 56 57 extern int devman_add_device_to_class(devman_handle_t, const char *); 56 58 57 59 #endif -
uspace/lib/c/include/devmap.h
ra93d79a r8fb1bf82 44 44 45 45 extern int devmap_driver_register(const char *, async_client_conn_t); 46 extern int devmap_device_register(const char *, dev _handle_t *);46 extern int devmap_device_register(const char *, devmap_handle_t *); 47 47 48 extern int devmap_device_get_handle(const char *, dev _handle_t *, unsigned int);49 extern int devmap_namespace_get_handle(const char *, dev _handle_t *, unsigned int);50 extern devmap_handle_type_t devmap_handle_probe(dev _handle_t);48 extern int devmap_device_get_handle(const char *, devmap_handle_t *, unsigned int); 49 extern int devmap_namespace_get_handle(const char *, devmap_handle_t *, unsigned int); 50 extern devmap_handle_type_t devmap_handle_probe(devmap_handle_t); 51 51 52 extern int devmap_device_connect(dev _handle_t, unsigned int);52 extern int devmap_device_connect(devmap_handle_t, unsigned int); 53 53 54 54 extern int devmap_null_create(void); … … 56 56 57 57 extern size_t devmap_count_namespaces(void); 58 extern size_t devmap_count_devices(dev _handle_t);58 extern size_t devmap_count_devices(devmap_handle_t); 59 59 60 60 extern size_t devmap_get_namespaces(dev_desc_t **); 61 extern size_t devmap_get_devices(dev _handle_t, dev_desc_t **);61 extern size_t devmap_get_devices(devmap_handle_t, dev_desc_t **); 62 62 63 63 #endif -
uspace/lib/c/include/err.h
ra93d79a r8fb1bf82 37 37 38 38 #include <stdio.h> 39 #include <errno.h>40 41 #ifdef CONFIG_DEBUG42 #include <str_error.h>43 #endif44 39 45 40 #define errx(status, fmt, ...) { \ … … 48 43 } 49 44 50 51 /** An actual stored error code. */52 #define ERROR_CODE error_check_return_value53 54 /** An error processing routines declaration.55 *56 * This has to be declared in the block where the error processing57 * is desired.58 */59 #define ERROR_DECLARE int ERROR_CODE60 61 /** Store the value as an error code and checks if an error occurred.62 *63 * @param[in] value The value to be checked. May be a function call.64 * @return False if the value indicates success (EOK).65 * @return True otherwise.66 */67 #ifdef CONFIG_DEBUG68 69 #define ERROR_OCCURRED(value) \70 (((ERROR_CODE = (value)) != EOK) && \71 ({ \72 fprintf(stderr, "libsocket error at %s:%d (%s)\n", \73 __FILE__, __LINE__, str_error(ERROR_CODE)); \74 1; \75 }))76 77 #else78 79 #define ERROR_OCCURRED(value) ((ERROR_CODE = (value)) != EOK)80 81 #endif82 83 #define ERROR_NONE(value) !ERROR_OCCURRED((value))84 85 /** Error propagation86 *87 * Check if an error occurred and immediately exit the actual88 * function returning the error code.89 *90 * @param[in] value The value to be checked. May be a function call.91 *92 */93 94 #define ERROR_PROPAGATE(value) \95 if (ERROR_OCCURRED(value)) \96 return ERROR_CODE97 98 45 #endif 99 46 100 47 /** @} 101 48 */ 49 -
uspace/lib/c/include/fibril.h
ra93d79a r8fb1bf82 48 48 #define FIBRIL_WRITER 2 49 49 50 struct fibril; 51 52 typedef struct { 53 struct fibril *owned_by; 54 } fibril_owner_info_t; 55 50 56 typedef enum { 51 57 FIBRIL_PREEMPT, … … 68 74 int retval; 69 75 int flags; 76 77 fibril_owner_info_t *waits_for; 70 78 } fibril_t; 71 79 -
uspace/lib/c/include/fibril_synch.h
ra93d79a r8fb1bf82 43 43 44 44 typedef struct { 45 fibril_owner_info_t oi; /* Keep this the first thing. */ 45 46 int counter; 46 47 link_t waiters; … … 49 50 #define FIBRIL_MUTEX_INITIALIZER(name) \ 50 51 { \ 52 .oi = { \ 53 .owned_by = NULL \ 54 }, \ 51 55 .counter = 1, \ 52 56 .waiters = { \ … … 60 64 61 65 typedef struct { 66 fibril_owner_info_t oi; /* Keep this the first thing. */ 62 67 unsigned writers; 63 68 unsigned readers; … … 67 72 #define FIBRIL_RWLOCK_INITIALIZER(name) \ 68 73 { \ 74 .oi = { \ 75 .owned_by = NULL \ 76 }, \ 69 77 .readers = 0, \ 70 78 .writers = 0, \ -
uspace/lib/c/include/ipc/devmap.h
ra93d79a r8fb1bf82 40 40 #define DEVMAP_NAME_MAXLEN 255 41 41 42 typedef ipcarg_t dev _handle_t;42 typedef ipcarg_t devmap_handle_t; 43 43 44 44 typedef enum { … … 81 81 82 82 typedef struct { 83 dev _handle_t handle;83 devmap_handle_t handle; 84 84 char name[DEVMAP_NAME_MAXLEN + 1]; 85 85 } dev_desc_t; -
uspace/lib/c/include/ipc/services.h
ra93d79a r8fb1bf82 39 39 40 40 typedef enum { 41 SERVICE_LOAD = 1, 41 SERVICE_NONE = 0, 42 SERVICE_LOAD, 42 43 SERVICE_PCI, 43 44 SERVICE_VIDEO, … … 45 46 SERVICE_VFS, 46 47 SERVICE_DEVMAP, 48 SERVICE_DEVMAN, 47 49 SERVICE_FHC, 48 50 SERVICE_OBIO, -
uspace/lib/c/include/net/device.h
ra93d79a r8fb1bf82 59 59 */ 60 60 typedef struct device_stats device_stats_t; 61 62 /** Type definition of the device usage statistics pointer.63 * @see device_stats64 */65 typedef device_stats_t *device_stats_ref;66 61 67 62 /** Device state. */ -
uspace/lib/c/include/net/icmp_codes.h
ra93d79a r8fb1bf82 42 42 #define LIBC_ICMP_CODES_H_ 43 43 44 #include <sys/types.h> 45 44 46 /** ICMP type type definition. */ 45 47 typedef uint8_t icmp_type_t; -
uspace/lib/c/include/net/modules.h
ra93d79a r8fb1bf82 69 69 * 70 70 * @param[in] need The needed module service. 71 * @return sThe phone of the needed service.71 * @return The phone of the needed service. 72 72 */ 73 73 typedef int connect_module_t(services_t need); -
uspace/lib/c/include/net/packet.h
ra93d79a r8fb1bf82 46 46 * @see packet 47 47 */ 48 typedef struct packet * packet_t; 49 50 /** Type definition of the packet pointer. 51 * @see packet 52 */ 53 typedef packet_t * packet_ref; 48 typedef struct packet packet_t; 54 49 55 50 /** Type definition of the packet dimension. … … 57 52 */ 58 53 typedef struct packet_dimension packet_dimension_t; 59 60 /** Type definition of the packet dimension pointer.61 * @see packet_dimension62 */63 typedef packet_dimension_t * packet_dimension_ref;64 54 65 55 /** Packet dimension. */ … … 79 69 /*@{*/ 80 70 81 extern packet_t pm_find(packet_id_t);82 extern int pm_add(packet_t );71 extern packet_t *pm_find(packet_id_t); 72 extern int pm_add(packet_t *); 83 73 extern int pm_init(void); 84 74 extern void pm_destroy(void); 85 75 86 extern int pq_add(packet_t * , packet_t, size_t, size_t);87 extern packet_t pq_find(packet_t, size_t);88 extern int pq_insert_after(packet_t , packet_t);89 extern packet_t pq_detach(packet_t);90 extern int pq_set_order(packet_t , size_t, size_t);91 extern int pq_get_order(packet_t , size_t *, size_t *);92 extern void pq_destroy(packet_t , void (*)(packet_t));93 extern packet_t pq_next(packet_t);94 extern packet_t pq_previous(packet_t);76 extern int pq_add(packet_t **, packet_t *, size_t, size_t); 77 extern packet_t *pq_find(packet_t *, size_t); 78 extern int pq_insert_after(packet_t *, packet_t *); 79 extern packet_t *pq_detach(packet_t *); 80 extern int pq_set_order(packet_t *, size_t, size_t); 81 extern int pq_get_order(packet_t *, size_t *, size_t *); 82 extern void pq_destroy(packet_t *, void (*)(packet_t *)); 83 extern packet_t *pq_next(packet_t *); 84 extern packet_t *pq_previous(packet_t *); 95 85 96 86 /*@}*/ -
uspace/lib/c/include/net/packet_header.h
ra93d79a r8fb1bf82 124 124 /** Returns whether the packet is valid. 125 125 * @param[in] packet The packet to be checked. 126 * @return sTrue if the packet is not NULL and the magic value is126 * @return True if the packet is not NULL and the magic value is 127 127 * correct. 128 * @return sFalse otherwise.128 * @return False otherwise. 129 129 */ 130 static inline int packet_is_valid(const packet_t packet)130 static inline int packet_is_valid(const packet_t *packet) 131 131 { 132 132 return packet && (packet->magic_value == PACKET_MAGIC_VALUE); -
uspace/lib/c/include/stdio.h
ra93d79a r8fb1bf82 46 46 #define BUFSIZ 4096 47 47 48 #define DEBUG(fmt, ...) se\48 #define DEBUG(fmt, ...) \ 49 49 { \ 50 50 char _buf[256]; \ -
uspace/lib/c/include/sys/stat.h
ra93d79a r8fb1bf82 43 43 struct stat { 44 44 fs_handle_t fs_handle; 45 dev _handle_t dev_handle;45 devmap_handle_t devmap_handle; 46 46 fs_index_t index; 47 47 unsigned int lnkcnt; … … 49 49 bool is_directory; 50 50 aoff64_t size; 51 dev _handle_t device;51 devmap_handle_t device; 52 52 }; 53 53 -
uspace/lib/c/include/task.h
ra93d79a r8fb1bf82 48 48 extern int task_set_name(const char *); 49 49 extern task_id_t task_spawn(const char *, const char *const[], int *); 50 extern int task_spawnv(task_id_t *, const char *path, const char *const []); 51 extern int task_spawnl(task_id_t *, const char *path, ...); 52 50 53 extern int task_wait(task_id_t id, task_exit_t *, int *); 51 54 extern int task_retval(int); -
uspace/lib/c/include/unistd.h
ra93d79a r8fb1bf82 41 41 42 42 #ifndef NULL 43 #define NULL 043 #define NULL ((void *) 0) 44 44 #endif 45 45 -
uspace/lib/c/include/vfs/vfs.h
ra93d79a r8fb1bf82 47 47 typedef struct { 48 48 fs_handle_t fs_handle; 49 dev _handle_t dev_handle;49 devmap_handle_t devmap_handle; 50 50 fs_index_t index; 51 51 } fdi_node_t;
Note:
See TracChangeset
for help on using the changeset viewer.