[Julius-cvs 439] CVS update: julius4/libjulius/src

アーカイブの一覧に戻る

sumom****@users***** sumom****@users*****
2009年 9月 18日 (金) 17:31:08 JST


Index: julius4/libjulius/src/m_jconf.c
diff -u julius4/libjulius/src/m_jconf.c:1.5 julius4/libjulius/src/m_jconf.c:1.6
--- julius4/libjulius/src/m_jconf.c:1.5	Tue Oct  7 03:09:27 2008
+++ julius4/libjulius/src/m_jconf.c	Fri Sep 18 17:31:08 2009
@@ -37,7 +37,7 @@
  * @author Akinobu Lee
  * @date   Thu May 12 14:16:18 2005
  *
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
  * 
  */
 /*
@@ -381,8 +381,8 @@
   char **c_argv;
   FILE *fp;
   int maxnum, step;
-  static const int len = 512;
-  char buf[len], cpy[len];
+#define BUFLEN 512
+  char buf[BUFLEN], cpy[BUFLEN];
   char *p, *dst, *dst_from;
   char *cdir;
   int i;
@@ -402,7 +402,7 @@
   c_argv = (char **)mymalloc(sizeof(char *) * maxnum);
   c_argv[0] = strcpy((char *)mymalloc(strlen(conffile)+1), conffile);
   c_argc = 1;
-  while (fgets_jconf(buf, len, fp) != NULL) {
+  while (fgets_jconf(buf, BUFLEN, fp) != NULL) {
     if (buf[0] == '\0') continue;
     p = buf; dst = cpy;
     while (1) {
Index: julius4/libjulius/src/plugin.c
diff -u julius4/libjulius/src/plugin.c:1.2 julius4/libjulius/src/plugin.c:1.3
--- julius4/libjulius/src/plugin.c:1.2	Wed Mar 18 16:05:30 2009
+++ julius4/libjulius/src/plugin.c	Fri Sep 18 17:31:08 2009
@@ -12,7 +12,7 @@
  * @author Akinobu Lee
  * @date   Sat Aug  2 09:46:09 2008
  * 
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
  * 
  */
 /*
@@ -26,7 +26,11 @@
 
 #ifdef ENABLE_PLUGIN
 
+#if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__)
+#include <windows.h>
+#else
 #include <dirent.h>
+#endif
 #include <stdarg.h>
 
 /**
@@ -234,6 +238,33 @@
 boolean
 plugin_load_dir(char *dir)
 {
+#if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__)
+
+  WIN32_FIND_DATA FindFileData;
+  HANDLE hFind;
+  static char buf[512];
+  int cnt;
+
+  strncpy(buf, dir, 505);
+  strcat(buf, "\\*.dll");
+  if ((hFind = FindFirstFile(buf, &FindFileData)) == INVALID_HANDLE_VALUE) {
+    jlog("ERROR: plugin_load: cannot open plugins dir \"%s\"\n", dir);
+    return FALSE;
+  }
+
+  cnt = 0;
+  do {
+    jlog("STAT: file: %-23s ", FindFileData.cFileName);
+    if (plugin_load_file(buf)) cnt++;
+  } while (FindNextFile(hFind, &FindFileData));
+
+  FindClose(hFind);
+  jlog("STAT: %d files loaded\n", cnt);
+
+  return TRUE;
+  
+#else
+  
   DIR *d;
   struct dirent *f;
   static char buf[512];
@@ -255,6 +286,8 @@
   jlog("STAT: %d files loaded\n", cnt);
 
   return TRUE;
+
+#endif
 }
 
 /** 
Index: julius4/libjulius/src/wchmm_check.c
diff -u julius4/libjulius/src/wchmm_check.c:1.2 julius4/libjulius/src/wchmm_check.c:1.3
--- julius4/libjulius/src/wchmm_check.c:1.2	Tue Dec 18 17:45:49 2007
+++ julius4/libjulius/src/wchmm_check.c	Fri Sep 18 17:31:08 2009
@@ -24,7 +24,7 @@
  * @author Akinobu Lee
  * @date   Sat Sep 24 15:45:06 2005
  *
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
  * 
  */
 /*
@@ -327,8 +327,8 @@
 void
 wchmm_check_interactive(WCHMM_INFO *wchmm) /* interactive check */
 {
-  static const int len = 24;
-  char buf[len], *name;
+#define MAXNAMELEN 24
+  char buf[MAXNAMELEN], *name;
   int arg, newline;
   WORD_ID argw;
   boolean endflag;
@@ -341,7 +341,7 @@
 
   for (endflag = FALSE; endflag == FALSE;) {
     printf("===== syntax: command arg (\"H\" for help) > ");
-    if (fgets(buf, len, stdin) == NULL) break;
+    if (fgets(buf, MAXNAMELEN, stdin) == NULL) break;
     name = "";
     arg = 0;
     if (isalpha(buf[0]) != 0 && buf[1] == ' ') {



Julius-cvs メーリングリストの案内
アーカイブの一覧に戻る