gobex-defs.h 914 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. *
  4. * OBEX library with GLib integration
  5. *
  6. * Copyright (C) 2011 Intel Corporation. All rights reserved.
  7. *
  8. */
  9. #ifndef __GOBEX_DEFS_H
  10. #define __GOBEX_DEFS_H
  11. #include <glib.h>
  12. typedef enum {
  13. G_OBEX_DATA_INHERIT,
  14. G_OBEX_DATA_COPY,
  15. G_OBEX_DATA_REF,
  16. } GObexDataPolicy;
  17. #define G_OBEX_ERROR_FIRST (0xff + 1)
  18. #define G_OBEX_PROTO_ERROR(code) ((code) < G_OBEX_ERROR_FIRST)
  19. typedef enum {
  20. G_OBEX_ERROR_PARSE_ERROR = G_OBEX_ERROR_FIRST,
  21. G_OBEX_ERROR_INVALID_ARGS,
  22. G_OBEX_ERROR_DISCONNECTED,
  23. G_OBEX_ERROR_TIMEOUT,
  24. G_OBEX_ERROR_CANCELLED,
  25. G_OBEX_ERROR_FAILED,
  26. } GObexError;
  27. typedef gssize (*GObexDataProducer) (void *buf, gsize len, gpointer user_data);
  28. typedef gboolean (*GObexDataConsumer) (const void *buf, gsize len,
  29. gpointer user_data);
  30. #define G_OBEX_ERROR g_obex_error_quark()
  31. GQuark g_obex_error_quark(void);
  32. #endif /* __GOBEX_DEFS_H */