mcfsutil.h 846 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * \file
  3. * \brief Header: Low-level protocol for MCFS
  4. *
  5. * \todo FIXME: This protocol uses 32-bit integers for the communication.
  6. * It is a problem on systems with large file support, which is now
  7. * default. This means that lseek is broken unless --disable-largefile
  8. * is used. 64-bit systems are probably broken even more.
  9. */
  10. #ifndef MC_VFS_MCFSUTIL_H
  11. #define MC_VFS_MCFSUTIL_H
  12. enum {
  13. RPC_END, /* End of RPC commands */
  14. RPC_INT, /* Next argument is integer */
  15. RPC_STRING, /* Next argument is a string */
  16. RPC_BLOCK, /* Next argument is a len/block */
  17. RPC_LIMITED_STRING /* same as STRING, but has a size limit */
  18. };
  19. int rpc_get (int sock, ...);
  20. int rpc_send (int sock, ...);
  21. int socket_read_block (int sock, char *dest, int len);
  22. int socket_write_block (int sock, const char *buffer, int len);
  23. #endif