Changes in uspace/srv/test/chardev-test/main.c [57914494:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/test/chardev-test/main.c
r57914494 rb7fd2a0 29 29 #include <async.h> 30 30 #include <errno.h> 31 #include <str_error.h> 31 32 #include <io/chardev_srv.h> 32 33 #include <ipc/services.h> … … 38 39 #define NAME "chardev-test" 39 40 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 *);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 *); 54 55 55 56 static service_id_t smallx_svc_id; … … 105 106 int main(int argc, char *argv[]) 106 107 { 107 int rc;108 errno_t rc; 108 109 109 110 printf("%s: Character device test service\n", NAME); … … 112 113 rc = loc_server_register(NAME); 113 114 if (rc != EOK) { 114 printf("%s: Failed registering server. (%d)\n", NAME, rc);115 printf("%s: Failed registering server.: %s\n", NAME, str_error(rc)); 115 116 return rc; 116 117 } … … 130 131 rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_SMALLX, &smallx_svc_id); 131 132 if (rc != EOK) { 132 printf("%s: Failed registering service. (%d)\n", NAME, rc);133 printf("%s: Failed registering service.: %s\n", NAME, str_error(rc)); 133 134 return rc; 134 135 } … … 136 137 rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_LARGEX, &largex_svc_id); 137 138 if (rc != EOK) { 138 printf("%s: Failed registering service. (%d)\n", NAME, rc);139 printf("%s: Failed registering service.: %s\n", NAME, str_error(rc)); 139 140 return rc; 140 141 } … … 142 143 rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_PARTIALX, &partialx_svc_id); 143 144 if (rc != EOK) { 144 printf("%s: Failed registering service. (%d)\n", NAME, rc);145 printf("%s: Failed registering service.: %s\n", NAME, str_error(rc)); 145 146 return rc; 146 147 } … … 155 156 } 156 157 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,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, 168 169 size_t *nwritten) 169 170 { … … 177 178 } 178 179 179 static int smallx_read(chardev_srv_t *srv, void *buf, size_t size,180 static errno_t smallx_read(chardev_srv_t *srv, void *buf, size_t size, 180 181 size_t *nread) 181 182 { … … 190 191 } 191 192 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,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, 203 204 size_t *nwritten) 204 205 { … … 212 213 } 213 214 214 static int largex_read(chardev_srv_t *srv, void *buf, size_t size,215 static errno_t largex_read(chardev_srv_t *srv, void *buf, size_t size, 215 216 size_t *nread) 216 217 { … … 225 226 } 226 227 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,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, 238 239 size_t *nwritten) 239 240 { … … 247 248 } 248 249 249 static int partialx_read(chardev_srv_t *srv, void *buf, size_t size,250 static errno_t partialx_read(chardev_srv_t *srv, void *buf, size_t size, 250 251 size_t *nread) 251 252 {
Note:
See TracChangeset
for help on using the changeset viewer.