xim: one file at the top level, keymaplookup in it

xim/keymap.c held one 37-line function apart from xim.c, with its own
prototype typed by hand in xim.c and nelem spelt out because it avoided
dat.h — all so that a test could link it without imdkit, though the XIM
adapter test #includes xim.c whole anyway.  It lives in xim.c now, and
xim.c, the last file of its directory, sits beside ibus.c.
This commit is contained in:
2026-08-17 01:47:40 +09:00
parent 33848709a5
commit 0cb395579f
7 changed files with 94 additions and 130 deletions

View File

@@ -32,14 +32,12 @@ FAULT = daemon_collision_test daemon_failure_test daemon_restart_test
LIVE = $(SMOKE) $(FAULT)
TESTSRC = test_util.c str_test.c trie_test.c \
ko_test.c vi_test.c engine_test.c dict_test.c ipc_test.c \
popup_test.c font_test.c ibus_test.c server_test.c keymap_test.c \
xim_adapter_test.c
popup_test.c font_test.c ibus_test.c server_test.c xim_adapter_test.c
TESTOBJ = $(TESTSRC:.c=.o)
PARENTSRC = str.c trie.c dict.c ko.c vi.c ipc.c popup_layout.c \
font.c
PARENTOBJ = $(PARENTSRC:%.c=unit_%.o)
XIMOBJ = unit_xim_keymap.o
COMMONOBJ = $(TESTOBJ) $(PARENTOBJ) $(XIMOBJ)
COMMONOBJ = $(TESTOBJ) $(PARENTOBJ)
OBJS = unit_test.o stress_test.o $(COMMONOBJ)
all: $(PROG) $(STRESS) $(LIVE)
@@ -123,15 +121,11 @@ unit_test.o stress_test.o $(TESTOBJ): test.h ../dat.h ../fn.h ../ipc.h \
engine_test.o: ../strans.c
ibus_test.o: UNIT_CPPFLAGS += $(IBUS_CFLAGS)
ibus_test.o: ../ibus.c
keymap_test.o xim_adapter_test.o: UNIT_CPPFLAGS += $(XIM_CFLAGS)
xim_adapter_test.o: ../xim/xim.c
xim_adapter_test.o: UNIT_CPPFLAGS += $(XIM_CFLAGS)
xim_adapter_test.o: ../xim.c
server_test.o: ../srv.c
unit_font.o: UNIT_CPPFLAGS += $(TEXT_CFLAGS)
unit_xim_keymap.o: ../xim/keymap.c
$(CC) $(CPPFLAGS) $(UNIT_CPPFLAGS) $(XIM_CFLAGS) $(UNIT_CFLAGS) \
$(CFLAGS) -c -o $@ $<
unit_%.o: ../%.c ../dat.h ../fn.h ../ipc.h
$(CC) $(CPPFLAGS) $(UNIT_CPPFLAGS) $(UNIT_CFLAGS) $(CFLAGS) -c -o $@ $<