Changeset cb569e6 in mainline for uspace/lib/c/include
- Timestamp:
- 2010-11-18T21:58:27Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4e5c7ba
- Parents:
- 69e0d6d (diff), 45f04f8 (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:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/generic_char_map.h
r69e0d6d rcb569e6 40 40 #include <unistd.h> 41 41 #include <errno.h> 42 #include <err.h>43 42 44 43 #include <adt/char_map.h> … … 85 84 type *value) \ 86 85 { \ 87 ERROR_DECLARE; \86 int rc; \ 88 87 int index; \ 89 88 if (!name##_is_valid(map)) \ … … 92 91 if (index < 0) \ 93 92 return index; \ 94 if (ERROR_OCCURRED(char_map_add(&map->names, name, length,\95 index))) { \93 rc = char_map_add(&map->names, name, length, index); \ 94 if (rc != EOK) { \ 96 95 name##_items_exclude_index(&map->values, index); \ 97 return ERROR_CODE; \96 return rc; \ 98 97 } \ 99 98 return EOK; \ … … 141 140 int name##_initialize(name##_ref map) \ 142 141 { \ 143 ERROR_DECLARE; \142 int rc; \ 144 143 if (!map) \ 145 144 return EINVAL; \ 146 ERROR_PROPAGATE(char_map_initialize(&map->names)); \ 147 if (ERROR_OCCURRED(name##_items_initialize(&map->values))) { \ 145 rc = char_map_initialize(&map->names); \ 146 if (rc != EOK) \ 147 return rc; \ 148 rc = name##_items_initialize(&map->values); \ 149 if (rc != EOK) { \ 148 150 char_map_destroy(&map->names); \ 149 return ERROR_CODE; \151 return rc; \ 150 152 } \ 151 153 map->magic = GENERIC_CHAR_MAP_MAGIC_VALUE; \ -
uspace/lib/c/include/devman.h
r69e0d6d rcb569e6 42 42 43 43 44 int devman_get_phone(devman_interface_t, unsigned int);45 void devman_hangup_phone(devman_interface_t iface);44 extern int devman_get_phone(devman_interface_t, unsigned int); 45 extern void devman_hangup_phone(devman_interface_t); 46 46 47 int devman_driver_register(const char *, async_client_conn_t); 48 int devman_child_device_register(const char *, match_id_list_t *, device_handle_t, device_handle_t *); 47 extern int devman_driver_register(const char *, async_client_conn_t); 48 extern int devman_child_device_register(const char *, match_id_list_t *, 49 devman_handle_t, devman_handle_t *); 49 50 50 int devman_device_connect(device_handle_t handle, unsigned int flags);51 int devman_parent_device_connect(device_handle_t handle, unsigned int flags);51 extern int devman_device_connect(devman_handle_t, unsigned int); 52 extern int devman_parent_device_connect(devman_handle_t, unsigned int); 52 53 53 int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags); 54 extern int devman_device_get_handle(const char *, devman_handle_t *, 55 unsigned int); 54 56 55 int devman_add_device_to_class(device_handle_t dev_handle, const char *class_name);57 extern int devman_add_device_to_class(devman_handle_t, const char *); 56 58 57 59 #endif -
uspace/lib/c/include/devmap.h
r69e0d6d rcb569e6 44 44 45 45 extern int devmap_driver_register(const char *, async_client_conn_t); 46 extern int devmap_device_register(const char *, dev _handle_t *);46 extern int devmap_device_register(const char *, devmap_handle_t *); 47 47 48 extern int devmap_device_get_handle(const char *, dev _handle_t *, unsigned int);49 extern int devmap_namespace_get_handle(const char *, dev _handle_t *, unsigned int);50 extern devmap_handle_type_t devmap_handle_probe(dev _handle_t);48 extern int devmap_device_get_handle(const char *, devmap_handle_t *, unsigned int); 49 extern int devmap_namespace_get_handle(const char *, devmap_handle_t *, unsigned int); 50 extern devmap_handle_type_t devmap_handle_probe(devmap_handle_t); 51 51 52 extern int devmap_device_connect(dev _handle_t, unsigned int);52 extern int devmap_device_connect(devmap_handle_t, unsigned int); 53 53 54 54 extern int devmap_null_create(void); … … 56 56 57 57 extern size_t devmap_count_namespaces(void); 58 extern size_t devmap_count_devices(dev _handle_t);58 extern size_t devmap_count_devices(devmap_handle_t); 59 59 60 60 extern size_t devmap_get_namespaces(dev_desc_t **); 61 extern size_t devmap_get_devices(dev _handle_t, dev_desc_t **);61 extern size_t devmap_get_devices(devmap_handle_t, dev_desc_t **); 62 62 63 63 #endif -
uspace/lib/c/include/err.h
r69e0d6d rcb569e6 37 37 38 38 #include <stdio.h> 39 #include <errno.h>40 41 #ifdef CONFIG_DEBUG42 #include <str_error.h>43 #endif44 39 45 40 #define errx(status, fmt, ...) { \ … … 48 43 } 49 44 50 51 /** An actual stored error code. */52 #define ERROR_CODE error_check_return_value53 54 /** An error processing routines declaration.55 *56 * This has to be declared in the block where the error processing57 * is desired.58 */59 #define ERROR_DECLARE int ERROR_CODE60 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_DEBUG68 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 #else78 79 #define ERROR_OCCURRED(value) ((ERROR_CODE = (value)) != EOK)80 81 #endif82 83 #define ERROR_NONE(value) !ERROR_OCCURRED((value))84 85 /** Error propagation86 *87 * Check if an error occurred and immediately exit the actual88 * 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_CODE97 98 45 #endif 99 46 100 47 /** @} 101 48 */ 49 -
uspace/lib/c/include/ipc/devman.h
r69e0d6d rcb569e6 42 42 #define DEVMAN_NAME_MAXLEN 256 43 43 44 typedef ipcarg_t dev ice_handle_t;44 typedef ipcarg_t devman_handle_t; 45 45 46 46 /** Ids of device models used for device-to-driver matching. -
uspace/lib/c/include/ipc/devmap.h
r69e0d6d rcb569e6 40 40 #define DEVMAP_NAME_MAXLEN 255 41 41 42 typedef ipcarg_t dev _handle_t;42 typedef ipcarg_t devmap_handle_t; 43 43 44 44 typedef enum { … … 81 81 82 82 typedef struct { 83 dev _handle_t handle;83 devmap_handle_t handle; 84 84 char name[DEVMAP_NAME_MAXLEN + 1]; 85 85 } dev_desc_t; -
uspace/lib/c/include/stdio.h
r69e0d6d rcb569e6 46 46 #define BUFSIZ 4096 47 47 48 #define DEBUG(fmt, ...) se\48 #define DEBUG(fmt, ...) \ 49 49 { \ 50 50 char _buf[256]; \ -
uspace/lib/c/include/sys/stat.h
r69e0d6d rcb569e6 43 43 struct stat { 44 44 fs_handle_t fs_handle; 45 dev _handle_t dev_handle;45 devmap_handle_t devmap_handle; 46 46 fs_index_t index; 47 47 unsigned int lnkcnt; … … 49 49 bool is_directory; 50 50 aoff64_t size; 51 dev _handle_t device;51 devmap_handle_t device; 52 52 }; 53 53 -
uspace/lib/c/include/unistd.h
r69e0d6d rcb569e6 41 41 42 42 #ifndef NULL 43 #define NULL 0 43 #define NULL 0UL 44 44 #endif 45 45 -
uspace/lib/c/include/vfs/vfs.h
r69e0d6d rcb569e6 47 47 typedef struct { 48 48 fs_handle_t fs_handle; 49 dev _handle_t dev_handle;49 devmap_handle_t devmap_handle; 50 50 fs_index_t index; 51 51 } fdi_node_t;
Note:
See TracChangeset
for help on using the changeset viewer.