Node:Internal structure of kort program, Next:, Previous:Database structure, Up:Top



Internal structure of kort program

Chaos reigns within.
Reflect, repent, and reboot.
Order shall return.1
Err..there is no solutions, there is only adaptation to current situation.

Kort is written in the C language, most important parts of the program are described here: Kort has no data structure that contains values of record fields. Instead curses form library is trusted for this; functions field_buffer and set_field_buffer are widely used. This also means that when user navigates out from a record and back, the values of that record are simply lost, if not saved to database in between.

Data structure record_t contains record definitions. For most part naming in record_t is assumed self-explanatory, with the following exceptions:

Compiling kort

Kort is for most part done in C. "gcc -Wall" doesn't produce serious complaints so in current incarnation the syntax of kort might conform to ansi C somewhat. Parser is written in yacc+lex so you'll need those; actually bison+flex was used but syntax should be the same. Of course thingies that kort tries to glue together must be present. At least one version combination that is known to compile is this:

Kort is not that strict. Kort was successfully compiled in redhat-5.2 with much older versions of the same thingies and with thingies that come in OpenBSD-sparc-2.8 ports-tree. No environment-related problems have been encountered that far. ..except a few issues. At some point the actual data type returned by inet_addr seems to have changed from long to in_addr_t and this is a no-no for compiler. Therefore, if your inet_addr returns long instead of in_addr_t then have a look at file net.c around line 41:
#ifdef LINUX_WITH_GLIBC21_OR_EARLIER
typedef unsigned long in_addr_t  ;
#endif
that may be usable for other systems than old linux boxen too. For redhat-5.2 release this is needed. For 6.0/7.2 it is not. For OpenBSD it is not.

Another thing is location of #include files and different libraries. Right now kort comes with two Makefiles, one works for Linux, another for OpenBSD. Edit one so that it suits your needs. You'll need to link at least -lform -lncurses -lmysqlclient -lfl -ltcl -lm -ldl -lz. Basic stuff is form,ncurses,mysqlclient and tcl. Flex needs -lfl. Mysqlclient seems to require -lz. TCL seems to require -lm and -ldl, at least in Linux. In some systems you'll propably need to include -lgen -lnls -lc but that may have been at times long gone. These libraries may be at perverse locations, as you know. Basically same applies to #include-files so you'll may end up adding -I/dir/ectory -entries to CFLAGS. Have phun :-)

Footnotes

  1. Who would not love Suzie Wagner?

  2. Kicks some serious ass.