Changes in uspace/srv/test/chardev-test/main.c [b7fd2a0:57914494] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/test/chardev-test/main.c
rb7fd2a0 r57914494 29 29 #include <async.h> 30 30 #include <errno.h> 31 #include <str_error.h>32 31 #include <io/chardev_srv.h> 33 32 #include <ipc/services.h> … … 39 38 #define NAME "chardev-test" 40 39 41 static errno_t smallx_open(chardev_srvs_t *, chardev_srv_t *);42 static errno_t smallx_close(chardev_srv_t *);43 static errno_t smallx_write(chardev_srv_t *, const void *, size_t, size_t *);44 static errno_t smallx_read(chardev_srv_t *, void *, size_t, size_t *);45 46 static errno_t largex_open(chardev_srvs_t *, chardev_srv_t *);47 static errno_t largex_close(chardev_srv_t *);48 static errno_t largex_write(chardev_srv_t *, const void *, size_t, size_t *);49 static errno_t largex_read(chardev_srv_t *, void *, size_t, size_t *);50 51 static errno_t partialx_open(chardev_srvs_t *, chardev_srv_t *);52 static errno_t partialx_close(chardev_srv_t *);53 static errno_t partialx_write(chardev_srv_t *, const void *, size_t, size_t *);54 static errno_t partialx_read(chardev_srv_t *, void *, size_t, size_t *);40 static int smallx_open(chardev_srvs_t *, chardev_srv_t *); 41 static int smallx_close(chardev_srv_t *); 42 static int smallx_write(chardev_srv_t *, const void *, size_t, size_t *); 43 static int smallx_read(chardev_srv_t *, void *, size_t, size_t *); 44 45 static int largex_open(chardev_srvs_t *, chardev_srv_t *); 46 static int largex_close(chardev_srv_t *); 47 static int largex_write(chardev_srv_t *, const void *, size_t, size_t *); 48 static int largex_read(chardev_srv_t *, void *, size_t, size_t *); 49 50 static int partialx_open(chardev_srvs_t *, chardev_srv_t *); 51 static int partialx_close(chardev_srv_t *); 52 static int partialx_write(chardev_srv_t *, const void *, size_t, size_t *); 53 static int partialx_read(chardev_srv_t *, void *, size_t, size_t *); 55 54 56 55 static service_id_t smallx_svc_id; … … 106 105 int main(int argc, char *argv[]) 107 106 { 108 errno_t rc;107 int rc; 109 108 110 109 printf("%s: Character device test service\n", NAME); … … 113 112 rc = loc_server_register(NAME); 114 113 if (rc != EOK) { 115 printf("%s: Failed registering server. : %s\n", NAME, str_error(rc));114 printf("%s: Failed registering server. (%d)\n", NAME, rc); 116 115 return rc; 117 116 } … … 131 130 rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_SMALLX, &smallx_svc_id); 132 131 if (rc != EOK) { 133 printf("%s: Failed registering service. : %s\n", NAME, str_error(rc));132 printf("%s: Failed registering service. (%d)\n", NAME, rc); 134 133 return rc; 135 134 } … … 137 136 rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_LARGEX, &largex_svc_id); 138 137 if (rc != EOK) { 139 printf("%s: Failed registering service. : %s\n", NAME, str_error(rc));138 printf("%s: Failed registering service. (%d)\n", NAME, rc); 140 139 return rc; 141 140 } … … 143 142 rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_PARTIALX, &partialx_svc_id); 144 143 if (rc != EOK) { 145 printf("%s: Failed registering service. : %s\n", NAME, str_error(rc));144 printf("%s: Failed registering service. (%d)\n", NAME, rc); 146 145 return rc; 147 146 } … … 156 155 } 157 156 158 static errno_t smallx_open(chardev_srvs_t *srvs, chardev_srv_t *srv)159 { 160 return EOK; 161 } 162 163 static errno_t smallx_close(chardev_srv_t *srv)164 { 165 return EOK; 166 } 167 168 static errno_t smallx_write(chardev_srv_t *srv, const void *data, size_t size,157 static int smallx_open(chardev_srvs_t *srvs, chardev_srv_t *srv) 158 { 159 return EOK; 160 } 161 162 static int smallx_close(chardev_srv_t *srv) 163 { 164 return EOK; 165 } 166 167 static int smallx_write(chardev_srv_t *srv, const void *data, size_t size, 169 168 size_t *nwritten) 170 169 { … … 178 177 } 179 178 180 static errno_t smallx_read(chardev_srv_t *srv, void *buf, size_t size,179 static int smallx_read(chardev_srv_t *srv, void *buf, size_t size, 181 180 size_t *nread) 182 181 { … … 191 190 } 192 191 193 static errno_t largex_open(chardev_srvs_t *srvs, chardev_srv_t *srv)194 { 195 return EOK; 196 } 197 198 static errno_t largex_close(chardev_srv_t *srv)199 { 200 return EOK; 201 } 202 203 static errno_t largex_write(chardev_srv_t *srv, const void *data, size_t size,192 static int largex_open(chardev_srvs_t *srvs, chardev_srv_t *srv) 193 { 194 return EOK; 195 } 196 197 static int largex_close(chardev_srv_t *srv) 198 { 199 return EOK; 200 } 201 202 static int largex_write(chardev_srv_t *srv, const void *data, size_t size, 204 203 size_t *nwritten) 205 204 { … … 213 212 } 214 213 215 static errno_t largex_read(chardev_srv_t *srv, void *buf, size_t size,214 static int largex_read(chardev_srv_t *srv, void *buf, size_t size, 216 215 size_t *nread) 217 216 { … … 226 225 } 227 226 228 static errno_t partialx_open(chardev_srvs_t *srvs, chardev_srv_t *srv)229 { 230 return EOK; 231 } 232 233 static errno_t partialx_close(chardev_srv_t *srv)234 { 235 return EOK; 236 } 237 238 static errno_t partialx_write(chardev_srv_t *srv, const void *data, size_t size,227 static int partialx_open(chardev_srvs_t *srvs, chardev_srv_t *srv) 228 { 229 return EOK; 230 } 231 232 static int partialx_close(chardev_srv_t *srv) 233 { 234 return EOK; 235 } 236 237 static int partialx_write(chardev_srv_t *srv, const void *data, size_t size, 239 238 size_t *nwritten) 240 239 { … … 248 247 } 249 248 250 static errno_t partialx_read(chardev_srv_t *srv, void *buf, size_t size,249 static int partialx_read(chardev_srv_t *srv, void *buf, size_t size, 251 250 size_t *nread) 252 251 {
Note:
See TracChangeset
for help on using the changeset viewer.