Changeset 8fb1bf82 in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2010-11-25T13:42:50Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
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.
Message:

Merge mainline changes.

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  
    4848typedef struct char_map char_map_t;
    4949
    50 /** Type definition of the character string to integer map pointer.
    51  *  @see char_map
    52  */
    53 typedef char_map_t *char_map_ref;
    54 
    5550/** Character string to integer map item.
    5651 *
     
    6964        int next;
    7065        /** Next character array. */
    71         char_map_ref *items;
     66        char_map_t **items;
    7267        /** Consistency check magic value. */
    7368        int magic;
    7469};
    7570
    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);
     71extern int char_map_initialize(char_map_t *);
     72extern void char_map_destroy(char_map_t *);
     73extern int char_map_exclude(char_map_t *, const char *, size_t);
     74extern int char_map_add(char_map_t *, const char *, size_t, const int);
     75extern int char_map_find(const char_map_t *, const char *, size_t);
     76extern int char_map_update(char_map_t *, const char *, size_t, const int);
    8277
    8378#endif
  • uspace/lib/c/include/adt/dynamic_fifo.h

    ra93d79a r8fb1bf82  
    4444typedef struct dyn_fifo dyn_fifo_t;
    4545
    46 /** Type definition of the dynamic fifo queue pointer.
    47  *  @see dyn_fifo
    48  */
    49 typedef dyn_fifo_t *dyn_fifo_ref;
    50 
    5146/** Dynamic first in first out positive integer queue.
    5247 * Possitive integer values only.
     
    6661};
    6762
    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);
     63extern int dyn_fifo_initialize(dyn_fifo_t *, int);
     64extern int dyn_fifo_destroy(dyn_fifo_t *);
     65extern int dyn_fifo_push(dyn_fifo_t *, int, int);
     66extern int dyn_fifo_pop(dyn_fifo_t *);
     67extern int dyn_fifo_value(dyn_fifo_t *);
    7368
    7469#endif
  • uspace/lib/c/include/adt/generic_char_map.h

    ra93d79a r8fb1bf82  
    4040#include <unistd.h>
    4141#include <errno.h>
    42 #include <err.h>
    4342
    4443#include <adt/char_map.h>
     
    5655        \
    5756        typedef struct name name##_t; \
    58         typedef name##_t *name##_ref; \
    5957        \
    6058        struct  name { \
     
    6462        }; \
    6563        \
    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 *);
    7371
    7472/** Character string to generic type map implementation.
     
    8280        GENERIC_FIELD_IMPLEMENT(name##_items, type) \
    8381        \
    84         int name##_add(name##_ref map, const char *name, const size_t length, \
     82        int name##_add(name##_t *map, const char *name, const size_t length, \
    8583             type *value) \
    8684        { \
    87                 ERROR_DECLARE; \
     85                int rc; \
    8886                int index; \
    8987                if (!name##_is_valid(map)) \
     
    9290                if (index < 0) \
    9391                        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) { \
    9694                        name##_items_exclude_index(&map->values, index); \
    97                         return ERROR_CODE; \
     95                        return rc; \
    9896                } \
    9997                return EOK; \
    10098        } \
    10199        \
    102         int name##_count(name##_ref map) \
     100        int name##_count(name##_t *map) \
    103101        { \
    104102                return name##_is_valid(map) ? \
     
    106104        } \
    107105        \
    108         void name##_destroy(name##_ref map) \
     106        void name##_destroy(name##_t *map) \
    109107        { \
    110108                if (name##_is_valid(map)) { \
     
    114112        } \
    115113        \
    116         void name##_exclude(name##_ref map, const char *name, \
     114        void name##_exclude(name##_t *map, const char *name, \
    117115            const size_t length) \
    118116        { \
     
    126124        } \
    127125        \
    128         type *name##_find(name##_ref map, const char *name, \
     126        type *name##_find(name##_t *map, const char *name, \
    129127            const size_t length) \
    130128        { \
     
    139137        } \
    140138        \
    141         int name##_initialize(name##_ref map) \
     139        int name##_initialize(name##_t *map) \
    142140        { \
    143                 ERROR_DECLARE; \
     141                int rc; \
    144142                if (!map) \
    145143                        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) { \
    148149                        char_map_destroy(&map->names); \
    149                         return ERROR_CODE; \
     150                        return rc; \
    150151                } \
    151152                map->magic = GENERIC_CHAR_MAP_MAGIC_VALUE; \
     
    153154        } \
    154155        \
    155         int name##_is_valid(name##_ref map) \
     156        int name##_is_valid(name##_t *map) \
    156157        { \
    157158                return map && (map->magic == GENERIC_CHAR_MAP_MAGIC_VALUE); \
  • uspace/lib/c/include/adt/generic_field.h

    ra93d79a r8fb1bf82  
    5353#define GENERIC_FIELD_DECLARE(name, type) \
    5454        typedef struct name name##_t; \
    55         typedef name##_t *name##_ref; \
    5655        \
    5756        struct  name { \
     
    6261        }; \
    6362        \
    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 *);
    7271
    7372/** Generic type field implementation.
     
    7978 */
    8079#define GENERIC_FIELD_IMPLEMENT(name, type) \
    81         int name##_add(name##_ref field, type *value) \
     80        int name##_add(name##_t *field, type *value) \
    8281        { \
    8382                if (name##_is_valid(field)) { \
     
    9998        } \
    10099        \
    101         int name##_count(name##_ref field) \
     100        int name##_count(name##_t *field) \
    102101        { \
    103102                return name##_is_valid(field) ? field->next : -1; \
    104103        } \
    105104        \
    106         void name##_destroy(name##_ref field) \
     105        void name##_destroy(name##_t *field) \
    107106        { \
    108107                if (name##_is_valid(field)) { \
     
    117116        } \
    118117         \
    119         void name##_exclude_index(name##_ref field, int index) \
     118        void name##_exclude_index(name##_t *field, int index) \
    120119        { \
    121120                if (name##_is_valid(field) && (index >= 0) && \
     
    126125        } \
    127126         \
    128         type *name##_get_index(name##_ref field, int index) \
     127        type *name##_get_index(name##_t *field, int index) \
    129128        { \
    130129                if (name##_is_valid(field) && (index >= 0) && \
     
    134133        } \
    135134        \
    136         type **name##_get_field(name##_ref field) \
     135        type **name##_get_field(name##_t *field) \
    137136        { \
    138137                return name##_is_valid(field) ? field->items : NULL; \
    139138        } \
    140139        \
    141         int name##_initialize(name##_ref field) \
     140        int name##_initialize(name##_t *field) \
    142141        { \
    143142                if (!field) \
     
    153152        } \
    154153        \
    155         int name##_is_valid(name##_ref field) \
     154        int name##_is_valid(name##_t *field) \
    156155        { \
    157156                return field && (field->magic == GENERIC_FIELD_MAGIC_VALUE); \
  • uspace/lib/c/include/adt/int_map.h

    ra93d79a r8fb1bf82  
    5656#define INT_MAP_DECLARE(name, type) \
    5757        typedef struct name name##_t; \
    58         typedef name##_t *name##_ref; \
    5958        typedef struct name##_item name##_item_t; \
    60         typedef name##_item_t *name##_item_ref; \
    6159        \
    6260        struct  name##_item { \
     
    6967                int size; \
    7068                int next; \
    71                 name##_item_ref items; \
     69                name##_item_t *items; \
    7270                int magic; \
    7371        }; \
    7472        \
    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 *);
    8886
    8987/** Integer to generic type map implementation.
     
    9593 */
    9694#define INT_MAP_IMPLEMENT(name, type) \
    97         int name##_add(name##_ref map, int key, type *value) \
     95        int name##_add(name##_t *map, int key, type *value) \
    9896        { \
    9997                if (name##_is_valid(map)) { \
    10098                        if (map->next == (map->size - 1)) { \
    101                                 name##_item_ref tmp; \
    102                                 tmp = (name##_item_ref) realloc(map->items, \
     99                                name##_item_t *tmp; \
     100                                tmp = (name##_item_t *) realloc(map->items, \
    103101                                    sizeof(name##_item_t) * 2 * map->size); \
    104102                                if (!tmp) \
     
    117115        } \
    118116        \
    119         void name##_clear(name##_ref map) \
     117        void name##_clear(name##_t *map) \
    120118        { \
    121119                if (name##_is_valid(map)) { \
     
    132130        } \
    133131        \
    134         int name##_count(name##_ref map) \
     132        int name##_count(name##_t *map) \
    135133        { \
    136134                return name##_is_valid(map) ? map->next : -1; \
    137135        } \
    138136        \
    139         void name##_destroy(name##_ref map) \
     137        void name##_destroy(name##_t *map) \
    140138        { \
    141139                if (name##_is_valid(map)) { \
     
    152150        } \
    153151        \
    154         void name##_exclude(name##_ref map, int key) \
     152        void name##_exclude(name##_t *map, int key) \
    155153        { \
    156154                if (name##_is_valid(map)) { \
     
    166164        } \
    167165        \
    168         void name##_exclude_index(name##_ref map, int index) \
     166        void name##_exclude_index(name##_t *map, int index) \
    169167        { \
    170168                if (name##_is_valid(map) && (index >= 0) && \
     
    175173        } \
    176174        \
    177         type *name##_find(name##_ref map, int key) \
     175        type *name##_find(name##_t *map, int key) \
    178176        { \
    179177                if (name##_is_valid(map)) { \
     
    189187        } \
    190188        \
    191         int name##_update(name##_ref map, int key, int new_key) \
     189        int name##_update(name##_t *map, int key, int new_key) \
    192190        { \
    193191                if (name##_is_valid(map)) { \
     
    208206        } \
    209207        \
    210         type *name##_get_index(name##_ref map, int index) \
     208        type *name##_get_index(name##_t *map, int index) \
    211209        { \
    212210                if (name##_is_valid(map) && (index >= 0) && \
     
    218216        } \
    219217        \
    220         int name##_initialize(name##_ref map) \
     218        int name##_initialize(name##_t *map) \
    221219        { \
    222220                if (!map) \
     
    224222                map->size = 2; \
    225223                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) * \
    227225                    map->size); \
    228226                if (!map->items) \
     
    233231        } \
    234232        \
    235         int name##_is_valid(name##_ref map) \
     233        int name##_is_valid(name##_t *map) \
    236234        { \
    237235                return map && (map->magic == INT_MAP_MAGIC_VALUE); \
    238236        } \
    239237        \
    240         void name##_item_destroy(name##_item_ref item) \
     238        void name##_item_destroy(name##_item_t *item) \
    241239        { \
    242240                if (name##_item_is_valid(item)) { \
     
    249247        } \
    250248        \
    251         int name##_item_is_valid(name##_item_ref item) \
     249        int name##_item_is_valid(name##_item_t *item) \
    252250        { \
    253251                return item && (item->magic == INT_MAP_ITEM_MAGIC_VALUE); \
  • uspace/lib/c/include/adt/measured_strings.h

    ra93d79a r8fb1bf82  
    4343
    4444/** Type definition of the character string with measured length.
    45  *  @see measured_string
     45 * @see measured_string
    4646 */
    4747typedef struct measured_string measured_string_t;
    48 
    49 /** Type definition of the character string with measured length pointer.
    50  *  @see measured_string
    51  */
    52 typedef measured_string_t *measured_string_ref;
    5348
    5449/** Character string with measured length.
     
    5954struct measured_string {
    6055        /** Character string data. */
    61         char * value;
     56        char *value;
    6257        /** Character string length. */
    6358        size_t length;
    6459};
    6560
    66 extern measured_string_ref measured_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);
     61extern measured_string_t *measured_string_create_bulk(const char *, size_t);
     62extern measured_string_t *measured_string_copy(measured_string_t *);
     63extern int measured_strings_receive(measured_string_t **, char **, size_t);
     64extern int measured_strings_reply(const measured_string_t *, size_t);
     65extern int measured_strings_return(int, measured_string_t **, char **, size_t);
     66extern int measured_strings_send(int, const measured_string_t *, size_t);
    7267
    7368#endif
  • uspace/lib/c/include/ddi.h

    ra93d79a r8fb1bf82  
    4242extern int iospace_enable(task_id_t, void *, unsigned long);
    4343extern int pio_enable(void *, size_t, void **);
     44extern int interrupt_enable(int);
     45extern int interrupt_disable(int);
    4446
    4547#endif
  • uspace/lib/c/include/device/char.h

    ra93d79a r8fb1bf82  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2010 Lenka Trochtova
    33 * All rights reserved.
    44 *
     
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 
    29 /** @addtogroup packet
    30  *  @{
     28 
     29 /** @addtogroup libc
     30 * @{
    3131 */
    32 
    3332/** @file
    3433 */
     34 
     35#ifndef LIBC_DEVICE_HW_RES_H_
     36#define LIBC_DEVICE_HW_RES_H_
    3537
    36 #ifndef __NET_PACKET_LOCAL_H__
    37 #define __NET_PACKET_LOCAL_H__
     38typedef enum {
     39        CHAR_READ_DEV = 0,
     40        CHAR_WRITE_DEV 
     41} hw_res_funcs_t;
    3842
    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 /*@}*/
     43int read_dev(int dev_phone, void *buf, size_t len);
     44int write_dev(int dev_phone, void *buf, size_t len);
    5145
    5246#endif
  • uspace/lib/c/include/devman.h

    ra93d79a r8fb1bf82  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2009 Jiri Svoboda
     3 * Copyright (c) 2010 Lenka Trochtova
    34 * All rights reserved.
    45 *
     
    2728 */
    2829
    29 /** @addtogroup ip
     30/** @addtogroup libc
    3031 * @{
    3132 */
     33/** @file
     34 */
    3235
    33 #ifndef NET_IP_LOCAL_H_
    34 #define NET_IP_LOCAL_H_
     36#ifndef LIBC_DEVMAN_H_
     37#define LIBC_DEVMAN_H_
    3538
     39#include <ipc/devman.h>
    3640#include <async.h>
    37 #include <ipc/services.h>
     41#include <bool.h>
    3842
    39 #include <net/ip_codes.h>
    40 #include <net/inet.h>
    41 #include <net/in.h>
    4243
    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 *);
     44extern int devman_get_phone(devman_interface_t, unsigned int);
     45extern void devman_hangup_phone(devman_interface_t);
     46
     47extern int devman_driver_register(const char *, async_client_conn_t);
     48extern int devman_child_device_register(const char *, match_id_list_t *,
     49    devman_handle_t, devman_handle_t *);
     50
     51extern int devman_device_connect(devman_handle_t, unsigned int);
     52extern int devman_parent_device_connect(devman_handle_t, unsigned int);
     53
     54extern int devman_device_get_handle(const char *, devman_handle_t *,
     55    unsigned int);
     56
     57extern int devman_add_device_to_class(devman_handle_t, const char *);
    5658
    5759#endif
  • uspace/lib/c/include/devmap.h

    ra93d79a r8fb1bf82  
    4444
    4545extern int devmap_driver_register(const char *, async_client_conn_t);
    46 extern int devmap_device_register(const char *, dev_handle_t *);
     46extern int devmap_device_register(const char *, devmap_handle_t *);
    4747
    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);
     48extern int devmap_device_get_handle(const char *, devmap_handle_t *, unsigned int);
     49extern int devmap_namespace_get_handle(const char *, devmap_handle_t *, unsigned int);
     50extern devmap_handle_type_t devmap_handle_probe(devmap_handle_t);
    5151
    52 extern int devmap_device_connect(dev_handle_t, unsigned int);
     52extern int devmap_device_connect(devmap_handle_t, unsigned int);
    5353
    5454extern int devmap_null_create(void);
     
    5656
    5757extern size_t devmap_count_namespaces(void);
    58 extern size_t devmap_count_devices(dev_handle_t);
     58extern size_t devmap_count_devices(devmap_handle_t);
    5959
    6060extern size_t devmap_get_namespaces(dev_desc_t **);
    61 extern size_t devmap_get_devices(dev_handle_t, dev_desc_t **);
     61extern size_t devmap_get_devices(devmap_handle_t, dev_desc_t **);
    6262
    6363#endif
  • uspace/lib/c/include/err.h

    ra93d79a r8fb1bf82  
    3737
    3838#include <stdio.h>
    39 #include <errno.h>
    40 
    41 #ifdef CONFIG_DEBUG
    42 #include <str_error.h>
    43 #endif
    4439
    4540#define errx(status, fmt, ...) { \
     
    4843}
    4944
    50 
    51 /** An actual stored error code.  */
    52 #define ERROR_CODE  error_check_return_value
    53 
    54 /** An error processing routines declaration.
    55  *
    56  * This has to be declared in the block where the error processing
    57  * is desired.
    58  */
    59 #define ERROR_DECLARE  int ERROR_CODE
    60 
    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_DEBUG
    68 
    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 #else
    78 
    79 #define ERROR_OCCURRED(value)   ((ERROR_CODE = (value)) != EOK)
    80 
    81 #endif
    82 
    83 #define ERROR_NONE(value)       !ERROR_OCCURRED((value))
    84 
    85 /** Error propagation
    86  *
    87  * Check if an error occurred and immediately exit the actual
    88  * 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_CODE
    97 
    9845#endif
    9946
    10047/** @}
    10148 */
     49
  • uspace/lib/c/include/fibril.h

    ra93d79a r8fb1bf82  
    4848#define FIBRIL_WRITER      2
    4949
     50struct fibril;
     51
     52typedef struct {
     53        struct fibril *owned_by;
     54} fibril_owner_info_t;
     55
    5056typedef enum {
    5157        FIBRIL_PREEMPT,
     
    6874        int retval;
    6975        int flags;
     76
     77        fibril_owner_info_t *waits_for;
    7078} fibril_t;
    7179
  • uspace/lib/c/include/fibril_synch.h

    ra93d79a r8fb1bf82  
    4343
    4444typedef struct {
     45        fibril_owner_info_t oi;         /* Keep this the first thing. */
    4546        int counter;
    4647        link_t waiters;
     
    4950#define FIBRIL_MUTEX_INITIALIZER(name) \
    5051        { \
     52                .oi = { \
     53                        .owned_by = NULL \
     54                }, \
    5155                .counter = 1, \
    5256                .waiters = { \
     
    6064
    6165typedef struct {
     66        fibril_owner_info_t oi; /* Keep this the first thing. */
    6267        unsigned writers;
    6368        unsigned readers;
     
    6772#define FIBRIL_RWLOCK_INITIALIZER(name) \
    6873        { \
     74                .oi = { \
     75                        .owned_by = NULL \
     76                }, \
    6977                .readers = 0, \
    7078                .writers = 0, \
  • uspace/lib/c/include/ipc/devmap.h

    ra93d79a r8fb1bf82  
    4040#define DEVMAP_NAME_MAXLEN  255
    4141
    42 typedef ipcarg_t dev_handle_t;
     42typedef ipcarg_t devmap_handle_t;
    4343
    4444typedef enum {
     
    8181
    8282typedef struct {
    83         dev_handle_t handle;
     83        devmap_handle_t handle;
    8484        char name[DEVMAP_NAME_MAXLEN + 1];
    8585} dev_desc_t;
  • uspace/lib/c/include/ipc/services.h

    ra93d79a r8fb1bf82  
    3939
    4040typedef enum {
    41         SERVICE_LOAD = 1,
     41        SERVICE_NONE = 0,
     42        SERVICE_LOAD,
    4243        SERVICE_PCI,
    4344        SERVICE_VIDEO,
     
    4546        SERVICE_VFS,
    4647        SERVICE_DEVMAP,
     48        SERVICE_DEVMAN,
    4749        SERVICE_FHC,
    4850        SERVICE_OBIO,
  • uspace/lib/c/include/net/device.h

    ra93d79a r8fb1bf82  
    5959 */
    6060typedef struct device_stats device_stats_t;
    61 
    62 /** Type definition of the device usage statistics pointer.
    63  * @see device_stats
    64  */
    65 typedef device_stats_t *device_stats_ref;
    6661
    6762/** Device state. */
  • uspace/lib/c/include/net/icmp_codes.h

    ra93d79a r8fb1bf82  
    4242#define LIBC_ICMP_CODES_H_
    4343
     44#include <sys/types.h>
     45
    4446/** ICMP type type definition. */
    4547typedef uint8_t icmp_type_t;
  • uspace/lib/c/include/net/modules.h

    ra93d79a r8fb1bf82  
    6969 *
    7070 * @param[in] need      The needed module service.
    71  * @returns             The phone of the needed service.
     71 * @return              The phone of the needed service.
    7272 */
    7373typedef int connect_module_t(services_t need);
  • uspace/lib/c/include/net/packet.h

    ra93d79a r8fb1bf82  
    4646 * @see packet
    4747 */
    48 typedef struct packet * packet_t;
    49 
    50 /** Type definition of the packet pointer.
    51  * @see packet
    52  */
    53 typedef packet_t * packet_ref;
     48typedef struct packet packet_t;
    5449
    5550/** Type definition of the packet dimension.
     
    5752 */
    5853typedef struct packet_dimension packet_dimension_t;
    59 
    60 /** Type definition of the packet dimension pointer.
    61  * @see packet_dimension
    62  */
    63 typedef packet_dimension_t * packet_dimension_ref;
    6454
    6555/** Packet dimension. */
     
    7969/*@{*/
    8070
    81 extern packet_t pm_find(packet_id_t);
    82 extern int pm_add(packet_t);
     71extern packet_t *pm_find(packet_id_t);
     72extern int pm_add(packet_t *);
    8373extern int pm_init(void);
    8474extern void pm_destroy(void);
    8575
    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);
     76extern int pq_add(packet_t **, packet_t *, size_t, size_t);
     77extern packet_t *pq_find(packet_t *, size_t);
     78extern int pq_insert_after(packet_t *, packet_t *);
     79extern packet_t *pq_detach(packet_t *);
     80extern int pq_set_order(packet_t *, size_t, size_t);
     81extern int pq_get_order(packet_t *, size_t *, size_t *);
     82extern void pq_destroy(packet_t *, void (*)(packet_t *));
     83extern packet_t *pq_next(packet_t *);
     84extern packet_t *pq_previous(packet_t *);
    9585
    9686/*@}*/
  • uspace/lib/c/include/net/packet_header.h

    ra93d79a r8fb1bf82  
    124124/** Returns whether the packet is valid.
    125125 * @param[in] packet    The packet to be checked.
    126  * @returns             True if the packet is not NULL and the magic value is
     126 * @return              True if the packet is not NULL and the magic value is
    127127 *                      correct.
    128  * @returns             False otherwise.
     128 * @return              False otherwise.
    129129 */
    130 static inline int packet_is_valid(const packet_t packet)
     130static inline int packet_is_valid(const packet_t *packet)
    131131{
    132132        return packet && (packet->magic_value == PACKET_MAGIC_VALUE);
  • uspace/lib/c/include/stdio.h

    ra93d79a r8fb1bf82  
    4646#define BUFSIZ  4096
    4747
    48 #define DEBUG(fmt, ...)se\
     48#define DEBUG(fmt, ...) \
    4949        { \
    5050                char _buf[256]; \
  • uspace/lib/c/include/sys/stat.h

    ra93d79a r8fb1bf82  
    4343struct stat {
    4444        fs_handle_t fs_handle;
    45         dev_handle_t dev_handle;
     45        devmap_handle_t devmap_handle;
    4646        fs_index_t index;
    4747        unsigned int lnkcnt;
     
    4949        bool is_directory;
    5050        aoff64_t size;
    51         dev_handle_t device;
     51        devmap_handle_t device;
    5252};
    5353
  • uspace/lib/c/include/task.h

    ra93d79a r8fb1bf82  
    4848extern int task_set_name(const char *);
    4949extern task_id_t task_spawn(const char *, const char *const[], int *);
     50extern int task_spawnv(task_id_t *, const char *path, const char *const []);
     51extern int task_spawnl(task_id_t *, const char *path, ...);
     52
    5053extern int task_wait(task_id_t id, task_exit_t *, int *);
    5154extern int task_retval(int);
  • uspace/lib/c/include/unistd.h

    ra93d79a r8fb1bf82  
    4141
    4242#ifndef NULL
    43         #define NULL  0
     43        #define NULL    ((void *) 0)
    4444#endif
    4545
  • uspace/lib/c/include/vfs/vfs.h

    ra93d79a r8fb1bf82  
    4747typedef struct {
    4848        fs_handle_t fs_handle;
    49         dev_handle_t dev_handle;
     49        devmap_handle_t devmap_handle;
    5050        fs_index_t index;
    5151} fdi_node_t;
Note: See TracChangeset for help on using the changeset viewer.