| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2009 Red Hat, Inc. | 2 * Copyright © 2009 Red Hat, Inc. |
| 3 * | 3 * |
| 4 * This is part of HarfBuzz, a text shaping library. | 4 * This is part of HarfBuzz, a text shaping library. |
| 5 * | 5 * |
| 6 * Permission is hereby granted, without written agreement and without | 6 * Permission is hereby granted, without written agreement and without |
| 7 * license or royalty fees, to use, copy, modify, and distribute this | 7 * license or royalty fees, to use, copy, modify, and distribute this |
| 8 * software and its documentation for any purpose, provided that the | 8 * software and its documentation for any purpose, provided that the |
| 9 * above copyright notice and the following two paragraphs appear in | 9 * above copyright notice and the following two paragraphs appear in |
| 10 * all copies of this software. | 10 * all copies of this software. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 */ | 57 */ |
| 58 typedef enum { | 58 typedef enum { |
| 59 HB_MEMORY_MODE_DUPLICATE, | 59 HB_MEMORY_MODE_DUPLICATE, |
| 60 HB_MEMORY_MODE_READONLY, | 60 HB_MEMORY_MODE_READONLY, |
| 61 HB_MEMORY_MODE_WRITABLE, | 61 HB_MEMORY_MODE_WRITABLE, |
| 62 HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE | 62 HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE |
| 63 } hb_memory_mode_t; | 63 } hb_memory_mode_t; |
| 64 | 64 |
| 65 typedef struct hb_blob_t hb_blob_t; | 65 typedef struct hb_blob_t hb_blob_t; |
| 66 | 66 |
| 67 hb_blob_t * | 67 HB_EXTERN hb_blob_t * |
| 68 hb_blob_create (const char *data, | 68 hb_blob_create (const char *data, |
| 69 unsigned int length, | 69 unsigned int length, |
| 70 hb_memory_mode_t mode, | 70 hb_memory_mode_t mode, |
| 71 void *user_data, | 71 void *user_data, |
| 72 hb_destroy_func_t destroy); | 72 hb_destroy_func_t destroy); |
| 73 | 73 |
| 74 /* Always creates with MEMORY_MODE_READONLY. | 74 /* Always creates with MEMORY_MODE_READONLY. |
| 75 * Even if the parent blob is writable, we don't | 75 * Even if the parent blob is writable, we don't |
| 76 * want the user of the sub-blob to be able to | 76 * want the user of the sub-blob to be able to |
| 77 * modify the parent data as that data may be | 77 * modify the parent data as that data may be |
| 78 * shared among multiple sub-blobs. | 78 * shared among multiple sub-blobs. |
| 79 */ | 79 */ |
| 80 hb_blob_t * | 80 HB_EXTERN hb_blob_t * |
| 81 hb_blob_create_sub_blob (hb_blob_t *parent, | 81 hb_blob_create_sub_blob (hb_blob_t *parent, |
| 82 unsigned int offset, | 82 unsigned int offset, |
| 83 unsigned int length); | 83 unsigned int length); |
| 84 | 84 |
| 85 hb_blob_t * | 85 HB_EXTERN hb_blob_t * |
| 86 hb_blob_get_empty (void); | 86 hb_blob_get_empty (void); |
| 87 | 87 |
| 88 hb_blob_t * | 88 HB_EXTERN hb_blob_t * |
| 89 hb_blob_reference (hb_blob_t *blob); | 89 hb_blob_reference (hb_blob_t *blob); |
| 90 | 90 |
| 91 void | 91 HB_EXTERN void |
| 92 hb_blob_destroy (hb_blob_t *blob); | 92 hb_blob_destroy (hb_blob_t *blob); |
| 93 | 93 |
| 94 hb_bool_t | 94 HB_EXTERN hb_bool_t |
| 95 hb_blob_set_user_data (hb_blob_t *blob, | 95 hb_blob_set_user_data (hb_blob_t *blob, |
| 96 hb_user_data_key_t *key, | 96 hb_user_data_key_t *key, |
| 97 void * data, | 97 void * data, |
| 98 hb_destroy_func_t destroy, | 98 hb_destroy_func_t destroy, |
| 99 hb_bool_t replace); | 99 hb_bool_t replace); |
| 100 | 100 |
| 101 | 101 |
| 102 void * | 102 HB_EXTERN void * |
| 103 hb_blob_get_user_data (hb_blob_t *blob, | 103 hb_blob_get_user_data (hb_blob_t *blob, |
| 104 hb_user_data_key_t *key); | 104 hb_user_data_key_t *key); |
| 105 | 105 |
| 106 | 106 |
| 107 void | 107 HB_EXTERN void |
| 108 hb_blob_make_immutable (hb_blob_t *blob); | 108 hb_blob_make_immutable (hb_blob_t *blob); |
| 109 | 109 |
| 110 hb_bool_t | 110 HB_EXTERN hb_bool_t |
| 111 hb_blob_is_immutable (hb_blob_t *blob); | 111 hb_blob_is_immutable (hb_blob_t *blob); |
| 112 | 112 |
| 113 | 113 |
| 114 unsigned int | 114 HB_EXTERN unsigned int |
| 115 hb_blob_get_length (hb_blob_t *blob); | 115 hb_blob_get_length (hb_blob_t *blob); |
| 116 | 116 |
| 117 const char * | 117 HB_EXTERN const char * |
| 118 hb_blob_get_data (hb_blob_t *blob, unsigned int *length); | 118 hb_blob_get_data (hb_blob_t *blob, unsigned int *length); |
| 119 | 119 |
| 120 char * | 120 HB_EXTERN char * |
| 121 hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length); | 121 hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length); |
| 122 | 122 |
| 123 | 123 |
| 124 HB_END_DECLS | 124 HB_END_DECLS |
| 125 | 125 |
| 126 #endif /* HB_BLOB_H */ | 126 #endif /* HB_BLOB_H */ |
| OLD | NEW |