hexlink.h 640 B

123456789101112131415161718192021222324
  1. #ifndef HEXLINK_H_
  2. #define HEXLINK_H_
  3. #include <stddef.h>
  4. #include <stdint.h>
  5. /**
  6. * hexlink_write(path, buf, buflen):
  7. * Convert ${buf} (of length ${buflen}) into hexadecimal and create a link
  8. * from ${path} pointing at it.
  9. */
  10. int hexlink_write(const char *, const uint8_t *, size_t);
  11. /**
  12. * hexlink_read(path, buf, buflen):
  13. * Read the link ${path}, which should point to a hexadecimal string of
  14. * length 2 * ${buflen}; and parse this into the provided buffer. In the
  15. * event of an error, return with errno == ENOENT iff the link does not
  16. * exist.
  17. */
  18. int hexlink_read(const char *, uint8_t *, size_t);
  19. #endif /* !HEXLINK_H_ */