OSDN Git Service

patch sys/unix
authorSHIRAKATA Kentaro <argrath@ub32.org>
Fri, 25 Dec 2015 09:30:03 +0000 (18:30 +0900)
committerSHIRAKATA Kentaro <argrath@ub32.org>
Sat, 13 Feb 2016 17:26:10 +0000 (02:26 +0900)
sys/unix/Makefile.src
sys/unix/unixmain.c
sys/unix/unixunix.c

index 16d0874..ae45cab 100644 (file)
@@ -58,6 +58,8 @@ SYSOBJ = ioctl.o unixmain.o unixtty.o unixunix.o unixres.o
 #SYSSRC = ../sys/be/bemain.c ../sys/share/unixtty.c ../sys/share/ioctl.c
 #SYSOBJ = bemain.o unixtty.o ioctl.o
 
+JSRC = ../japanese/jconj.c ../japanese/jlib.c
+JOBJ = jconj.o jlib.o
 
 # if you are using gcc as your compiler:
 #      uncomment the CC definition below if it's not in your environment
@@ -330,8 +332,8 @@ HACKCSRC = allmain.c alloc.c apply.c artifact.c attrib.c ball.c bones.c \
           files.c fountain.c hack.c hacklib.c invent.c light.c lock.c \
           mail.c makemon.c mapglyph.c mcastu.c mhitm.c mhitu.c minion.c \
           mklev.c mkmap.c \
-          mkmaze.c mkobj.c mkroom.c mon.c mondata.c monmove.c monst.c \
-          mplayer.c mthrowu.c muse.c music.c o_init.c objects.c objnam.c \
+          mkmaze.c mkobj.c mkroom.c mon.c mondata.c monmove.c monstj.c \
+          mplayer.c mthrowu.c muse.c music.c o_init.c objectsj.c objnam.c \
           options.c pager.c pickup.c pline.c polyself.c potion.c pray.c \
           priest.c quest.c questpgr.c read.c rect.c region.c restore.c rip.c \
           rnd.c role.c rumors.c save.c shk.c shknam.c sit.c sounds.c sp_lev.c \
@@ -362,17 +364,17 @@ CHAINSRC=../win/chain/wc_chainin.c ../win/chain/wc_chainout.c \
 CHAINOBJ=wc_chainin.o wc_chainout.o wc_trace.o
 
 # .c files for this version (for date.h)
-VERSOURCES = $(HACKCSRC) $(SYSSRC) $(WINSRC) $(CHAINSRC) $(GENCSRC)
+VERSOURCES = $(HACKCSRC) $(SYSSRC) $(JSRC) $(WINSRC) $(CHAINSRC) $(GENCSRC)
 
 # .c files for all versions using this Makefile (for lint and tags)
-CSOURCES = $(HACKCSRC) $(SYSCSRC) $(WINCSRC) $(CHAINSRC) $(GENCSRC)
+CSOURCES = $(HACKCSRC) $(SYSCSRC) $(JSRC) $(WINCSRC) $(CHAINSRC) $(GENCSRC)
 
 
 # all .h files except date.h, onames.h, pm.h, and vis_tab.h which would
 # cause dependency loops if run through "make depend"
 # and dgn_comp.h, dgn_file.h, lev_comp.h, special level & dungeon files.
 #
-HACKINCL = align.h amiconf.h artifact.h artilist.h attrib.h beconf.h botl.h \
+HACKINCL = align.h amiconf.h artifact.h artilistj.h attrib.h beconf.h botl.h \
        color.h config.h config1.h context.h coord.h decl.h def_os2.h \
        display.h dlb.h dungeon.h engrave.h extern.h flag.h func_tab.h \
        global.h hack.h lev.h lint.h macconf.h mextra.h mfndpos.h micro.h \
@@ -389,7 +391,7 @@ HSOURCES = $(HACKINCL) date.h onames.h pm.h vis_tab.h\
 # the following .o's _must_ be made before any others (for makedefs)
 FIRSTOBJ = monst.o objects.o
 
-HOBJ = $(FIRSTOBJ) allmain.o alloc.o apply.o artifact.o attrib.o ball.o \
+HOBJ = monstj.o objectsj.o allmain.o alloc.o apply.o artifact.o attrib.o ball.o \
        bones.o botl.o cmd.o dbridge.o decl.o detect.o dig.o display.o dlb.o \
        do.o do_name.o do_wear.o dog.o dogmove.o dokick.o dothrow.o \
        drawing.o dungeon.o eat.o end.o engrave.o exper.o explode.o \
@@ -405,7 +407,7 @@ HOBJ = $(FIRSTOBJ) allmain.o alloc.o apply.o artifact.o attrib.o ball.o \
        steal.o steed.o teleport.o timeout.o topten.o track.o trap.o u_init.o \
        uhitm.o vault.o vision.o vis_tab.o weapon.o were.o wield.o windows.o \
        wizard.o worm.o worn.o write.o zap.o \
-       $(REGEXOBJ) $(RANDOBJ) $(SYSOBJ) $(WINOBJ) $(HINTOBJ) version.o
+       $(REGEXOBJ) $(RANDOBJ) $(JOBJ) $(SYSOBJ) $(WINOBJ) $(HINTOBJ) version.o
 # the .o files from the HACKCSRC, SYSSRC, and WINSRC lists
 
 $(GAME):       $(SYSTEM)
@@ -790,6 +792,8 @@ music.o: music.c $(HACK_H) #interp.c
 o_init.o: o_init.c $(HACK_H) ../include/lev.h
 objects.o: objects.c $(CONFIG_H) ../include/obj.h ../include/objclass.h \
                ../include/prop.h ../include/skills.h ../include/color.h
+objectsj.o: objectsj.c $(CONFIG_H) ../include/obj.h ../include/objclass.h \
+               ../include/prop.h ../include/skills.h ../include/color.h
 objnam.o: objnam.c $(HACK_H)
 options.o: options.c $(CONFIG_H) ../include/objclass.h ../include/flag.h \
                $(HACK_H) ../include/tcap.h
@@ -840,6 +844,10 @@ worm.o: worm.c $(HACK_H) ../include/lev.h
 worn.o: worn.c $(HACK_H)
 write.o: write.c $(HACK_H)
 zap.o: zap.c $(HACK_H)
+jconj.o: ../japanese/jconj.c  ../include/hack.h
+       $(CC) $(CFLAGS) -c ../japanese/jconj.c
+jlib.o: ../japanese/jlib.c  ../include/hack.h
+       $(CC) $(CFLAGS) -c ../japanese/jlib.c
 # DEPENDENCIES MUST END AT END OF FILE
 # IF YOU PUT STUFF HERE IT WILL GO AWAY
 # see make depend above
index 506618f..9be8572 100644 (file)
 #include <fcntl.h>
 #endif
 
+#ifdef XI18N
+#include <X11/Xlocale.h>
+#endif
+
 #if !defined(_BULL_SOURCE) && !defined(__sgi) && !defined(_M_UNIX)
 #if !defined(SUNOS4) && !(defined(ULTRIX) && defined(__GNUC__))
 #if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX)
@@ -58,6 +62,9 @@ char *argv[];
 
     sys_early_init();
 
+#ifdef XI18N
+    setlocale(LC_ALL, "");
+#endif
 #if defined(__APPLE__)
     {
 /* special hack to change working directory to a resource fork when
@@ -147,7 +154,14 @@ char *argv[];
                 panictrace_setsignals(TRUE);
 #endif
 #endif
+#if 0 /*JP*/
+                prscore(argc, argv);
+#else
+                setkcode('I');
+                initoptions();
                 prscore(argc, argv);
+                jputchar('\0'); /* reset */
+#endif
                 exit(EXIT_SUCCESS);
             }
     }
@@ -166,6 +180,13 @@ char *argv[];
 #ifdef __linux__
     check_linux_console();
 #endif
+#if 1 /*JP*/
+    /* Line like "OPTIONS=name:foo-@" may exist in config file.
+     * In this case, need to select random class,
+     * so must call setrandom() before initoptions().
+     */
+    setrandom();
+#endif
     initoptions();
 #ifdef PANICTRACE
     ARGV0 = argv[0]; /* save for possible stack trace */
@@ -277,13 +298,19 @@ attempt_restore:
             iflags.news = FALSE; /* in case dorecover() fails */
         }
 #endif
+/*JP
         pline("Restoring save file...");
+*/
+        pline("\83Z\81[\83u\83t\83@\83C\83\8b\82ð\95\9c\8c³\92\86\81D\81D\81D");
         mark_synch(); /* flush output */
         if (dorecover(fd)) {
             resuming = TRUE; /* not starting new game */
             wd_message();
             if (discover || wizard) {
+/*JP
                 if (yn("Do you want to keep the save file?") == 'n')
+*/
+                if (yn("\83Z\81[\83u\83t\83@\83C\83\8b\82ð\8ec\82µ\82Ä\82¨\82«\82Ü\82·\82©\81H") == 'n')
                     (void) delete_savefile();
                 else {
                     (void) chmod(fq_save, FCMASK); /* back to readable */
@@ -584,14 +611,25 @@ wd_message()
     if (wiz_error_flag) {
         if (sysopt.wizards && sysopt.wizards[0]) {
             char *tmp = build_english_list(sysopt.wizards);
+#if 0 /*JP*/
             pline("Only user%s %s may access debug (wizard) mode.",
                   index(sysopt.wizards, ' ') ? "s" : "", tmp);
+#else
+            pline("\81u%s\81v\82Ì\82Ý\82ª\83f\83o\83b\83O(\83E\83C\83U\81[\83h)\83\82\81[\83h\82ð\8eg\97p\82Å\82«\82é\81D",
+                  tmp);
+#endif
             free(tmp);
         } else
+/*JP
             pline("Entering explore/discovery mode instead.");
+*/
+            pline("\82©\82í\82è\82É\94­\8c©\83\82\81[\83h\82Ö\88Ú\8ds\82·\82é\81D");
         wizard = 0, discover = 1; /* (paranoia) */
     } else if (discover)
+/*JP
         You("are in non-scoring explore/discovery mode.");
+*/
+        You("\83X\83R\83A\82Ì\8dÚ\82ç\82È\82¢\94­\8c©\83\82\81[\83h\82Å\8bN\93®\82µ\82½\81D");
 }
 
 /*
index d02d70c..a84f050 100644 (file)
@@ -162,12 +162,23 @@ getlock()
         (void) close(fd);
 
         if (iflags.window_inited) {
+#if 0 /*JP*/
             c = yn("There is already a game in progress under your name.  "
                    "Destroy old game?");
+#else
+            c = yn("\82 \82È\82½\82Ì\96¼\91O\82Å\95s\90³\8fI\97¹\82µ\82½\83Q\81[\83\80\82ª\8ec\82Á\82Ä\82¢\82Ü\82·\81D"
+                   "\94j\8aü\82µ\82Ü\82·\82©\81H");
+#endif
         } else {
+#if 0 /*JP*/
             (void) printf(
                 "\nThere is already a game in progress under your name.");
             (void) printf("  Destroy old game? [yn] ");
+#else
+            (void) printf(
+                "\n\82 \82È\82½\82Ì\96¼\91O\82Å\95s\90³\8fI\97¹\82µ\82½\83Q\81[\83\80\82ª\8ec\82Á\82Ä\82¢\82Ü\82·\81D");
+            (void) printf("\94j\8aü\82µ\82Ü\82·\82©\81H[yn] ");
+#endif
             (void) fflush(stdout);
             if ((c = getchar()) != EOF) {
                 int tmp;