Commit f56539671339be3847382791074a7da1299cc58e
- Diff rendering mode:
- inline
- side by side
gchardet.cpp
(6 / 6)
|   | |||
| 34 | 34 | } | |
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | g_chardet_t | ||
| 37 | g_chardet_t* | ||
| 38 | 38 | g_chardet_new (guint32 lang_filter) | |
| 39 | 39 | { | |
| 40 | 40 | return reinterpret_cast <void*> (new CharsetDetector (lang_filter)); | |
| … | … | ||
| 42 | 42 | ||
| 43 | 43 | ||
| 44 | 44 | guint32 | |
| 45 | g_chardet_handle (g_chardet_t cd, | ||
| 45 | g_chardet_handle (g_chardet_t *cd, | ||
| 46 | 46 | const gchar *buf, | |
| 47 | 47 | guint32 len) | |
| 48 | 48 | { | |
| … | … | ||
| 53 | 53 | ||
| 54 | 54 | ||
| 55 | 55 | void | |
| 56 | g_chardet_free (g_chardet_t cd) | ||
| 56 | g_chardet_free (g_chardet_t *cd) | ||
| 57 | 57 | { | |
| 58 | 58 | g_return_if_fail (cd != NULL); | |
| 59 | 59 | CharsetDetector *impl = reinterpret_cast <CharsetDetector*> (cd); | |
| … | … | ||
| 61 | 61 | } | |
| 62 | 62 | ||
| 63 | 63 | const gchar* | |
| 64 | g_chardet_charset (g_chardet_t cd) | ||
| 64 | g_chardet_charset (g_chardet_t *cd) | ||
| 65 | 65 | { | |
| 66 | 66 | g_return_val_if_fail (cd != NULL, NULL); | |
| 67 | 67 | CharsetDetector *impl = reinterpret_cast <CharsetDetector*> (cd); | |
| … | … | ||
| 70 | 70 | ||
| 71 | 71 | ||
| 72 | 72 | gboolean | |
| 73 | g_chardet_found (g_chardet_t cd) | ||
| 73 | g_chardet_found (g_chardet_t *cd) | ||
| 74 | 74 | { | |
| 75 | 75 | g_return_val_if_fail (cd != NULL, FALSE); | |
| 76 | 76 | CharsetDetector *impl = reinterpret_cast <CharsetDetector*> (cd); | |
| … | … | ||
| 78 | 78 | } | |
| 79 | 79 | ||
| 80 | 80 | void | |
| 81 | g_chardet_finish (g_chardet_t cd) | ||
| 81 | g_chardet_finish (g_chardet_t *cd) | ||
| 82 | 82 | { | |
| 83 | 83 | g_return_if_fail (cd != NULL); | |
| 84 | 84 | CharsetDetector *impl = reinterpret_cast <CharsetDetector*> (cd); |
gchardet.h
(7 / 7)
|   | |||
| 28 | 28 | ||
| 29 | 29 | G_BEGIN_DECLS | |
| 30 | 30 | ||
| 31 | typedef void* g_chardet_t; | ||
| 31 | typedef void g_chardet_t; | ||
| 32 | 32 | ||
| 33 | g_chardet_t g_chardet_new (guint32 lang_filter); | ||
| 34 | guint32 g_chardet_handle (g_chardet_t cd, const gchar *buf, guint32 len); | ||
| 35 | const gchar* g_chardet_charset (g_chardet_t cd); | ||
| 36 | gboolean g_chardet_found (g_chardet_t cd); | ||
| 37 | void g_chardet_finish (g_chardet_t cd); | ||
| 38 | void g_chardet_free (g_chardet_t cd); | ||
| 33 | g_chardet_t* g_chardet_new (guint32 lang_filter); | ||
| 34 | guint32 g_chardet_handle (g_chardet_t* cd, const gchar *buf, guint32 len); | ||
| 35 | const gchar* g_chardet_charset (g_chardet_t* cd); | ||
| 36 | gboolean g_chardet_found (g_chardet_t* cd); | ||
| 37 | void g_chardet_finish (g_chardet_t* cd); | ||
| 38 | void g_chardet_free (g_chardet_t* cd); | ||
| 39 | 39 | ||
| 40 | 40 | G_END_DECLS | |
| 41 | 41 |
test.c
(1 / 1)
|   | |||
| 13 | 13 | main(int argc, char **argv) | |
| 14 | 14 | { | |
| 15 | 15 | int c; | |
| 16 | g_chardet_t cd = g_chardet_new (G_CHARDET_ALL); | ||
| 16 | g_chardet_t *cd = g_chardet_new (G_CHARDET_ALL); | ||
| 17 | 17 | ||
| 18 | 18 | while ((c = getchar()) != EOF && !g_chardet_found (cd)) | |
| 19 | 19 | { |

