Changeset 5278:b3e0dd3f3141 in roaraudio for include/libroar/vio.h


Ignore:
Timestamp:
11/21/11 00:42:20 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

last parts of merging _nonblock into _ctl and fixed sizeof(cmd) of _ctls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/vio.h

    r5276 r5278  
    4343// sys io: 
    4444 
     45typedef int32_t       roar_vio_ctl_t; 
     46typedef int_least64_t roar_off_t; 
     47 
    4548struct roar_vio_calls { 
    46  void * inst; 
    47 /* 
    48  ssize_t (*read) (int fd, void *buf, size_t count, void * inst); 
    49  ssize_t (*write)(int fd, void *buf, size_t count, void * inst); 
    50  off_t   (*lseek)(int fildes, off_t offset, int whence, void * inst); 
    51 */ 
    52  ssize_t (*read    )(struct roar_vio_calls * vio, void *buf, size_t count); 
    53  ssize_t (*write   )(struct roar_vio_calls * vio, void *buf, size_t count); 
    54  off_t   (*lseek   )(struct roar_vio_calls * vio, off_t offset, int whence); 
    55 // int     (*nonblock)(struct roar_vio_calls * vio, int state); 
    56  int     (*sync    )(struct roar_vio_calls * vio); 
    57  int     (*ctl     )(struct roar_vio_calls * vio, int cmd, void * data); 
    58  int     (*close   )(struct roar_vio_calls * vio); 
    59  uint32_t flags; 
    60  size_t   refc; 
     49 size_t           refc; 
     50 uint32_t         flags; 
     51 void            *inst; 
     52 ssize_t        (*read    )(struct roar_vio_calls * vio, void *buf, size_t count); 
     53 ssize_t        (*write   )(struct roar_vio_calls * vio, void *buf, size_t count); 
     54 roar_off_t     (*lseek   )(struct roar_vio_calls * vio, roar_off_t offset, int whence); 
     55 int            (*sync    )(struct roar_vio_calls * vio); 
     56 int            (*ctl     )(struct roar_vio_calls * vio, roar_vio_ctl_t cmd, void * data); 
     57 int            (*close   )(struct roar_vio_calls * vio); 
    6158}; 
    6259 
     
    7269ssize_t roar_vio_read    (struct roar_vio_calls * vio, void *buf, size_t count) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
    7370ssize_t roar_vio_write   (struct roar_vio_calls * vio, void *buf, size_t count) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
    74 off_t   roar_vio_lseek   (struct roar_vio_calls * vio, off_t offset, int whence) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
     71roar_off_t   roar_vio_lseek   (struct roar_vio_calls * vio, roar_off_t offset, int whence) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
    7572int     roar_vio_nonblock(struct roar_vio_calls * vio, int state) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
    7673int     roar_vio_sync    (struct roar_vio_calls * vio) _LIBROAR_ATTR_NONNULL_ALL; 
    77 int     roar_vio_ctl     (struct roar_vio_calls * vio, int cmd, void * data) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1); 
     74int     roar_vio_ctl     (struct roar_vio_calls * vio, roar_vio_ctl_t cmd, void * data) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1); 
    7875int     roar_vio_close   (struct roar_vio_calls * vio) _LIBROAR_ATTR_NONNULL_ALL; 
    7976 
     
    103100ssize_t roar_vio_basic_read    (struct roar_vio_calls * vio, void *buf, size_t count); 
    104101ssize_t roar_vio_basic_write   (struct roar_vio_calls * vio, void *buf, size_t count); 
    105 off_t   roar_vio_basic_lseek   (struct roar_vio_calls * vio, off_t offset, int whence); 
     102roar_off_t   roar_vio_basic_lseek   (struct roar_vio_calls * vio, roar_off_t offset, int whence); 
    106103int     roar_vio_basic_sync    (struct roar_vio_calls * vio); 
    107 int     roar_vio_basic_ctl     (struct roar_vio_calls * vio, int cmd, void * data); 
     104int     roar_vio_basic_ctl     (struct roar_vio_calls * vio, roar_vio_ctl_t cmd, void * data); 
    108105int     roar_vio_basic_close   (struct roar_vio_calls * vio); 
    109106 
     
    118115ssize_t roar_vio_pass_read    (struct roar_vio_calls * vio, void *buf, size_t count); 
    119116ssize_t roar_vio_pass_write   (struct roar_vio_calls * vio, void *buf, size_t count); 
    120 off_t   roar_vio_pass_lseek   (struct roar_vio_calls * vio, off_t offset, int whence); 
     117roar_off_t   roar_vio_pass_lseek   (struct roar_vio_calls * vio, roar_off_t offset, int whence); 
    121118int     roar_vio_pass_sync    (struct roar_vio_calls * vio); 
    122 int     roar_vio_pass_ctl     (struct roar_vio_calls * vio, int cmd, void * data); 
     119int     roar_vio_pass_ctl     (struct roar_vio_calls * vio, roar_vio_ctl_t cmd, void * data); 
    123120int     roar_vio_pass_close   (struct roar_vio_calls * vio); 
    124121 
     
    128125ssize_t roar_vio_re_read (struct roar_vio_calls * vio, void *buf, size_t count); 
    129126ssize_t roar_vio_re_write(struct roar_vio_calls * vio, void *buf, size_t count); 
    130 off_t   roar_vio_re_lseek(struct roar_vio_calls * vio, off_t offset, int whence); 
     127roar_off_t   roar_vio_re_lseek(struct roar_vio_calls * vio, roar_off_t offset, int whence); 
    131128 
    132129#endif 
Note: See TracChangeset for help on using the changeset viewer.