extr1.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (C) 2020 The HIME team, Taiwan
  3. * Copyright (C) 2011 Edward Der-Hua Liu, Hsin-Chu, Taiwan
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation version 2.1
  8. * of the License.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #include <stdio.h>
  20. #include <string.h>
  21. #include "hime.h"
  22. int main (void) {
  23. FILE *fp = fopen ("tsin.src", "r");
  24. if (!fp)
  25. p_err ("cannot open");
  26. while (!feof (fp)) {
  27. char aa[128];
  28. char bb[128];
  29. int usecount;
  30. char line[256];
  31. fgets (line, sizeof (line), fp);
  32. sscanf (line, "%s %s %d", aa, bb, &usecount);
  33. if (utf8_str_N (aa) == 1)
  34. printf ("%s", line);
  35. }
  36. return 0;
  37. }