http.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* --- BEGIN COPYRIGHT BLOCK ---
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * --- END COPYRIGHT BLOCK --- */
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. #ifndef _HTTP_H_
  13. #define _HTTP_H_
  14. /* mechanics */
  15. typedef void (*api_http_init)();
  16. typedef int (*api_get_http_text)(char *url, char *text_data);
  17. typedef int (*api_get_http_binary)(char *url, char* bin_data, int *len);
  18. typedef void (*api_http_shutdown)();
  19. /* API ID for http_apib_get_interface */
  20. #define HTTP_v1_0_GUID "0A340151-6FB3-11d3-80D2-006008A6EFF3"
  21. /* API */
  22. /* the api broker reserves api[0] for its use */
  23. #define http_init() \
  24. ((api_http_init*)(api))[1]()
  25. #define get_http_text(url, text_data) \
  26. ((api_get_http_text*)(api))[2]( url, text_data)
  27. #define get_http_binary(url, bin_data, len) \
  28. ((api_get_http_binary*)(api))[3](url,bin_data, len)
  29. #define set_http_shutdown() \
  30. ((api_http_shutdown*)(api))[4]()
  31. /* HTTP to be passed to http_register() by presence sps*/
  32. #define http_api(api) api[5]
  33. #endif /*_HTTP_H_*/