rowio.h 959 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef GRASS_ROWIO_H
  2. #define GRASS_ROWIO_H
  3. typedef struct
  4. {
  5. int fd; /* file descriptor for reading */
  6. int nrows; /* number of rows to be held in memory */
  7. int len; /* buffer length */
  8. int cur; /* current row in memory */
  9. void *buf; /* current data buf */
  10. int (*getrow)(int, void *, int, int); /* routine to do the row reads */
  11. int (*putrow)(int, const void *, int, int); /* routine to do the row writes */
  12. struct ROWIO_RCB
  13. {
  14. void *buf; /* data buffer */
  15. int age; /* for order of access */
  16. int row; /* row number */
  17. int dirty;
  18. } *rcb;
  19. } ROWIO;
  20. int rowio_fileno (const ROWIO *);
  21. void rowio_forget (ROWIO *,int);
  22. void *rowio_get (ROWIO *,int );
  23. void rowio_flush( ROWIO *);
  24. int rowio_put ( ROWIO *, const void *,int);
  25. void rowio_release (ROWIO *);
  26. int rowio_setup (ROWIO *,int , int , int , int (*)(int, void *, int, int), int (*)(int, const void *, int, int));
  27. #endif