X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=example%2Fmconv.c;h=a3f64a2a428be26a82e1e614e16859ab2efb3473;hb=be15d99720126d4776d0b39ecb7db9dcd7d407a2;hp=4c947741fc58bd6ba3dd7da3dc7c9bbfda287dee;hpb=7f0704dadbd1a55f1149772e1fb45d1c1313896e;p=m17n%2Fm17n-lib.git diff --git a/example/mconv.c b/example/mconv.c index 4c94774..a3f64a2 100644 --- a/example/mconv.c +++ b/example/mconv.c @@ -1,4 +1,4 @@ -/* mconv.c -- Code converter. +/* mconv.c -- Code converter. -*- coding: euc-jp; -*- Copyright (C) 2003, 2004 National Institute of Advanced Industrial Science and Technology (AIST) Registration Number H15PRO112 @@ -21,7 +21,7 @@ 02111-1307, USA. */ /***en - @page mconv convert file code + @enpage mconv convert file code @section mconv-synopsis SYNOPSIS @@ -73,7 +73,7 @@ */ /***ja - @page mconv ¥Õ¥¡¥¤¥ë¤Î¥³¡¼¥É¤òÊÑ´¹¤¹¤ë + @japage mconv ¥Õ¥¡¥¤¥ë¤Î¥³¡¼¥É¤òÊÑ´¹¤¹¤ë @section mconv-synopsis SYNOPSIS @@ -134,10 +134,19 @@ #include #include -#define VERSION "1.0" +#define VERSION "1.2.0" /* Print all coding system names. */ +int +compare_coding_name (const void *elt1, const void *elt2) +{ + const MSymbol *n1 = elt1; + const MSymbol *n2 = elt2; + + return strcmp (msymbol_name (*n1), msymbol_name (*n2)); +} + void list_coding () { @@ -147,6 +156,7 @@ list_coding () int len, clm; n = mconv_list_codings (&codings); + qsort (codings, n, sizeof (MSymbol), compare_coding_name); clm = 0; for (i = 0; i < n; i++) { @@ -391,6 +401,8 @@ main (int argc, char **argv) /* Clear away. */ mconv_free_converter (converter); + fclose (in); + fclose (out); m17n_object_unref (mt); M17N_FINI (); exit (0);