Fix sj3mkdic

This commit is contained in:
Nishi 2026-06-19 01:47:46 +09:00
commit 80b2181a61
19 changed files with 29 additions and 68 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
/build /build
*.obj *.obj
*.exe
*.lib

View file

@ -2,9 +2,11 @@ cmake_minimum_required(VERSION 3.11)
project(sj3) project(sj3)
configure_file(config.h.in config.h)
file(GLOB_RECURSE SJ3CORE_SRCS lib/sj3core/**.c) file(GLOB_RECURSE SJ3CORE_SRCS lib/sj3core/**.c)
add_library(sj3core STATIC ${SJ3CORE_SRCS}) add_library(sj3core STATIC ${SJ3CORE_SRCS})
target_include_directories(sj3core PUBLIC include/sj3common include/sj3core) target_include_directories(sj3core PUBLIC include/sj3common include/sj3core)
target_include_directories(sj3core PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(sj3core PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
file(GLOB_RECURSE SJ3MKDIC_SRCS src/sj3mkdic/**.c)
add_executable(sj3mkdic ${SJ3MKDIC_SRCS})
target_include_directories(sj3mkdic PRIVATE include/sj3common include/sj3core)

View file

@ -1,6 +0,0 @@
#ifdef __CONFIG_H__
#define __CONFIG_H__
#define HAVE_STRING_H 1
#endif

View file

@ -34,8 +34,6 @@
*/ */
#include <stdio.h>
#include <sys/types.h>
#include "sj_euc.h" #include "sj_euc.h"
#include "sj3_dict_const.h" #include "sj3_dict_const.h"

View file

@ -34,9 +34,7 @@
*/ */
#include <stdio.h> #include "sj3mkdic.h"
#include <sys/types.h>
static struct gram_code { static struct gram_code {

View file

@ -33,13 +33,6 @@
* $SonyDate: 1995/02/03 07:38:32 $ * $SonyDate: 1995/02/03 07:38:32 $
*/ */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "sj3mkdic.h" #include "sj3mkdic.h"
typedef struct filelist { typedef struct filelist {

View file

@ -34,8 +34,6 @@
*/ */
#include <stdio.h>
#include <sys/types.h>
#include "sj3_dict_struct.h" #include "sj3_dict_struct.h"
#include "sj3mkdic.h" #include "sj3mkdic.h"

View file

@ -37,10 +37,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "sj3_dict_struct.h" #include "sj3_dict_struct.h"
#include "sj3mkdic.h" #include "sj3mkdic.h"

View file

@ -33,10 +33,6 @@
* $SonyDate: 1994/06/03 08:00:37 $ * $SonyDate: 1994/06/03 08:00:37 $
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "sj3_dict_const.h" #include "sj3_dict_const.h"
#include "sj3_dict_struct.h" #include "sj3_dict_struct.h"

View file

@ -33,15 +33,6 @@
* $SonyDate: 1994/12/09 11:27:05 $ * $SonyDate: 1994/12/09 11:27:05 $
*/ */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include "sj3_dict_const.h" #include "sj3_dict_const.h"
#include "sj3mkdic.h" #include "sj3mkdic.h"
@ -200,7 +191,7 @@ getch()
void void
mark_file(FILE *out) mark_file(FILE *out)
{ {
static char pathname[MAXPATHLEN]; static char pathname[512];
static long pos; static long pos;
if (out) { if (out) {

View file

@ -33,10 +33,6 @@
* $SonyDate: 1994/06/03 08:00:39 $ * $SonyDate: 1994/06/03 08:00:39 $
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "sj3_dict_struct.h" #include "sj3_dict_struct.h"
#include "sj3mkdic.h" #include "sj3mkdic.h"

View file

@ -33,12 +33,6 @@
* $SonyDate: 1994/12/09 11:27:05 $ * $SonyDate: 1994/12/09 11:27:05 $
*/ */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include "sj3_dict_struct.h" #include "sj3_dict_struct.h"
#include "Dict.h" #include "Dict.h"

View file

@ -33,10 +33,7 @@
* $SonyDate: 1994/06/03 08:00:42 $ * $SonyDate: 1994/06/03 08:00:42 $
*/ */
#include "sj3mkdic.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void * void *
Malloc(unsigned size) Malloc(unsigned size)

View file

@ -33,10 +33,6 @@
* $SonyDate: 1994/08/17 01:50:26 $ * $SonyDate: 1994/08/17 01:50:26 $
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "sj3_dict_struct.h" #include "sj3_dict_struct.h"
#include "sj3mkdic.h" #include "sj3mkdic.h"

View file

@ -33,11 +33,6 @@
* $SonyDate: 1994/06/03 08:00:44 $ * $SonyDate: 1994/06/03 08:00:44 $
*/ */
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include "sj_euc.h" #include "sj_euc.h"
#include "sj3_dict_const.h" #include "sj3_dict_const.h"
@ -277,7 +272,7 @@ readline()
void void
setline(int (*func)()) setline(void (*func)(int*, int*, int, int*))
{ {
int i; int i;

View file

@ -41,6 +41,8 @@
#ifndef SJ3_DICT_STRUCT_H #ifndef SJ3_DICT_STRUCT_H
#define SJ3_DICT_STRUCT_H #define SJ3_DICT_STRUCT_H
#include <sj_typedef.h>
typedef struct kanji_rec { typedef struct kanji_rec {
int klen; int klen;
u_char *kptr; u_char *kptr;

View file

@ -18,6 +18,12 @@
#define SJ3MKDIC_H #define SJ3MKDIC_H
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "sj3_dict_struct.h" #include "sj3_dict_struct.h"
@ -107,7 +113,7 @@ OffsetRec *real_ofsrec(u_char *);
/* readline.c */ /* readline.c */
int *readline(); int *readline();
void setline(int (*)()); void setline(void (*)(int*, int*, int, int*));
/* string.c */ /* string.c */
int bubun_str(u_char *, int, u_char *, int); int bubun_str(u_char *, int, u_char *, int);

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:00:45 $ * $SonyDate: 1994/06/03 08:00:45 $
*/ */
#include <stdio.h>
#include <sys/types.h>
#include "sj3_dict_const.h" #include "sj3_dict_const.h"
#include "sj3mkdic.h" #include "sj3mkdic.h"

View file

@ -11,3 +11,13 @@ done
find lib/sj3core -name "*.obj" | while read a; do find lib/sj3core -name "*.obj" | while read a; do
echo "+$a" echo "+$a"
done | xargs wlib -q -b -fo -n sj3core.lib done | xargs wlib -q -b -fo -n sj3core.lib
for i in src/sj3mkdic/*.c; do
if [ -f $i.obj ]; then
continue
fi
echo $i
owcc -Iinclude/sj3common -Iinclude/sj3core -bnt -c -o $i.obj $i || exit 1
done
owcc -bnt -o sj3mkdic.exe src/sj3mkdic/*.obj