Bundles / inc /

data.h

  1. /*
  2. * Copyright (c) 2016 Samsung Electronics Co., Ltd
  3. *
  4. * Licensed under the Flora License, Version 1.1 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://floralicense.org/license/
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16.  
  17. #if !defined(_DATA_H)
  18. #define _DATA_H
  19.  
  20. #include <stdbool.h>
  21. #include <bundle.h>
  22.  
  23. #define BUNDLE_HEADER_KEY "HEADER"
  24. #define BUNDLE_HEADER_DATA_KEY "HEADER_DATA"
  25.  
  26. #define MESSAGE_PORT_RCV_NAME PACKAGE"_msg_port_local_rcv"
  27.  
  28. typedef enum {
  29. TITLE,
  30. DATA,
  31. HEADER,
  32. HEADER_DATA,
  33. } bundle_message_type_e;
  34.  
  35. typedef void (*message_data_new_cb)(int index);
  36.  
  37. void data_initialize(message_data_new_cb new_data_cb);
  38. void data_finalize(void);
  39. bool data_create_bundle(void);
  40. void data_destroy_bundle(void);
  41. bool data_add_header(void);
  42. bool data_add_byte(const char *key, int value);
  43. bool data_add_string(const char *key, const char *value);
  44. bool data_key_exists(int index, const char *key);
  45. int data_is_byte(int index, const char *key);
  46. int data_get_count(int index);
  47. int data_get_byte(int index, const char *key);
  48. char *data_get_string(int index, const char *key);
  49. const char **data_get_string_array(int index, const char *key, int *len);
  50. char *data_get_type_text(int index, const char *key);
  51. Eina_List *data_get_keys(int index);
  52. void data_delete_key(int index, const char *key);
  53. void data_clear_bundle(void);
  54. bool data_send_message(void);
  55. #endif