Changeset a7811f17 in mainline for uspace/lib/c


Ignore:
Timestamp:
2010-11-19T21:28:02Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a9c6b966
Parents:
45f04f8 (diff), aaa3f33a (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 xxx_ref typedefs removal.

Location:
uspace/lib/c
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/adt/char_map.c

    r45f04f8 ra7811f17  
    6565 */
    6666static int
    67 char_map_add_item(char_map_ref map, const char *identifier, size_t length,
     67char_map_add_item(char_map_t *map, const char *identifier, size_t length,
    6868    const int value)
    6969{
    7070        if (map->next == (map->size - 1)) {
    71                 char_map_ref *tmp;
    72 
    73                 tmp = (char_map_ref *) realloc(map->items,
    74                     sizeof(char_map_ref) * 2 * map->size);
     71                char_map_t **tmp;
     72
     73                tmp = (char_map_t **) realloc(map->items,
     74                    sizeof(char_map_t *) * 2 * map->size);
    7575                if (!tmp)
    7676                        return ENOMEM;
     
    8080        }
    8181
    82         map->items[map->next] = (char_map_ref) malloc(sizeof(char_map_t));
     82        map->items[map->next] = (char_map_t *) malloc(sizeof(char_map_t));
    8383        if (!map->items[map->next])
    8484                return ENOMEM;
     
    110110 * @returns             FALSE otherwise.
    111111 */
    112 static int char_map_is_valid(const char_map_ref map)
     112static int char_map_is_valid(const char_map_t *map)
    113113{
    114114        return map && (map->magic == CHAR_MAP_MAGIC_VALUE);
     
    139139 */
    140140int
    141 char_map_add(char_map_ref map, const char *identifier, size_t length,
     141char_map_add(char_map_t *map, const char *identifier, size_t length,
    142142    const int value)
    143143{
     
    172172 * @param[in,out] map   The character string to integer map.
    173173 */
    174 void char_map_destroy(char_map_ref map)
     174void char_map_destroy(char_map_t *map)
    175175{
    176176        if (char_map_is_valid(map)) {
     
    200200 * @returns             NULL if the key is not assigned a node.
    201201 */
    202 static char_map_ref
    203 char_map_find_node(const char_map_ref map, const char *identifier,
     202static char_map_t *
     203char_map_find_node(const char_map_t *map, const char *identifier,
    204204    size_t length)
    205205{
     
    224224        }
    225225
    226         return map;
     226        return (char_map_t *) map;
    227227}
    228228
     
    242242 * @returns             CHAR_MAP_NULL if the key is not assigned a value.
    243243 */
    244 int char_map_exclude(char_map_ref map, const char *identifier, size_t length)
    245 {
    246         char_map_ref node;
     244int char_map_exclude(char_map_t *map, const char *identifier, size_t length)
     245{
     246        char_map_t *node;
    247247
    248248        node = char_map_find_node(map, identifier, length);
     
    270270 *  @returns            CHAR_MAP_NULL if the key is not assigned a value.
    271271 */
    272 int char_map_find(const char_map_ref map, const char *identifier, size_t length)
    273 {
    274         char_map_ref node;
     272int char_map_find(const char_map_t *map, const char *identifier, size_t length)
     273{
     274        char_map_t *node;
    275275
    276276        node = char_map_find_node(map, identifier, length);
     
    285285 *  @returns            ENOMEM if there is not enough memory left.
    286286 */
    287 int char_map_initialize(char_map_ref map)
     287int char_map_initialize(char_map_t *map)
    288288{
    289289        if (!map)
     
    295295        map->next = 0;
    296296
    297         map->items = malloc(sizeof(char_map_ref) * map->size);
     297        map->items = malloc(sizeof(char_map_t *) * map->size);
    298298        if (!map->items) {
    299299                map->magic = 0;
     
    330330 */
    331331int
    332 char_map_update(char_map_ref map, const char *identifier, const size_t length,
     332char_map_update(char_map_t *map, const char *identifier, const size_t length,
    333333    const int value)
    334334{
    335         char_map_ref node;
     335        char_map_t *node;
    336336
    337337        node = char_map_find_node(map, identifier, length);
  • uspace/lib/c/generic/adt/dynamic_fifo.c

    r45f04f8 ra7811f17  
    5959 * @returns             FALSE otherwise.
    6060 */
    61 static int dyn_fifo_is_valid(dyn_fifo_ref fifo)
     61static int dyn_fifo_is_valid(dyn_fifo_t *fifo)
    6262{
    6363        return fifo && (fifo->magic_value == DYN_FIFO_MAGIC_VALUE);
     
    7373 * @returns             ENOMEM if there is not enough memory left.
    7474 */
    75 int dyn_fifo_initialize(dyn_fifo_ref fifo, int size)
     75int dyn_fifo_initialize(dyn_fifo_t *fifo, int size)
    7676{
    7777        if (!fifo)
     
    104104 * @returns             ENOMEM if there is not enough memory left.
    105105 */
    106 int dyn_fifo_push(dyn_fifo_ref fifo, int value, int max_size)
     106int dyn_fifo_push(dyn_fifo_t *fifo, int value, int max_size)
    107107{
    108108        int *new_items;
     
    154154 * @returns             ENOENT if the queue is empty.
    155155 */
    156 int dyn_fifo_pop(dyn_fifo_ref fifo)
     156int dyn_fifo_pop(dyn_fifo_t *fifo)
    157157{
    158158        int value;
     
    176176 * @returns             ENOENT if the queue is empty.
    177177 */
    178 int dyn_fifo_value(dyn_fifo_ref fifo)
     178int dyn_fifo_value(dyn_fifo_t *fifo)
    179179{
    180180        if (!dyn_fifo_is_valid(fifo))
     
    193193 * @returns             EINVAL if the queue is not valid.
    194194 */
    195 int dyn_fifo_destroy(dyn_fifo_ref fifo)
     195int dyn_fifo_destroy(dyn_fifo_t *fifo)
    196196{
    197197        if (!dyn_fifo_is_valid(fifo))
  • uspace/lib/c/generic/adt/measured_strings.c

    r45f04f8 ra7811f17  
    5858 * @returns             NULL if there is not enough memory left.
    5959 */
    60 measured_string_ref
     60measured_string_t *
    6161measured_string_create_bulk(const char *string, size_t length)
    6262{
    63         measured_string_ref new;
     63        measured_string_t *new;
    6464
    6565        if (length == 0) {
     
    6767                        length++;
    6868        }
    69         new = (measured_string_ref) malloc(sizeof(measured_string_t) +
     69        new = (measured_string_t *) malloc(sizeof(measured_string_t) +
    7070            (sizeof(char) * (length + 1)));
    7171        if (!new)
     
    8888 * @returns             NULL if there is not enough memory left.
    8989 */
    90 measured_string_ref measured_string_copy(measured_string_ref source)
    91 {
    92         measured_string_ref new;
     90measured_string_t *measured_string_copy(measured_string_t *source)
     91{
     92        measured_string_t *new;
    9393
    9494        if (!source)
    9595                return NULL;
    9696
    97         new = (measured_string_ref) malloc(sizeof(measured_string_t));
     97        new = (measured_string_t *) malloc(sizeof(measured_string_t));
    9898        if (new) {
    9999                new->value = (char *) malloc(source->length + 1);
     
    131131 */
    132132int
    133 measured_strings_receive(measured_string_ref *strings, char **data,
     133measured_strings_receive(measured_string_t **strings, char **data,
    134134    size_t count)
    135135{
     
    166166        (*data)[lengths[count] - 1] = '\0';
    167167
    168         *strings = (measured_string_ref) malloc(sizeof(measured_string_t) *
     168        *strings = (measured_string_t *) malloc(sizeof(measured_string_t) *
    169169            count);
    170170        if (!*strings) {
     
    212212 * @returns             NULL if there is not enough memory left.
    213213 */
    214 static size_t *prepare_lengths(const measured_string_ref strings, size_t count)
     214static size_t *prepare_lengths(const measured_string_t *strings, size_t count)
    215215{
    216216        size_t *lengths;
     
    248248 *                      async_data_read_finalize() function.
    249249 */
    250 int measured_strings_reply(const measured_string_ref strings, size_t count)
     250int measured_strings_reply(const measured_string_t *strings, size_t count)
    251251{
    252252        size_t *lengths;
     
    311311 */
    312312int
    313 measured_strings_return(int phone, measured_string_ref *strings, char **data,
     313measured_strings_return(int phone, measured_string_t **strings, char **data,
    314314    size_t count)
    315315{
     
    339339        }
    340340
    341         *strings = (measured_string_ref) malloc(sizeof(measured_string_t) *
     341        *strings = (measured_string_t *) malloc(sizeof(measured_string_t) *
    342342            count);
    343343        if (!*strings) {
     
    385385 */
    386386int
    387 measured_strings_send(int phone, const measured_string_ref strings,
     387measured_strings_send(int phone, const measured_string_t *strings,
    388388    size_t count)
    389389{
  • uspace/lib/c/generic/net/packet.c

    r45f04f8 ra7811f17  
    6464typedef packet_t packet_map_t[PACKET_MAP_SIZE];
    6565
    66 /** Type definition of the packet map page pointer. */
    67 typedef packet_map_t * packet_map_ref;
    68 
    6966/** Packet map.
    7067 * Maps packet identifiers to the packet references.
     
    109106packet_t pm_find(packet_id_t packet_id)
    110107{
    111         packet_map_ref map;
     108        packet_map_t *map;
    112109        packet_t packet;
    113110
     
    140137int pm_add(packet_t packet)
    141138{
    142         packet_map_ref map;
     139        packet_map_t *map;
    143140        int rc;
    144141
     
    154151        } else {
    155152                do {
    156                         map = (packet_map_ref) malloc(sizeof(packet_map_t));
     153                        map = (packet_map_t *) malloc(sizeof(packet_map_t));
    157154                        if (!map) {
    158155                                fibril_rwlock_write_unlock(&pm_globals.lock);
     
    180177        int count;
    181178        int index;
    182         packet_map_ref map;
     179        packet_map_t *map;
    183180        packet_t packet;
    184181
  • uspace/lib/c/generic/net/socket_client.c

    r45f04f8 ra7811f17  
    7979typedef struct socket socket_t;
    8080
    81 /** Type definition of the socket specific data pointer.
    82  * @see socket
    83  */
    84 typedef socket_t *socket_ref;
    85 
    8681/** Socket specific data.
    8782 *
     
    162157
    163158        /** Active sockets. */
    164         sockets_ref sockets;
     159        sockets_t *sockets;
    165160
    166161        /** Safety lock.
     
    185180 *  @returns            The active sockets.
    186181 */
    187 static sockets_ref socket_get_sockets(void)
     182static sockets_t *socket_get_sockets(void)
    188183{
    189184        if (!socket_globals.sockets) {
    190185                socket_globals.sockets =
    191                     (sockets_ref) malloc(sizeof(sockets_t));
     186                    (sockets_t *) malloc(sizeof(sockets_t));
    192187                if (!socket_globals.sockets)
    193188                        return NULL;
     
    213208        ipc_callid_t callid;
    214209        ipc_call_t call;
    215         socket_ref socket;
     210        socket_t *socket;
    216211        int rc;
    217212
     
    332327static int socket_generate_new_id(void)
    333328{
    334         sockets_ref sockets;
     329        sockets_t *sockets;
    335330        int socket_id = 0;
    336331        int count;
     
    372367 */
    373368static void
    374 socket_initialize(socket_ref socket, int socket_id, int phone,
     369socket_initialize(socket_t *socket, int socket_id, int phone,
    375370    services_t service)
    376371{
     
    405400int socket(int domain, int type, int protocol)
    406401{
    407         socket_ref socket;
     402        socket_t *socket;
    408403        int phone;
    409404        int socket_id;
     
    463458
    464459        // create a new socket structure
    465         socket = (socket_ref) malloc(sizeof(socket_t));
     460        socket = (socket_t *) malloc(sizeof(socket_t));
    466461        if (!socket)
    467462                return ENOMEM;
     
    524519    const void *data, size_t datalength)
    525520{
    526         socket_ref socket;
     521        socket_t *socket;
    527522        aid_t message_id;
    528523        ipcarg_t result;
     
    588583int listen(int socket_id, int backlog)
    589584{
    590         socket_ref socket;
     585        socket_t *socket;
    591586        int result;
    592587
     
    627622int accept(int socket_id, struct sockaddr * cliaddr, socklen_t * addrlen)
    628623{
    629         socket_ref socket;
    630         socket_ref new_socket;
     624        socket_t *socket;
     625        socket_t *new_socket;
    631626        aid_t message_id;
    632627        ipcarg_t ipc_result;
     
    661656
    662657        // create a new scoket
    663         new_socket = (socket_ref) malloc(sizeof(socket_t));
     658        new_socket = (socket_t *) malloc(sizeof(socket_t));
    664659        if (!new_socket) {
    665660                fibril_mutex_unlock(&socket->accept_lock);
     
    745740 * @param[in] socket    The socket to be destroyed.
    746741 */
    747 static void socket_destroy(socket_ref socket)
     742static void socket_destroy(socket_t *socket)
    748743{
    749744        int accepted_id;
     
    770765int closesocket(int socket_id)
    771766{
    772         socket_ref socket;
     767        socket_t *socket;
    773768        int rc;
    774769
     
    824819    socklen_t addrlen)
    825820{
    826         socket_ref socket;
     821        socket_t *socket;
    827822        aid_t message_id;
    828823        ipcarg_t result;
     
    981976    int flags, struct sockaddr *fromaddr, socklen_t *addrlen)
    982977{
    983         socket_ref socket;
     978        socket_t *socket;
    984979        aid_t message_id;
    985980        ipcarg_t ipc_result;
     
    11631158getsockopt(int socket_id, int level, int optname, void *value, size_t *optlen)
    11641159{
    1165         socket_ref socket;
     1160        socket_t *socket;
    11661161        aid_t message_id;
    11671162        ipcarg_t result;
  • uspace/lib/c/include/adt/char_map.h

    r45f04f8 ra7811f17  
    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

    r45f04f8 ra7811f17  
    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

    r45f04f8 ra7811f17  
    5555        \
    5656        typedef struct name name##_t; \
    57         typedef name##_t *name##_ref; \
    5857        \
    5958        struct  name { \
     
    6362        }; \
    6463        \
    65         int name##_add(name##_ref, const char *, const size_t, type *); \
    66         int name##_count(name##_ref); \
    67         void name##_destroy(name##_ref); \
    68         void name##_exclude(name##_ref, const char *, const size_t); \
    69         type *name##_find(name##_ref, const char *, const size_t); \
    70         int name##_initialize(name##_ref); \
    71         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 *);
    7271
    7372/** Character string to generic type map implementation.
     
    8180        GENERIC_FIELD_IMPLEMENT(name##_items, type) \
    8281        \
    83         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, \
    8483             type *value) \
    8584        { \
     
    9998        } \
    10099        \
    101         int name##_count(name##_ref map) \
     100        int name##_count(name##_t *map) \
    102101        { \
    103102                return name##_is_valid(map) ? \
     
    105104        } \
    106105        \
    107         void name##_destroy(name##_ref map) \
     106        void name##_destroy(name##_t *map) \
    108107        { \
    109108                if (name##_is_valid(map)) { \
     
    113112        } \
    114113        \
    115         void name##_exclude(name##_ref map, const char *name, \
     114        void name##_exclude(name##_t *map, const char *name, \
    116115            const size_t length) \
    117116        { \
     
    125124        } \
    126125        \
    127         type *name##_find(name##_ref map, const char *name, \
     126        type *name##_find(name##_t *map, const char *name, \
    128127            const size_t length) \
    129128        { \
     
    138137        } \
    139138        \
    140         int name##_initialize(name##_ref map) \
     139        int name##_initialize(name##_t *map) \
    141140        { \
    142141                int rc; \
     
    155154        } \
    156155        \
    157         int name##_is_valid(name##_ref map) \
     156        int name##_is_valid(name##_t *map) \
    158157        { \
    159158                return map && (map->magic == GENERIC_CHAR_MAP_MAGIC_VALUE); \
  • uspace/lib/c/include/adt/generic_field.h

    r45f04f8 ra7811f17  
    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

    r45f04f8 ra7811f17  
    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

    r45f04f8 ra7811f17  
    4747typedef struct measured_string measured_string_t;
    4848
    49 /** Type definition of the character string with measured length pointer.
    50  * @see measured_string
    51  */
    52 typedef measured_string_t *measured_string_ref;
    53 
    5449/** Character string with measured length.
    5550 *
     
    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/net/device.h

    r45f04f8 ra7811f17  
    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/packet.h

    r45f04f8 ra7811f17  
    4848typedef struct packet * packet_t;
    4949
    50 /** Type definition of the packet pointer.
    51  * @see packet
    52  */
    53 typedef packet_t * packet_ref;
    54 
    5550/** Type definition of the packet dimension.
    5651 * @see 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. */
Note: See TracChangeset for help on using the changeset viewer.