File: performance.c

package info (click to toggle)
libchewing 0.10.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,040 kB
  • sloc: ansic: 7,031; python: 190; sh: 127; makefile: 44
file content (33 lines) | stat: -rw-r--r-- 641 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
 * performance.c
 *
 * Copyright (c) 2013
 *      libchewing Core Team.
 *
 * See the file "COPYING" for information on usage and redistribution
 * of this file.
 */
#include <stdio.h>
#include <stdlib.h>

#include "chewing.h"

int main()
{
    ChewingContext *ctx;
    int ch;

    /* Initialize libchewing */
    putenv("CHEWING_PATH=" CHEWING_DATA_PREFIX);
    /* for the sake of testing, we should not change existing hash data */
    putenv("CHEWING_USER_PATH=" TEST_HASH_DIR);

    ctx = chewing_new();

    while ((ch = getchar()) != EOF) {
        chewing_handle_Default(ctx, ch);
    }

    chewing_delete(ctx);
    return 0;
}