Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/test/chardev-test/main.c

    rb7fd2a0 r57914494  
    2929#include <async.h>
    3030#include <errno.h>
    31 #include <str_error.h>
    3231#include <io/chardev_srv.h>
    3332#include <ipc/services.h>
     
    3938#define NAME  "chardev-test"
    4039
    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 *);
     40static int smallx_open(chardev_srvs_t *, chardev_srv_t *);
     41static int smallx_close(chardev_srv_t *);
     42static int smallx_write(chardev_srv_t *, const void *, size_t, size_t *);
     43static int smallx_read(chardev_srv_t *, void *, size_t, size_t *);
     44
     45static int largex_open(chardev_srvs_t *, chardev_srv_t *);
     46static int largex_close(chardev_srv_t *);
     47static int largex_write(chardev_srv_t *, const void *, size_t, size_t *);
     48static int largex_read(chardev_srv_t *, void *, size_t, size_t *);
     49
     50static int partialx_open(chardev_srvs_t *, chardev_srv_t *);
     51static int partialx_close(chardev_srv_t *);
     52static int partialx_write(chardev_srv_t *, const void *, size_t, size_t *);
     53static int partialx_read(chardev_srv_t *, void *, size_t, size_t *);
    5554
    5655static service_id_t smallx_svc_id;
     
    106105int main(int argc, char *argv[])
    107106{
    108         errno_t rc;
     107        int rc;
    109108
    110109        printf("%s: Character device test service\n", NAME);
     
    113112        rc = loc_server_register(NAME);
    114113        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);
    116115                return rc;
    117116        }
     
    131130        rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_SMALLX, &smallx_svc_id);
    132131        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);
    134133                return rc;
    135134        }
     
    137136        rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_LARGEX, &largex_svc_id);
    138137        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);
    140139                return rc;
    141140        }
     
    143142        rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_PARTIALX, &partialx_svc_id);
    144143        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);
    146145                return rc;
    147146        }
     
    156155}
    157156
    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,
     157static int smallx_open(chardev_srvs_t *srvs, chardev_srv_t *srv)
     158{
     159        return EOK;
     160}
     161
     162static int smallx_close(chardev_srv_t *srv)
     163{
     164        return EOK;
     165}
     166
     167static int smallx_write(chardev_srv_t *srv, const void *data, size_t size,
    169168    size_t *nwritten)
    170169{
     
    178177}
    179178
    180 static errno_t smallx_read(chardev_srv_t *srv, void *buf, size_t size,
     179static int smallx_read(chardev_srv_t *srv, void *buf, size_t size,
    181180    size_t *nread)
    182181{
     
    191190}
    192191
    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,
     192static int largex_open(chardev_srvs_t *srvs, chardev_srv_t *srv)
     193{
     194        return EOK;
     195}
     196
     197static int largex_close(chardev_srv_t *srv)
     198{
     199        return EOK;
     200}
     201
     202static int largex_write(chardev_srv_t *srv, const void *data, size_t size,
    204203    size_t *nwritten)
    205204{
     
    213212}
    214213
    215 static errno_t largex_read(chardev_srv_t *srv, void *buf, size_t size,
     214static int largex_read(chardev_srv_t *srv, void *buf, size_t size,
    216215    size_t *nread)
    217216{
     
    226225}
    227226
    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,
     227static int partialx_open(chardev_srvs_t *srvs, chardev_srv_t *srv)
     228{
     229        return EOK;
     230}
     231
     232static int partialx_close(chardev_srv_t *srv)
     233{
     234        return EOK;
     235}
     236
     237static int partialx_write(chardev_srv_t *srv, const void *data, size_t size,
    239238    size_t *nwritten)
    240239{
     
    248247}
    249248
    250 static errno_t partialx_read(chardev_srv_t *srv, void *buf, size_t size,
     249static int partialx_read(chardev_srv_t *srv, void *buf, size_t size,
    251250    size_t *nread)
    252251{
Note: See TracChangeset for help on using the changeset viewer.