Changeset c5b59ce in mainline


Ignore:
Timestamp:
2010-09-26T12:28:09Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7390870
Parents:
e98b1d5
Message:

Integrate net_err.h into the standard library's err.h.

Location:
uspace
Files:
1 deleted
35 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/netecho/netecho.c

    re98b1d5 rc5b59ce  
    4141#include <task.h>
    4242#include <arg_parse.h>
     43#include <err.h>
    4344
    4445#include <in.h>
     
    4647#include <inet.h>
    4748#include <socket.h>
    48 #include <net_err.h>
    4949#include <socket_parse.h>
    5050
  • uspace/app/nettest1/nettest.c

    re98b1d5 rc5b59ce  
    3636
    3737#include <stdio.h>
     38#include <err.h>
    3839
    3940#include <socket.h>
    40 #include <net_err.h>
    4141
    4242#include "nettest.h"
  • uspace/app/nettest1/nettest1.c

    re98b1d5 rc5b59ce  
    4141#include <time.h>
    4242#include <arg_parse.h>
     43#include <err.h>
    4344
    4445#include <in.h>
     
    4647#include <inet.h>
    4748#include <socket.h>
    48 #include <net_err.h>
    4949#include <socket_parse.h>
    5050
  • uspace/app/nettest2/nettest2.c

    re98b1d5 rc5b59ce  
    4141#include <time.h>
    4242#include <arg_parse.h>
     43#include <err.h>
    4344
    4445#include <in.h>
     
    4647#include <inet.h>
    4748#include <socket.h>
    48 #include <net_err.h>
    4949#include <socket_parse.h>
    5050
  • uspace/lib/c/include/err.h

    re98b1d5 rc5b59ce  
    3636#define LIBC_ERR_H_
    3737
     38#include <stdio.h>
     39#include <errno.h>
     40
     41#ifdef CONFIG_DEBUG
     42#include <str_error.h>
     43#endif
     44
    3845#define errx(status, fmt, ...) { \
    3946        printf((fmt), ##__VA_ARGS__); \
     
    4148}
    4249
     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
    4398#endif
    4499
  • uspace/lib/net/adt/module_map.c

    re98b1d5 rc5b59ce  
    3838#include <task.h>
    3939#include <unistd.h>
     40#include <err.h>
    4041
    4142#include <ipc/services.h>
    4243
    43 #include <net_err.h>
    4444#include <net_modules.h>
    4545
  • uspace/lib/net/generic/packet_remote.c

    re98b1d5 rc5b59ce  
    3838#include <async.h>
    3939#include <errno.h>
     40#include <err.h>
    4041#include <ipc/ipc.h>
    4142#include <sys/mman.h>
    4243
    43 #include <net_err.h>
    4444#include <net_messages.h>
    4545#include <packet/packet.h>
  • uspace/lib/net/include/netif_local.h

    re98b1d5 rc5b59ce  
    4444#include <ipc/ipc.h>
    4545#include <ipc/services.h>
     46#include <err.h>
    4647
    4748#include <adt/measured_strings.h>
    48 #include <net_err.h>
    4949#include <net_device.h>
    5050#include <packet/packet.h>
  • uspace/lib/net/netif/netif_local.c

    re98b1d5 rc5b59ce  
    4242#include <ipc/ipc.h>
    4343#include <ipc/services.h>
    44 
    45 #include <net_err.h>
     44#include <err.h>
     45
    4646#include <net_messages.h>
    4747#include <net_modules.h>
  • uspace/lib/net/tl/tl_common.c

    re98b1d5 rc5b59ce  
    3939#include <ipc/services.h>
    4040#include <errno.h>
    41 
    42 #include <net_err.h>
     41#include <err.h>
     42
    4343#include <packet/packet.h>
    4444#include <packet/packet_client.h>
  • uspace/lib/socket/adt/measured_strings.c

    re98b1d5 rc5b59ce  
    3636 */
    3737
    38 #include <errno.h>
    3938#include <malloc.h>
    4039#include <mem.h>
    4140#include <unistd.h>
     41#include <errno.h>
     42#include <err.h>
    4243
    4344#include <ipc/ipc.h>
    4445
    45 #include <net_err.h>
    4646#include <net_modules.h>
    4747#include <adt/measured_strings.h>
  • uspace/lib/socket/generic/net_modules.c

    re98b1d5 rc5b59ce  
    3737#include <async.h>
    3838#include <malloc.h>
     39#include <err.h>
    3940
    4041#include <ipc/ipc.h>
     
    4344#include <sys/time.h>
    4445
    45 #include <net_err.h>
    4646#include <net_modules.h>
    4747
  • uspace/lib/socket/generic/socket_client.c

    re98b1d5 rc5b59ce  
    4343#include <stdlib.h>
    4444#include <errno.h>
     45#include <err.h>
    4546
    4647#include <ipc/services.h>
    4748
    48 #include <net_err.h>
    4949#include <net_modules.h>
    5050#include <in.h>
  • uspace/lib/socket/generic/socket_core.c

    re98b1d5 rc5b59ce  
    3838#include <stdlib.h>
    3939#include <errno.h>
    40 
    41 #include <net_err.h>
     40#include <err.h>
     41
    4242#include <in.h>
    4343#include <inet.h>
  • uspace/lib/socket/include/adt/generic_char_map.h

    re98b1d5 rc5b59ce  
    3838#define __GENERIC_CHAR_MAP_H__
    3939
     40#include <unistd.h>
    4041#include <errno.h>
    41 #include <unistd.h>
    42 
    43 #include <net_err.h>
     42#include <err.h>
    4443
    4544#include <adt/char_map.h>
  • uspace/lib/socket/packet/packet.c

    re98b1d5 rc5b59ce  
    3636 */
    3737
    38 #include <errno.h>
    3938#include <malloc.h>
    4039#include <mem.h>
    4140#include <fibril_synch.h>
    4241#include <unistd.h>
     42#include <errno.h>
     43#include <err.h>
    4344
    4445#include <sys/mman.h>
    4546
    46 #include <net_err.h>
    4747#include <adt/generic_field.h>
    4848#include <packet/packet.h>
  • uspace/lib/socket/packet/packet_server.c

    re98b1d5 rc5b59ce  
    3939#include <async.h>
    4040#include <errno.h>
     41#include <err.h>
    4142#include <fibril_synch.h>
    4243#include <unistd.h>
     
    4546#include <sys/mman.h>
    4647
    47 #include <net_err.h>
    4848#include <net_messages.h>
    4949#include <packet/packet.h>
  • uspace/srv/hw/netif/dp8390/dp8390_module.c

    re98b1d5 rc5b59ce  
    3939#include <ddi.h>
    4040#include <errno.h>
     41#include <err.h>
    4142#include <malloc.h>
    4243#include <ipc/ipc.h>
    4344#include <ipc/services.h>
    4445
    45 #include <net_err.h>
    4646#include <net_messages.h>
    4747#include <net_modules.h>
  • uspace/srv/net/il/arp/arp.c

    re98b1d5 rc5b59ce  
    4545#include <ipc/ipc.h>
    4646#include <ipc/services.h>
    47 
    48 #include <net_err.h>
     47#include <err.h>
     48
    4949#include <net_messages.h>
    5050#include <net_modules.h>
  • uspace/srv/net/il/arp/arp_module.c

    re98b1d5 rc5b59ce  
    4040#include <async.h>
    4141#include <stdio.h>
     42#include <err.h>
    4243
    4344#include <ipc/ipc.h>
    4445#include <ipc/services.h>
    4546
    46 #include <net_err.h>
    4747#include <net_modules.h>
    4848#include <net_interface.h>
  • uspace/srv/net/il/ip/ip.c

    re98b1d5 rc5b59ce  
    3838#include <async.h>
    3939#include <errno.h>
     40#include <err.h>
    4041#include <fibril_synch.h>
    4142#include <stdio.h>
     
    4546#include <sys/types.h>
    4647
    47 #include <net_err.h>
    4848#include <net_messages.h>
    4949#include <net_modules.h>
  • uspace/srv/net/il/ip/ip_module.c

    re98b1d5 rc5b59ce  
    4242#include <ipc/ipc.h>
    4343#include <ipc/services.h>
     44#include <err.h>
    4445
    45 #include <net_err.h>
    4646#include <net_modules.h>
    4747#include <net_interface.h>
  • uspace/srv/net/net/net.c

    re98b1d5 rc5b59ce  
    4040#include <ddi.h>
    4141#include <errno.h>
     42#include <err.h>
    4243#include <malloc.h>
    4344#include <stdio.h>
     
    4748#include <ipc/services.h>
    4849
    49 #include <net_err.h>
    5050#include <net_messages.h>
    5151#include <net_modules.h>
  • uspace/srv/net/netif/lo/lo.c

    re98b1d5 rc5b59ce  
    3737#include <async.h>
    3838#include <errno.h>
     39#include <err.h>
    3940#include <stdio.h>
    4041#include <str.h>
     
    4344#include <ipc/services.h>
    4445
    45 #include <net_err.h>
    4646#include <net_messages.h>
    4747#include <net_modules.h>
  • uspace/srv/net/netstart/netstart.c

    re98b1d5 rc5b59ce  
    4545#include <task.h>
    4646#include <str_error.h>
     47#include <err.h>
    4748#include <ipc/ipc.h>
    4849#include <ipc/services.h>
    4950
    50 #include <net_err.h>
    5151#include <net_modules.h>
    5252#include <net_net_messages.h>
  • uspace/srv/net/nil/eth/eth.c

    re98b1d5 rc5b59ce  
    4141#include <stdio.h>
    4242#include <str.h>
     43#include <err.h>
    4344
    4445#include <ipc/ipc.h>
    4546#include <ipc/services.h>
    4647
    47 #include <net_err.h>
    4848#include <net_messages.h>
    4949#include <net_modules.h>
  • uspace/srv/net/nil/eth/eth_module.c

    re98b1d5 rc5b59ce  
    3838#include <async.h>
    3939#include <stdio.h>
     40#include <err.h>
    4041
    4142#include <ipc/ipc.h>
    4243#include <ipc/services.h>
    4344
    44 #include <net_err.h>
    4545#include <net_modules.h>
    4646#include <net_interface.h>
  • uspace/srv/net/nil/nildummy/nildummy.c

    re98b1d5 rc5b59ce  
    4141#include <stdio.h>
    4242#include <str.h>
     43#include <err.h>
    4344#include <ipc/ipc.h>
    4445#include <ipc/services.h>
    4546
    46 #include <net_err.h>
    4747#include <net_messages.h>
    4848#include <net_modules.h>
  • uspace/srv/net/nil/nildummy/nildummy_module.c

    re98b1d5 rc5b59ce  
    3838#include <async.h>
    3939#include <stdio.h>
     40#include <err.h>
    4041
    4142#include <ipc/ipc.h>
    4243#include <ipc/services.h>
    4344
    44 #include <net_err.h>
    4545#include <net_modules.h>
    4646#include <net_interface.h>
  • uspace/srv/net/tl/icmp/icmp.c

    re98b1d5 rc5b59ce  
    4747#include <sys/types.h>
    4848#include <errno.h>
    49 
    50 #include <net_err.h>
     49#include <err.h>
     50
    5151#include <net_messages.h>
    5252#include <net_modules.h>
  • uspace/srv/net/tl/icmp/icmp_module.c

    re98b1d5 rc5b59ce  
    4040#include <async.h>
    4141#include <stdio.h>
     42#include <err.h>
    4243#include <ipc/ipc.h>
    4344#include <ipc/services.h>
    4445
    45 #include <net_err.h>
    4646#include <net_modules.h>
    4747#include <packet/packet.h>
  • uspace/srv/net/tl/tcp/tcp.c

    re98b1d5 rc5b59ce  
    4343#include <stdio.h>
    4444#include <errno.h>
     45#include <err.h>
    4546
    4647#include <ipc/ipc.h>
    4748#include <ipc/services.h>
    4849
    49 #include <net_err.h>
    5050#include <net_messages.h>
    5151#include <net_modules.h>
  • uspace/srv/net/tl/tcp/tcp_module.c

    re98b1d5 rc5b59ce  
    4040#include <async.h>
    4141#include <stdio.h>
     42#include <err.h>
    4243#include <ipc/ipc.h>
    4344#include <ipc/services.h>
    4445
    45 #include <net_err.h>
    4646#include <net_modules.h>
    4747#include <packet/packet.h>
  • uspace/srv/net/tl/udp/udp.c

    re98b1d5 rc5b59ce  
    4343#include <ipc/services.h>
    4444#include <errno.h>
    45 
    46 #include <net_err.h>
     45#include <err.h>
     46
    4747#include <net_messages.h>
    4848#include <net_modules.h>
  • uspace/srv/net/tl/udp/udp_module.c

    re98b1d5 rc5b59ce  
    4040#include <async.h>
    4141#include <stdio.h>
     42#include <err.h>
    4243#include <ipc/ipc.h>
    4344#include <ipc/services.h>
    4445
    45 #include <net_err.h>
    4646#include <net_modules.h>
    4747#include <packet/packet.h>
Note: See TracChangeset for help on using the changeset viewer.