Changeset 0c2d9bb in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2013-12-25T22:54:29Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b51cf2c
Parents:
f7a33de (diff), ac36aed (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:
9 added
1 deleted
25 edited
2 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/list.h

    rf7a33de r0c2d9bb  
    3838
    3939#include <assert.h>
     40#include <stdbool.h>
    4041#include <unistd.h>
    4142
     
    6768        ((type *) (((void *)(link)) - list_link_to_void(&(((type *) NULL)->member))))
    6869
    69 #define list_foreach(list, iterator) \
    70         for (link_t *iterator = (list).head.next; \
    71             iterator != &(list).head; iterator = iterator->next)
     70#define list_foreach(list, member, itype, iterator) \
     71        for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) 1) \
     72            for (link_t *_link = (list).head.next; \
     73            iterator = list_get_instance(_link, itype, member), \
     74            _link != &(list).head; _link = _link->next)
     75
     76#define list_foreach_rev(list, member, itype, iterator) \
     77        for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) 1) \
     78            for (link_t *_link = (list).head.prev; \
     79            iterator = list_get_instance(_link, itype, member), \
     80            _link != &(list).head; _link = _link->prev)
    7281
    7382/** Unlike list_foreach(), allows removing items while traversing a list.
    74  * 
     83 *
    7584 * @code
    7685 * list_t mylist;
     
    103112
    104113#define assert_link_not_used(link) \
    105         assert(((link)->prev == NULL) && ((link)->next == NULL))
     114        assert(!link_used(link))
    106115
    107116/** Returns true if the link is definitely part of a list. False if not sure. */
     
    238247static inline link_t *list_last(list_t *list)
    239248{
    240         return ((list->head.prev == &list->head) ? NULL : list->head.prev);
     249        return (list->head.prev == &list->head) ? NULL : list->head.prev;
     250}
     251
     252/** Get next item in list.
     253 *
     254 * @param link Current item link
     255 * @param list List containing @a link
     256 *
     257 * @return Next item or NULL if @a link is the last item.
     258 *
     259 */
     260static inline link_t *list_next(link_t *link, const list_t *list)
     261{
     262        return (link->next == &list->head) ? NULL : link->next;
     263}
     264
     265/** Get previous item in list.
     266 *
     267 * @param link Current item link
     268 * @param list List containing @a link
     269 *
     270 * @return Previous item or NULL if @a link is the first item.
     271 *
     272 */
     273static inline link_t *list_prev(link_t *link, const list_t *list)
     274{
     275        return (link->prev == &list->head) ? NULL : link->prev;
    241276}
    242277
     
    308343        unsigned int cnt = 0;
    309344       
    310         list_foreach(*list, link) {
     345        link_t *link = list_first(list);
     346        while (link != NULL) {
    311347                if (cnt == n)
    312348                        return link;
    313349               
    314350                cnt++;
     351                link = list_next(link, list);
    315352        }
    316353       
     
    325362{
    326363        return link;
     364}
     365
     366/** Determine if link is used.
     367 *
     368 * @param link Link
     369 * @return @c true if link is used, @c false if not.
     370 */
     371static inline bool link_used(link_t *link)
     372{
     373        if (link->prev == NULL && link->next == NULL)
     374                return false;
     375
     376        assert(link->prev != NULL && link->next != NULL);
     377        return true;
    327378}
    328379
  • uspace/lib/c/include/bitops.h

    rf7a33de r0c2d9bb  
    107107}
    108108
    109 extern int __popcountsi2(int);
    110 
    111109#endif
    112110
  • uspace/lib/c/include/cfg.h

    rf7a33de r0c2d9bb  
    8080
    8181#define cfg_file_foreach(file, cur) \
    82         list_foreach((file)->sections, (cur))
     82        list_foreach((file)->sections, link, const cfg_section_t, (cur))
    8383
    8484#define cfg_section_instance(cur) \
     
    8686
    8787#define cfg_section_foreach(section, cur) \
    88         list_foreach((section)->entries, (cur))
     88        list_foreach((section)->entries, link, const cfg_entry_t, (cur))
    8989
    9090#define cfg_entry_instance(cur) \
  • uspace/lib/c/include/ddi.h

    rf7a33de r0c2d9bb  
    4040#include <sys/time.h>
    4141#include <abi/ddi/irq.h>
     42#include <device/hw_res.h>
     43#include <device/hw_res_parsed.h>
     44#include <device/pio_window.h>
    4245#include <task.h>
     46
     47#define DMAMEM_16MiB  ((uintptr_t) UINT64_C(0xffffffffff000000))
     48#define DMAMEM_4GiB   ((uintptr_t) UINT64_C(0xffffffff00000000))
    4349
    4450extern int device_assign_devno(void);
    4551
    46 extern int physmem_map(void *, size_t, unsigned int, void **);
     52extern int physmem_map(uintptr_t, size_t, unsigned int, void **);
    4753
    48 extern int dmamem_map(void *, size_t, unsigned int, unsigned int, void **);
    49 extern int dmamem_map_anonymous(size_t, unsigned int, unsigned int, void **,
    50     void **);
     54extern int dmamem_map(void *, size_t, unsigned int, unsigned int, uintptr_t *);
     55extern int dmamem_map_anonymous(size_t, uintptr_t, unsigned int, unsigned int,
     56    uintptr_t *, void **);
    5157extern int dmamem_unmap(void *, size_t);
    5258extern int dmamem_unmap_anonymous(void *);
    5359
     60extern int pio_enable_range(addr_range_t *, void **);
     61extern int pio_enable_resource(pio_window_t *, hw_resource_t *, void **);
    5462extern int pio_enable(void *, size_t, void **);
    5563
     
    6977extern uint32_t pio_read_32(const ioport32_t *);
    7078
    71 static inline uint8_t pio_change_8(
    72     ioport8_t *reg, uint8_t val, uint8_t mask, useconds_t delay)
     79static inline uint8_t pio_change_8(ioport8_t *reg, uint8_t val, uint8_t mask,
     80    useconds_t delay)
    7381{
    7482        uint8_t v = pio_read_8(reg);
     
    7886}
    7987
    80 static inline uint16_t pio_change_16(
    81     ioport16_t *reg, uint16_t val, uint16_t mask, useconds_t delay)
     88static inline uint16_t pio_change_16(ioport16_t *reg, uint16_t val,
     89    uint16_t mask, useconds_t delay)
    8290{
    8391        uint16_t v = pio_read_16(reg);
     
    8795}
    8896
    89 static inline uint32_t pio_change_32(
    90     ioport32_t *reg, uint32_t val, uint32_t mask, useconds_t delay)
     97static inline uint32_t pio_change_32(ioport32_t *reg, uint32_t val,
     98    uint32_t mask, useconds_t delay)
    9199{
    92100        uint32_t v = pio_read_32(reg);
  • uspace/lib/c/include/device/hw_res.h

    rf7a33de r0c2d9bb  
    7676                struct {
    7777                        uint64_t address;
     78                        size_t size;
     79                        bool relative;
    7880                        endianness_t endianness;
    79                         size_t size;
    8081                } mem_range;
    8182               
    8283                struct {
    8384                        uint64_t address;
     85                        size_t size;
     86                        bool relative;
    8487                        endianness_t endianness;
    85                         size_t size;
    8688                } io_range;
    8789               
  • uspace/lib/c/include/device/hw_res_parsed.h

    rf7a33de r0c2d9bb  
    3737
    3838#include <device/hw_res.h>
     39#include <device/pio_window.h>
    3940#include <str.h>
    4041
     
    4546#define HW_RES_KEEP_DUPLICIT   0x2
    4647
     48
     49#define RNGABS(rng)     (rng).address.absolute
     50#define RNGREL(rng)     (rng).address.relative
     51#define RNGSZ(rng)      (rng).size
     52
     53#define RNGABSPTR(rng)  ((void *) ((uintptr_t) RNGABS((rng))))
     54
     55typedef struct address64 {
     56        /** Aboslute address. */
     57        uint64_t absolute;
     58        /** PIO window base relative address. */
     59        uint64_t relative;
     60} address64_t;
     61
    4762/** Address range structure */
    4863typedef struct addr_range {
    4964        /** Start address */
    50         uint64_t address;
    51        
    52         /** Endianness */
    53         endianness_t endianness;
     65        address64_t address;
    5466       
    5567        /** Area size */
    5668        size_t size;
     69
     70        /** Endianness */
     71        endianness_t endianness;
    5772} addr_range_t;
    5873
     
    139154}
    140155
    141 extern int hw_res_list_parse(const hw_resource_list_t *,
     156extern int hw_res_list_parse(const pio_window_t *, const hw_resource_list_t *,
    142157    hw_res_list_parsed_t *, int);
    143158extern int hw_res_get_list_parsed(async_sess_t *, hw_res_list_parsed_t *, int);
  • uspace/lib/c/include/devman.h

    rf7a33de r0c2d9bb  
    6161    unsigned int);
    6262extern int devman_fun_get_child(devman_handle_t, devman_handle_t *);
     63extern int devman_dev_get_parent(devman_handle_t, devman_handle_t *);
    6364extern int devman_dev_get_functions(devman_handle_t, devman_handle_t **,
    6465    size_t *);
     66extern int devman_fun_get_match_id(devman_handle_t, size_t, char *, size_t,
     67    unsigned int *);
    6568extern int devman_fun_get_name(devman_handle_t, char *, size_t);
    6669extern int devman_fun_get_driver_name(devman_handle_t, char *, size_t);
     
    7174extern int devman_add_device_to_category(devman_handle_t, const char *);
    7275extern int devman_fun_sid_to_handle(service_id_t, devman_handle_t *);
     76extern int devman_get_drivers(devman_handle_t **, size_t *);
     77extern int devman_driver_get_devices(devman_handle_t, devman_handle_t **,
     78    size_t *);
     79extern int devman_driver_get_handle(const char *, devman_handle_t *);
     80extern int devman_driver_get_match_id(devman_handle_t, size_t, char *, size_t,
     81    unsigned int *);
     82extern int devman_driver_get_name(devman_handle_t, char *, size_t);
     83extern int devman_driver_get_state(devman_handle_t, driver_state_t *);
     84extern int devman_driver_load(devman_handle_t);
    7385
    7486#endif
  • uspace/lib/c/include/inet/addr.h

    rf7a33de r0c2d9bb  
    3939#include <net/in.h>
    4040#include <net/in6.h>
     41#include <net/socket.h>
    4142
    4243typedef uint32_t addr32_t;
     
    4445typedef uint8_t addr128_t[16];
    4546
     47typedef enum {
     48        /** Any IP protocol version */
     49        ip_any,
     50        /** IPv4 */
     51        ip_v4,
     52        /** IPv6 */
     53        ip_v6
     54} ip_ver_t;
     55
    4656/** Node address */
    4757typedef struct {
    48         uint16_t family;
     58        /** IP version */
     59        ip_ver_t version;
    4960        union {
    5061                addr32_t addr;
     
    5566/** Network address */
    5667typedef struct {
    57         /** Address family */
    58         uint16_t family;
     68        /** IP version */
     69        ip_ver_t version;
    5970       
    6071        /** Address */
     
    6879} inet_naddr_t;
    6980
     81extern const addr32_t addr32_broadcast_all_hosts;
    7082extern const addr48_t addr48_broadcast;
    7183
     
    90102    uint16_t, uint16_t, uint16_t, uint16_t, uint8_t);
    91103
    92 extern int inet_addr_family(const char *, uint16_t *);
    93104extern void inet_naddr_addr(const inet_naddr_t *, inet_addr_t *);
    94105extern void inet_addr_naddr(const inet_addr_t *, uint8_t, inet_naddr_t *);
     
    109120extern int inet_naddr_format(const inet_naddr_t *, char **);
    110121
    111 extern uint16_t inet_addr_get(const inet_addr_t *, addr32_t *, addr128_t *);
    112 extern uint16_t inet_naddr_get(const inet_naddr_t *, addr32_t *, addr128_t *,
     122extern ip_ver_t inet_addr_get(const inet_addr_t *, addr32_t *, addr128_t *);
     123extern ip_ver_t inet_naddr_get(const inet_naddr_t *, addr32_t *, addr128_t *,
    113124    uint8_t *);
    114125
     
    124135    sockaddr_in6_t *);
    125136
     137extern ip_ver_t ipver_from_af(int af);
     138extern int inet_addr_sockaddr(const inet_addr_t *, uint16_t, sockaddr_t **,
     139    socklen_t *);
     140
    126141#endif
    127142
  • uspace/lib/c/include/inet/dnsr.h

    rf7a33de r0c2d9bb  
    5151
    5252extern int dnsr_init(void);
    53 extern int dnsr_name2host(const char *, dnsr_hostinfo_t **, uint16_t);
     53extern int dnsr_name2host(const char *, dnsr_hostinfo_t **, ip_ver_t);
    5454extern void dnsr_hostinfo_destroy(dnsr_hostinfo_t *);
    5555extern int dnsr_get_srvaddr(inet_addr_t *);
  • uspace/lib/c/include/inet/inet.h

    rf7a33de r0c2d9bb  
    3737
    3838#include <inet/addr.h>
     39#include <ipc/loc.h>
    3940#include <sys/types.h>
    40 
    41 #define INET_TTL_MAX 255
    42 
    43 typedef struct {
    44         inet_addr_t src;
    45         inet_addr_t dest;
    46         uint8_t tos;
    47         void *data;
    48         size_t size;
    49 } inet_dgram_t;
    50 
    51 typedef struct {
    52         int (*recv)(inet_dgram_t *);
    53 } inet_ev_ops_t;
    54 
    55 typedef enum {
    56         INET_DF = 1
    57 } inet_df_t;
     41#include <types/inet.h>
    5842
    5943extern int inet_init(uint8_t, inet_ev_ops_t *);
  • uspace/lib/c/include/inet/inetcfg.h

    rf7a33de r0c2d9bb  
    3838#include <inet/inet.h>
    3939#include <sys/types.h>
    40 
    41 /** Address object info */
    42 typedef struct {
    43         /** Network address */
    44         inet_naddr_t naddr;
    45         /** Link service ID */
    46         sysarg_t ilink;
    47         /** Address object name */
    48         char *name;
    49 } inet_addr_info_t;
    50 
    51 /** IP link info */
    52 typedef struct {
    53         /** Link service name */
    54         char *name;
    55         /** Default MTU */
    56         size_t def_mtu;
    57 } inet_link_info_t;
    58 
    59 /** Static route info */
    60 typedef struct {
    61         /** Destination network address */
    62         inet_naddr_t dest;
    63         /** Router address */
    64         inet_addr_t router;
    65         /** Static route name */
    66         char *name;
    67 } inet_sroute_info_t;
     40#include <types/inetcfg.h>
    6841
    6942extern int inetcfg_init(void);
     
    7548extern int inetcfg_get_link_list(sysarg_t **, size_t *);
    7649extern int inetcfg_get_sroute_list(sysarg_t **, size_t *);
     50extern int inetcfg_link_add(sysarg_t);
    7751extern int inetcfg_link_get(sysarg_t, inet_link_info_t *);
     52extern int inetcfg_link_remove(sysarg_t);
    7853extern int inetcfg_sroute_get(sysarg_t, inet_sroute_info_t *);
    7954extern int inetcfg_sroute_get_id(const char *, sysarg_t *);
  • uspace/lib/c/include/inet/inetping.h

    rf7a33de r0c2d9bb  
    11/*
    2  * Copyright (c) 2012 Jiri Svoboda
     2 * Copyright (c) 2013 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3838#include <inet/inet.h>
    3939#include <sys/types.h>
    40 
    41 typedef struct {
    42         uint32_t src;
    43         uint32_t dest;
    44         uint16_t seq_no;
    45         void *data;
    46         size_t size;
    47 } inetping_sdu_t;
     40#include <types/inetping.h>
    4841
    4942typedef struct inetping_ev_ops {
     
    5346extern int inetping_init(inetping_ev_ops_t *);
    5447extern int inetping_send(inetping_sdu_t *);
    55 extern int inetping_get_srcaddr(uint32_t, uint32_t *);
     48extern int inetping_get_srcaddr(const inet_addr_t *, inet_addr_t *);
    5649
    5750#endif
  • uspace/lib/c/include/inet/iplink.h

    rf7a33de r0c2d9bb  
    3737
    3838#include <async.h>
    39 #include <sys/types.h>
    4039#include <inet/addr.h>
    4140
     
    7877
    7978typedef struct iplink_ev_ops {
    80         int (*recv)(iplink_t *, iplink_recv_sdu_t *, uint16_t);
     79        int (*recv)(iplink_t *, iplink_recv_sdu_t *, ip_ver_t);
    8180} iplink_ev_ops_t;
    8281
  • uspace/lib/c/include/inet/iplink_srv.h

    rf7a33de r0c2d9bb  
    3939#include <fibril_synch.h>
    4040#include <stdbool.h>
    41 #include <sys/types.h>
    4241#include <inet/addr.h>
    4342#include <inet/iplink.h>
     
    6766
    6867extern int iplink_conn(ipc_callid_t, ipc_call_t *, void *);
    69 extern int iplink_ev_recv(iplink_srv_t *, iplink_recv_sdu_t *, uint16_t);
     68extern int iplink_ev_recv(iplink_srv_t *, iplink_recv_sdu_t *, ip_ver_t);
    7069
    7170#endif
  • uspace/lib/c/include/ipc/dev_iface.h

    rf7a33de r0c2d9bb  
    3636typedef enum {
    3737        HW_RES_DEV_IFACE = 0,
     38        PIO_WINDOW_DEV_IFACE,
    3839
    3940        /** Character device interface */
  • uspace/lib/c/include/ipc/devman.h

    rf7a33de r0c2d9bb  
    4242
    4343typedef sysarg_t devman_handle_t;
     44
     45typedef enum {
     46        /** Driver has not been started. */
     47        DRIVER_NOT_STARTED = 0,
     48       
     49        /**
     50         * Driver has been started, but has not registered as running and ready
     51         * to receive requests.
     52         */
     53        DRIVER_STARTING,
     54       
     55        /** Driver is running and prepared to serve incomming requests. */
     56        DRIVER_RUNNING
     57} driver_state_t;
    4458
    4559typedef enum {
     
    155169        DEVMAN_DEVICE_GET_HANDLE = IPC_FIRST_USER_METHOD,
    156170        DEVMAN_DEV_GET_FUNCTIONS,
     171        DEVMAN_DEV_GET_PARENT,
    157172        DEVMAN_FUN_GET_CHILD,
     173        DEVMAN_FUN_GET_MATCH_ID,
    158174        DEVMAN_FUN_GET_NAME,
    159175        DEVMAN_FUN_GET_DRIVER_NAME,
     
    161177        DEVMAN_FUN_OFFLINE,
    162178        DEVMAN_FUN_GET_PATH,
    163         DEVMAN_FUN_SID_TO_HANDLE
     179        DEVMAN_FUN_SID_TO_HANDLE,
     180        DEVMAN_GET_DRIVERS,
     181        DEVMAN_DRIVER_GET_DEVICES,
     182        DEVMAN_DRIVER_GET_HANDLE,
     183        DEVMAN_DRIVER_GET_MATCH_ID,
     184        DEVMAN_DRIVER_GET_NAME,
     185        DEVMAN_DRIVER_GET_STATE,
     186        DEVMAN_DRIVER_LOAD
    164187} client_to_devman_t;
    165188
  • uspace/lib/c/include/ipc/inet.h

    rf7a33de r0c2d9bb  
    7272        INETCFG_GET_LINK_LIST,
    7373        INETCFG_GET_SROUTE_LIST,
     74        INETCFG_LINK_ADD,
    7475        INETCFG_LINK_GET,
     76        INETCFG_LINK_REMOVE,
    7577        INETCFG_SROUTE_CREATE,
    7678        INETCFG_SROUTE_DELETE,
     
    9092} inetping_request_t;
    9193
    92 /** Events on Inet ping6 port */
    93 typedef enum {
    94         INETPING6_EV_RECV = IPC_FIRST_USER_METHOD
    95 } inetping6_event_t;
    96 
    97 /** Requests on Inet ping6 port */
    98 typedef enum {
    99         INETPING6_SEND = IPC_FIRST_USER_METHOD,
    100         INETPING6_GET_SRCADDR
    101 } inetping6_request_t;
    102 
    10394#endif
    10495
  • uspace/lib/c/include/ipc/services.h

    rf7a33de r0c2d9bb  
    5353} services_t;
    5454
     55#define SERVICE_NAME_CORECFG    "corecfg"
     56#define SERVICE_NAME_DHCP       "net/dhcp"
    5557#define SERVICE_NAME_DNSR       "net/dnsr"
    5658#define SERVICE_NAME_INET       "net/inet"
     
    5860#define SERVICE_NAME_INETPING   "net/inetping"
    5961#define SERVICE_NAME_INETPING6  "net/inetping6"
     62#define SERVICE_NAME_NETCONF    "net/netconf"
    6063
    6164#endif
  • uspace/lib/c/include/ipc/socket.h

    rf7a33de r0c2d9bb  
    198198#define SOCKET_GET_OPT_NAME(call) \
    199199        ({ \
    200                 int opt_name = (int) IPC_GET_ARG4(call); \
     200                int opt_name = (int) IPC_GET_ARG2(call); \
    201201                opt_name; \
    202202        })
  • uspace/lib/c/include/ipc/vfs.h

    rf7a33de r0c2d9bb  
    8282        VFS_IN_WAIT_HANDLE,
    8383        VFS_IN_MTAB_GET,
     84        VFS_IN_STATFS
    8485} vfs_in_request_t;
    8586
     
    9899        VFS_OUT_LOOKUP,
    99100        VFS_OUT_DESTROY,
     101        VFS_OUT_STATFS,
    100102        VFS_OUT_LAST
    101103} vfs_out_request_t;
  • uspace/lib/c/include/net/socket.h

    rf7a33de r0c2d9bb  
    5757extern int connect(int, const struct sockaddr *, socklen_t);
    5858extern int closesocket(int);
    59 extern int send(int, void *, size_t, int);
     59extern int send(int, const void *, size_t, int);
    6060extern int sendto(int, const void *, size_t, int, const struct sockaddr *,
    6161    socklen_t);
  • uspace/lib/c/include/net/socket_codes.h

    rf7a33de r0c2d9bb  
    7575typedef int32_t socklen_t;
    7676
     77/* Socket options */
     78
     79enum {
     80        SOL_SOCKET = 1,
     81
     82        /* IP link to transmit on */
     83        SO_IPLINK
     84};
     85
    7786#endif
    7887
  • uspace/lib/c/include/setjmp.h

    rf7a33de r0c2d9bb  
    11/*
    22 * Copyright (c) 2008 Josef Cejka
     3 * Copyright (c) 2013 Vojtech Horky
    34 * All rights reserved.
    45 *
     
    3031 * @{
    3132 */
    32 /** @file
     33/** @file Long jump implementation.
     34 *
     35 * Implementation inspired by Jiri Zarevucky's code from
     36 * http://bazaar.launchpad.net/~zarevucky-jiri/helenos/stdc/revision/1544/uspace/lib/posix/setjmp.h
    3337 */
    3438
     
    3842#include <libarch/fibril.h>
    3943
    40 typedef context_t jmp_buf[1];
     44struct jmp_buf_interal {
     45        context_t context;
     46        int return_value;
     47};
     48typedef struct jmp_buf_interal jmp_buf[1];
    4149
    42 extern int setjmp(jmp_buf env);
     50/*
     51 * Specified as extern to minimize number of included headers
     52 * because this file is used as is in libposix too.
     53 */
     54extern int context_save(context_t *ctx) __attribute__((returns_twice));
     55
     56/**
     57 * Save current environment (registers).
     58 *
     59 * This function may return twice.
     60 *
     61 * @param env Variable where to save the environment (of type jmp_buf).
     62 * @return Whether the call returned after longjmp.
     63 * @retval 0 Environment was saved, normal execution.
     64 * @retval other longjmp was executed and returned here.
     65 */
     66#define setjmp(env) \
     67        ((env)[0].return_value = 0, \
     68        context_save(&(env)[0].context), \
     69        (env)[0].return_value)
     70
    4371extern void longjmp(jmp_buf env, int val) __attribute__((noreturn));
    4472
  • uspace/lib/c/include/stdio.h

    rf7a33de r0c2d9bb  
    124124extern int vsnprintf(char *, size_t, const char *, va_list);
    125125
     126extern int printf_size(const char *, ...)
     127    PRINTF_ATTRIBUTE(1, 2);
     128extern int vprintf_size(const char *, va_list);
     129
    126130/* File stream functions */
    127131extern FILE *fopen(const char *, const char *);
     
    147151/* Misc file functions */
    148152extern int rename(const char *, const char *);
     153extern int remove(const char *);
    149154
    150155#endif
  • uspace/lib/c/include/types/inet.h

    rf7a33de r0c2d9bb  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2012 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3030 * @{
    3131 */
    32 
    3332/** @file
    34  * Network device.
    3533 */
    3634
    37 #ifndef LIBC_NET_DEVICE_H_
    38 #define LIBC_NET_DEVICE_H_
     35#ifndef LIBC_TYPES_INET_H_
     36#define LIBC_TYPES_INET_H_
    3937
    40 #include <adt/int_map.h>
    41 #include <nic/nic.h>
     38#include <inet/addr.h>
     39#include <ipc/loc.h>
     40#include <sys/types.h>
    4241
    43 /** Device identifier to generic type map declaration. */
    44 #define DEVICE_MAP_DECLARE  INT_MAP_DECLARE
     42#define INET_TTL_MAX 255
    4543
    46 /** Device identifier to generic type map implementation. */
    47 #define DEVICE_MAP_IMPLEMENT  INT_MAP_IMPLEMENT
     44typedef struct {
     45        /** Local IP link service ID (optional) */
     46        service_id_t iplink;
     47        inet_addr_t src;
     48        inet_addr_t dest;
     49        uint8_t tos;
     50        void *data;
     51        size_t size;
     52} inet_dgram_t;
    4853
    49 /** Device identifier type. */
    50 typedef int nic_device_id_t;
     54typedef struct {
     55        int (*recv)(inet_dgram_t *);
     56} inet_ev_ops_t;
    5157
    52 /** Invalid device identifier. */
    53 #define NIC_DEVICE_INVALID_ID  (-1)
     58typedef enum {
     59        INET_DF = 1
     60} inet_df_t;
    5461
    5562#endif
  • uspace/lib/c/include/types/inetping.h

    rf7a33de r0c2d9bb  
    11/*
    2  * Copyright (c) 2013 Martin Decky
     2 * Copyright (c) 2013 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3030 * @{
    3131 */
    32 /** @file
     32/**
     33 * @file
     34 * @brief
    3335 */
    3436
    35 #ifndef LIBC_INET_INETPING6_H_
    36 #define LIBC_INET_INETPING6_H_
     37#ifndef LIBC_TYPES_INETPING_H_
     38#define LIBC_TYPES_INETPING_H_
    3739
    38 #include <inet/inet.h>
     40#include <inet/addr.h>
    3941#include <sys/types.h>
    4042
    4143typedef struct {
    42         addr128_t src;
    43         addr128_t dest;
     44        inet_addr_t src;
     45        inet_addr_t dest;
    4446        uint16_t seq_no;
    4547        void *data;
    4648        size_t size;
    47 } inetping6_sdu_t;
    48 
    49 typedef struct inetping6_ev_ops {
    50         int (*recv)(inetping6_sdu_t *);
    51 } inetping6_ev_ops_t;
    52 
    53 extern int inetping6_init(inetping6_ev_ops_t *);
    54 extern int inetping6_send(inetping6_sdu_t *);
    55 extern int inetping6_get_srcaddr(addr128_t, addr128_t);
     49} inetping_sdu_t;
    5650
    5751#endif
  • uspace/lib/c/include/vfs/vfs.h

    rf7a33de r0c2d9bb  
    4444#include "vfs_mtab.h"
    4545
     46
    4647enum vfs_change_state_type {
    4748        VFS_PASS_HANDLE
    4849};
     50
    4951
    5052extern char *absolutize(const char *, size_t *);
     
    6163extern async_exch_t *vfs_exchange_begin(void);
    6264extern void vfs_exchange_end(async_exch_t *);
    63 
    6465#endif
    6566
Note: See TracChangeset for help on using the changeset viewer.