Changeset 0c2d9bb in mainline for uspace/lib/c/include
- Timestamp:
- 2013-12-25T22:54:29Z (12 years ago)
- 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. - 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 38 38 39 39 #include <assert.h> 40 #include <stdbool.h> 40 41 #include <unistd.h> 41 42 … … 67 68 ((type *) (((void *)(link)) - list_link_to_void(&(((type *) NULL)->member)))) 68 69 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) 72 81 73 82 /** Unlike list_foreach(), allows removing items while traversing a list. 74 * 83 * 75 84 * @code 76 85 * list_t mylist; … … 103 112 104 113 #define assert_link_not_used(link) \ 105 assert( ((link)->prev == NULL) && ((link)->next == NULL))114 assert(!link_used(link)) 106 115 107 116 /** Returns true if the link is definitely part of a list. False if not sure. */ … … 238 247 static inline link_t *list_last(list_t *list) 239 248 { 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 */ 260 static 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 */ 273 static inline link_t *list_prev(link_t *link, const list_t *list) 274 { 275 return (link->prev == &list->head) ? NULL : link->prev; 241 276 } 242 277 … … 308 343 unsigned int cnt = 0; 309 344 310 list_foreach(*list, link) { 345 link_t *link = list_first(list); 346 while (link != NULL) { 311 347 if (cnt == n) 312 348 return link; 313 349 314 350 cnt++; 351 link = list_next(link, list); 315 352 } 316 353 … … 325 362 { 326 363 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 */ 371 static 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; 327 378 } 328 379 -
uspace/lib/c/include/bitops.h
rf7a33de r0c2d9bb 107 107 } 108 108 109 extern int __popcountsi2(int);110 111 109 #endif 112 110 -
uspace/lib/c/include/cfg.h
rf7a33de r0c2d9bb 80 80 81 81 #define cfg_file_foreach(file, cur) \ 82 list_foreach((file)->sections, (cur))82 list_foreach((file)->sections, link, const cfg_section_t, (cur)) 83 83 84 84 #define cfg_section_instance(cur) \ … … 86 86 87 87 #define cfg_section_foreach(section, cur) \ 88 list_foreach((section)->entries, (cur))88 list_foreach((section)->entries, link, const cfg_entry_t, (cur)) 89 89 90 90 #define cfg_entry_instance(cur) \ -
uspace/lib/c/include/ddi.h
rf7a33de r0c2d9bb 40 40 #include <sys/time.h> 41 41 #include <abi/ddi/irq.h> 42 #include <device/hw_res.h> 43 #include <device/hw_res_parsed.h> 44 #include <device/pio_window.h> 42 45 #include <task.h> 46 47 #define DMAMEM_16MiB ((uintptr_t) UINT64_C(0xffffffffff000000)) 48 #define DMAMEM_4GiB ((uintptr_t) UINT64_C(0xffffffff00000000)) 43 49 44 50 extern int device_assign_devno(void); 45 51 46 extern int physmem_map( void *, size_t, unsigned int, void **);52 extern int physmem_map(uintptr_t, size_t, unsigned int, void **); 47 53 48 extern int dmamem_map(void *, size_t, unsigned int, unsigned int, void **);49 extern int dmamem_map_anonymous(size_t, u nsigned int, unsigned int, void **,50 void **);54 extern int dmamem_map(void *, size_t, unsigned int, unsigned int, uintptr_t *); 55 extern int dmamem_map_anonymous(size_t, uintptr_t, unsigned int, unsigned int, 56 uintptr_t *, void **); 51 57 extern int dmamem_unmap(void *, size_t); 52 58 extern int dmamem_unmap_anonymous(void *); 53 59 60 extern int pio_enable_range(addr_range_t *, void **); 61 extern int pio_enable_resource(pio_window_t *, hw_resource_t *, void **); 54 62 extern int pio_enable(void *, size_t, void **); 55 63 … … 69 77 extern uint32_t pio_read_32(const ioport32_t *); 70 78 71 static inline uint8_t pio_change_8( 72 ioport8_t *reg, uint8_t val, uint8_t mask,useconds_t delay)79 static inline uint8_t pio_change_8(ioport8_t *reg, uint8_t val, uint8_t mask, 80 useconds_t delay) 73 81 { 74 82 uint8_t v = pio_read_8(reg); … … 78 86 } 79 87 80 static inline uint16_t pio_change_16( 81 ioport16_t *reg, uint16_t val,uint16_t mask, useconds_t delay)88 static inline uint16_t pio_change_16(ioport16_t *reg, uint16_t val, 89 uint16_t mask, useconds_t delay) 82 90 { 83 91 uint16_t v = pio_read_16(reg); … … 87 95 } 88 96 89 static inline uint32_t pio_change_32( 90 ioport32_t *reg, uint32_t val,uint32_t mask, useconds_t delay)97 static inline uint32_t pio_change_32(ioport32_t *reg, uint32_t val, 98 uint32_t mask, useconds_t delay) 91 99 { 92 100 uint32_t v = pio_read_32(reg); -
uspace/lib/c/include/device/hw_res.h
rf7a33de r0c2d9bb 76 76 struct { 77 77 uint64_t address; 78 size_t size; 79 bool relative; 78 80 endianness_t endianness; 79 size_t size;80 81 } mem_range; 81 82 82 83 struct { 83 84 uint64_t address; 85 size_t size; 86 bool relative; 84 87 endianness_t endianness; 85 size_t size;86 88 } io_range; 87 89 -
uspace/lib/c/include/device/hw_res_parsed.h
rf7a33de r0c2d9bb 37 37 38 38 #include <device/hw_res.h> 39 #include <device/pio_window.h> 39 40 #include <str.h> 40 41 … … 45 46 #define HW_RES_KEEP_DUPLICIT 0x2 46 47 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 55 typedef struct address64 { 56 /** Aboslute address. */ 57 uint64_t absolute; 58 /** PIO window base relative address. */ 59 uint64_t relative; 60 } address64_t; 61 47 62 /** Address range structure */ 48 63 typedef struct addr_range { 49 64 /** Start address */ 50 uint64_t address; 51 52 /** Endianness */ 53 endianness_t endianness; 65 address64_t address; 54 66 55 67 /** Area size */ 56 68 size_t size; 69 70 /** Endianness */ 71 endianness_t endianness; 57 72 } addr_range_t; 58 73 … … 139 154 } 140 155 141 extern int hw_res_list_parse(const hw_resource_list_t *,156 extern int hw_res_list_parse(const pio_window_t *, const hw_resource_list_t *, 142 157 hw_res_list_parsed_t *, int); 143 158 extern int hw_res_get_list_parsed(async_sess_t *, hw_res_list_parsed_t *, int); -
uspace/lib/c/include/devman.h
rf7a33de r0c2d9bb 61 61 unsigned int); 62 62 extern int devman_fun_get_child(devman_handle_t, devman_handle_t *); 63 extern int devman_dev_get_parent(devman_handle_t, devman_handle_t *); 63 64 extern int devman_dev_get_functions(devman_handle_t, devman_handle_t **, 64 65 size_t *); 66 extern int devman_fun_get_match_id(devman_handle_t, size_t, char *, size_t, 67 unsigned int *); 65 68 extern int devman_fun_get_name(devman_handle_t, char *, size_t); 66 69 extern int devman_fun_get_driver_name(devman_handle_t, char *, size_t); … … 71 74 extern int devman_add_device_to_category(devman_handle_t, const char *); 72 75 extern int devman_fun_sid_to_handle(service_id_t, devman_handle_t *); 76 extern int devman_get_drivers(devman_handle_t **, size_t *); 77 extern int devman_driver_get_devices(devman_handle_t, devman_handle_t **, 78 size_t *); 79 extern int devman_driver_get_handle(const char *, devman_handle_t *); 80 extern int devman_driver_get_match_id(devman_handle_t, size_t, char *, size_t, 81 unsigned int *); 82 extern int devman_driver_get_name(devman_handle_t, char *, size_t); 83 extern int devman_driver_get_state(devman_handle_t, driver_state_t *); 84 extern int devman_driver_load(devman_handle_t); 73 85 74 86 #endif -
uspace/lib/c/include/inet/addr.h
rf7a33de r0c2d9bb 39 39 #include <net/in.h> 40 40 #include <net/in6.h> 41 #include <net/socket.h> 41 42 42 43 typedef uint32_t addr32_t; … … 44 45 typedef uint8_t addr128_t[16]; 45 46 47 typedef enum { 48 /** Any IP protocol version */ 49 ip_any, 50 /** IPv4 */ 51 ip_v4, 52 /** IPv6 */ 53 ip_v6 54 } ip_ver_t; 55 46 56 /** Node address */ 47 57 typedef struct { 48 uint16_t family; 58 /** IP version */ 59 ip_ver_t version; 49 60 union { 50 61 addr32_t addr; … … 55 66 /** Network address */ 56 67 typedef struct { 57 /** Address family*/58 uint16_t family;68 /** IP version */ 69 ip_ver_t version; 59 70 60 71 /** Address */ … … 68 79 } inet_naddr_t; 69 80 81 extern const addr32_t addr32_broadcast_all_hosts; 70 82 extern const addr48_t addr48_broadcast; 71 83 … … 90 102 uint16_t, uint16_t, uint16_t, uint16_t, uint8_t); 91 103 92 extern int inet_addr_family(const char *, uint16_t *);93 104 extern void inet_naddr_addr(const inet_naddr_t *, inet_addr_t *); 94 105 extern void inet_addr_naddr(const inet_addr_t *, uint8_t, inet_naddr_t *); … … 109 120 extern int inet_naddr_format(const inet_naddr_t *, char **); 110 121 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 *,122 extern ip_ver_t inet_addr_get(const inet_addr_t *, addr32_t *, addr128_t *); 123 extern ip_ver_t inet_naddr_get(const inet_naddr_t *, addr32_t *, addr128_t *, 113 124 uint8_t *); 114 125 … … 124 135 sockaddr_in6_t *); 125 136 137 extern ip_ver_t ipver_from_af(int af); 138 extern int inet_addr_sockaddr(const inet_addr_t *, uint16_t, sockaddr_t **, 139 socklen_t *); 140 126 141 #endif 127 142 -
uspace/lib/c/include/inet/dnsr.h
rf7a33de r0c2d9bb 51 51 52 52 extern int dnsr_init(void); 53 extern int dnsr_name2host(const char *, dnsr_hostinfo_t **, uint16_t);53 extern int dnsr_name2host(const char *, dnsr_hostinfo_t **, ip_ver_t); 54 54 extern void dnsr_hostinfo_destroy(dnsr_hostinfo_t *); 55 55 extern int dnsr_get_srvaddr(inet_addr_t *); -
uspace/lib/c/include/inet/inet.h
rf7a33de r0c2d9bb 37 37 38 38 #include <inet/addr.h> 39 #include <ipc/loc.h> 39 40 #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> 58 42 59 43 extern int inet_init(uint8_t, inet_ev_ops_t *); -
uspace/lib/c/include/inet/inetcfg.h
rf7a33de r0c2d9bb 38 38 #include <inet/inet.h> 39 39 #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> 68 41 69 42 extern int inetcfg_init(void); … … 75 48 extern int inetcfg_get_link_list(sysarg_t **, size_t *); 76 49 extern int inetcfg_get_sroute_list(sysarg_t **, size_t *); 50 extern int inetcfg_link_add(sysarg_t); 77 51 extern int inetcfg_link_get(sysarg_t, inet_link_info_t *); 52 extern int inetcfg_link_remove(sysarg_t); 78 53 extern int inetcfg_sroute_get(sysarg_t, inet_sroute_info_t *); 79 54 extern int inetcfg_sroute_get_id(const char *, sysarg_t *); -
uspace/lib/c/include/inet/inetping.h
rf7a33de r0c2d9bb 1 1 /* 2 * Copyright (c) 201 2Jiri Svoboda2 * Copyright (c) 2013 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 38 38 #include <inet/inet.h> 39 39 #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> 48 41 49 42 typedef struct inetping_ev_ops { … … 53 46 extern int inetping_init(inetping_ev_ops_t *); 54 47 extern int inetping_send(inetping_sdu_t *); 55 extern int inetping_get_srcaddr( uint32_t, uint32_t *);48 extern int inetping_get_srcaddr(const inet_addr_t *, inet_addr_t *); 56 49 57 50 #endif -
uspace/lib/c/include/inet/iplink.h
rf7a33de r0c2d9bb 37 37 38 38 #include <async.h> 39 #include <sys/types.h>40 39 #include <inet/addr.h> 41 40 … … 78 77 79 78 typedef 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); 81 80 } iplink_ev_ops_t; 82 81 -
uspace/lib/c/include/inet/iplink_srv.h
rf7a33de r0c2d9bb 39 39 #include <fibril_synch.h> 40 40 #include <stdbool.h> 41 #include <sys/types.h>42 41 #include <inet/addr.h> 43 42 #include <inet/iplink.h> … … 67 66 68 67 extern 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);68 extern int iplink_ev_recv(iplink_srv_t *, iplink_recv_sdu_t *, ip_ver_t); 70 69 71 70 #endif -
uspace/lib/c/include/ipc/dev_iface.h
rf7a33de r0c2d9bb 36 36 typedef enum { 37 37 HW_RES_DEV_IFACE = 0, 38 PIO_WINDOW_DEV_IFACE, 38 39 39 40 /** Character device interface */ -
uspace/lib/c/include/ipc/devman.h
rf7a33de r0c2d9bb 42 42 43 43 typedef sysarg_t devman_handle_t; 44 45 typedef 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; 44 58 45 59 typedef enum { … … 155 169 DEVMAN_DEVICE_GET_HANDLE = IPC_FIRST_USER_METHOD, 156 170 DEVMAN_DEV_GET_FUNCTIONS, 171 DEVMAN_DEV_GET_PARENT, 157 172 DEVMAN_FUN_GET_CHILD, 173 DEVMAN_FUN_GET_MATCH_ID, 158 174 DEVMAN_FUN_GET_NAME, 159 175 DEVMAN_FUN_GET_DRIVER_NAME, … … 161 177 DEVMAN_FUN_OFFLINE, 162 178 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 164 187 } client_to_devman_t; 165 188 -
uspace/lib/c/include/ipc/inet.h
rf7a33de r0c2d9bb 72 72 INETCFG_GET_LINK_LIST, 73 73 INETCFG_GET_SROUTE_LIST, 74 INETCFG_LINK_ADD, 74 75 INETCFG_LINK_GET, 76 INETCFG_LINK_REMOVE, 75 77 INETCFG_SROUTE_CREATE, 76 78 INETCFG_SROUTE_DELETE, … … 90 92 } inetping_request_t; 91 93 92 /** Events on Inet ping6 port */93 typedef enum {94 INETPING6_EV_RECV = IPC_FIRST_USER_METHOD95 } inetping6_event_t;96 97 /** Requests on Inet ping6 port */98 typedef enum {99 INETPING6_SEND = IPC_FIRST_USER_METHOD,100 INETPING6_GET_SRCADDR101 } inetping6_request_t;102 103 94 #endif 104 95 -
uspace/lib/c/include/ipc/services.h
rf7a33de r0c2d9bb 53 53 } services_t; 54 54 55 #define SERVICE_NAME_CORECFG "corecfg" 56 #define SERVICE_NAME_DHCP "net/dhcp" 55 57 #define SERVICE_NAME_DNSR "net/dnsr" 56 58 #define SERVICE_NAME_INET "net/inet" … … 58 60 #define SERVICE_NAME_INETPING "net/inetping" 59 61 #define SERVICE_NAME_INETPING6 "net/inetping6" 62 #define SERVICE_NAME_NETCONF "net/netconf" 60 63 61 64 #endif -
uspace/lib/c/include/ipc/socket.h
rf7a33de r0c2d9bb 198 198 #define SOCKET_GET_OPT_NAME(call) \ 199 199 ({ \ 200 int opt_name = (int) IPC_GET_ARG 4(call); \200 int opt_name = (int) IPC_GET_ARG2(call); \ 201 201 opt_name; \ 202 202 }) -
uspace/lib/c/include/ipc/vfs.h
rf7a33de r0c2d9bb 82 82 VFS_IN_WAIT_HANDLE, 83 83 VFS_IN_MTAB_GET, 84 VFS_IN_STATFS 84 85 } vfs_in_request_t; 85 86 … … 98 99 VFS_OUT_LOOKUP, 99 100 VFS_OUT_DESTROY, 101 VFS_OUT_STATFS, 100 102 VFS_OUT_LAST 101 103 } vfs_out_request_t; -
uspace/lib/c/include/net/socket.h
rf7a33de r0c2d9bb 57 57 extern int connect(int, const struct sockaddr *, socklen_t); 58 58 extern int closesocket(int); 59 extern int send(int, void *, size_t, int);59 extern int send(int, const void *, size_t, int); 60 60 extern int sendto(int, const void *, size_t, int, const struct sockaddr *, 61 61 socklen_t); -
uspace/lib/c/include/net/socket_codes.h
rf7a33de r0c2d9bb 75 75 typedef int32_t socklen_t; 76 76 77 /* Socket options */ 78 79 enum { 80 SOL_SOCKET = 1, 81 82 /* IP link to transmit on */ 83 SO_IPLINK 84 }; 85 77 86 #endif 78 87 -
uspace/lib/c/include/setjmp.h
rf7a33de r0c2d9bb 1 1 /* 2 2 * Copyright (c) 2008 Josef Cejka 3 * Copyright (c) 2013 Vojtech Horky 3 4 * All rights reserved. 4 5 * … … 30 31 * @{ 31 32 */ 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 33 37 */ 34 38 … … 38 42 #include <libarch/fibril.h> 39 43 40 typedef context_t jmp_buf[1]; 44 struct jmp_buf_interal { 45 context_t context; 46 int return_value; 47 }; 48 typedef struct jmp_buf_interal jmp_buf[1]; 41 49 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 */ 54 extern 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 43 71 extern void longjmp(jmp_buf env, int val) __attribute__((noreturn)); 44 72 -
uspace/lib/c/include/stdio.h
rf7a33de r0c2d9bb 124 124 extern int vsnprintf(char *, size_t, const char *, va_list); 125 125 126 extern int printf_size(const char *, ...) 127 PRINTF_ATTRIBUTE(1, 2); 128 extern int vprintf_size(const char *, va_list); 129 126 130 /* File stream functions */ 127 131 extern FILE *fopen(const char *, const char *); … … 147 151 /* Misc file functions */ 148 152 extern int rename(const char *, const char *); 153 extern int remove(const char *); 149 154 150 155 #endif -
uspace/lib/c/include/types/inet.h
rf7a33de r0c2d9bb 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2012 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 30 30 * @{ 31 31 */ 32 33 32 /** @file 34 * Network device.35 33 */ 36 34 37 #ifndef LIBC_ NET_DEVICE_H_38 #define LIBC_ NET_DEVICE_H_35 #ifndef LIBC_TYPES_INET_H_ 36 #define LIBC_TYPES_INET_H_ 39 37 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> 42 41 43 /** Device identifier to generic type map declaration. */ 44 #define DEVICE_MAP_DECLARE INT_MAP_DECLARE 42 #define INET_TTL_MAX 255 45 43 46 /** Device identifier to generic type map implementation. */ 47 #define DEVICE_MAP_IMPLEMENT INT_MAP_IMPLEMENT 44 typedef 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; 48 53 49 /** Device identifier type. */ 50 typedef int nic_device_id_t; 54 typedef struct { 55 int (*recv)(inet_dgram_t *); 56 } inet_ev_ops_t; 51 57 52 /** Invalid device identifier. */ 53 #define NIC_DEVICE_INVALID_ID (-1) 58 typedef enum { 59 INET_DF = 1 60 } inet_df_t; 54 61 55 62 #endif -
uspace/lib/c/include/types/inetping.h
rf7a33de r0c2d9bb 1 1 /* 2 * Copyright (c) 2013 Martin Decky2 * Copyright (c) 2013 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 30 30 * @{ 31 31 */ 32 /** @file 32 /** 33 * @file 34 * @brief 33 35 */ 34 36 35 #ifndef LIBC_ INET_INETPING6_H_36 #define LIBC_ INET_INETPING6_H_37 #ifndef LIBC_TYPES_INETPING_H_ 38 #define LIBC_TYPES_INETPING_H_ 37 39 38 #include <inet/ inet.h>40 #include <inet/addr.h> 39 41 #include <sys/types.h> 40 42 41 43 typedef struct { 42 addr128_t src;43 addr128_t dest;44 inet_addr_t src; 45 inet_addr_t dest; 44 46 uint16_t seq_no; 45 47 void *data; 46 48 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; 56 50 57 51 #endif -
uspace/lib/c/include/vfs/vfs.h
rf7a33de r0c2d9bb 44 44 #include "vfs_mtab.h" 45 45 46 46 47 enum vfs_change_state_type { 47 48 VFS_PASS_HANDLE 48 49 }; 50 49 51 50 52 extern char *absolutize(const char *, size_t *); … … 61 63 extern async_exch_t *vfs_exchange_begin(void); 62 64 extern void vfs_exchange_end(async_exch_t *); 63 64 65 #endif 65 66
Note:
See TracChangeset
for help on using the changeset viewer.