diff options
author | dos-reis <gdr@axiomatics.org> | 2007-08-14 05:14:52 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2007-08-14 05:14:52 +0000 |
commit | ab8cc85adde879fb963c94d15675783f2cf4b183 (patch) | |
tree | c202482327f474583b750b2c45dedfc4e4312b1d /src/include | |
download | open-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz |
Initial population.
Diffstat (limited to 'src/include')
66 files changed, 2056 insertions, 0 deletions
diff --git a/src/include/ReadBitmap.H1 b/src/include/ReadBitmap.H1 new file mode 100644 index 00000000..52fd579c --- /dev/null +++ b/src/include/ReadBitmap.H1 @@ -0,0 +1,6 @@ +extern XImage * HTReadBitmapFile(Display * display , int screen , char * filename , int * width , int * height); +extern ImageStruct * insert_image_struct(char * filename); +#ifdef _READBITMAP_C +static int read_hot(FILE * fd , char Line[] , int * x_hot , int * y_hot); +static int read_w_and_h(FILE * fd , unsigned int * width , unsigned int * height); +#endif diff --git a/src/include/XDither.H1 b/src/include/XDither.H1 new file mode 100644 index 00000000..e14e1d63 --- /dev/null +++ b/src/include/XDither.H1 @@ -0,0 +1,8 @@ +extern int dither_char_bitmap(void); +extern int XInitDither(Display * , int , GC , unsigned long , unsigned long ); +extern int XChangeDither(Display * , GC , int ); +extern void XDitherRectangle(Display * , Drawable , GC , int , int , unsigned int , unsigned int ); +extern void XDitherRectangles(Display * , Drawable , GC , XRectangle * , int ); +extern void XDitherPolygon(Display * , Drawable , GC , XPoint * , int , int , int ); +extern void XDitherArc(Display * , Drawable , GC , int , int , unsigned int , unsigned int , int , int ); +extern void XDitherArcs(Display * , Drawable , GC , XArc * , int ); diff --git a/src/include/XShade.H1 b/src/include/XShade.H1 new file mode 100644 index 00000000..7a91a767 --- /dev/null +++ b/src/include/XShade.H1 @@ -0,0 +1,9 @@ +extern int char_bitmap(void); +extern int XInitShades(Display * , int ); +extern int XChangeShade(Display * , int ); +extern int XQueryShades(unsigned int * ); +extern void XShadeRectangle(Display * , Drawable , int , int , unsigned int , unsigned int ); +extern void XShadeRectangles(Display * , Drawable , XRectangle * , int ); +extern void XShadePolygon(Display * , Drawable , XPoint * , int , int , int ); +extern void XShadeArc(Display * , Drawable , int , int , unsigned int , unsigned int , int , int ); +extern void XShadeArcs(Display * , Drawable , XArc * , int ); diff --git a/src/include/XSpadFill.H1 b/src/include/XSpadFill.H1 new file mode 100644 index 00000000..881a18d5 --- /dev/null +++ b/src/include/XSpadFill.H1 @@ -0,0 +1,9 @@ +extern int XInitSpadFill(Display * , int , Colormap * , int * , int * , int * , int * ); +extern void XSpadFillSetArcMode(Display * , int ); +extern GC SpadFillGC(Display * , int , int , char * ); +extern unsigned long XSolidColor(int , int ); +extern void XSpadFillRectangle(Display * , Drawable , int , int , unsigned int , unsigned int , int , int ); +extern void XSpadFillRectangles(Display * , Drawable , XRectangle * , int , int , int ); +extern void XSpadFillPolygon(Display * , Drawable , XPoint * , int , int , int , int , int ); +extern void XSpadFillArc(Display * , Drawable , int , int , unsigned int , unsigned int , int , int , int , int ); +extern void XSpadFillArcs(Display * , Drawable , XArc * , int , int , int ); diff --git a/src/include/addfile.H1 b/src/include/addfile.H1 new file mode 100644 index 00000000..323a3c62 --- /dev/null +++ b/src/include/addfile.H1 @@ -0,0 +1,10 @@ +extern FILE * db_file_open(char * db_file); +extern void extend_ht(char * name); +extern FILE * ht_file_open(char * fname , char * aname , char * name); +extern FILE * temp_file_open(char * temp_db_file); +#ifdef _ADDFILE_C +static int build_ht_filename(char * fname , char * aname , char * name); +static int pathname(char * name); +static int strpostfix(char * s , char * t); +#endif + diff --git a/src/include/all_hyper_proto.H1 b/src/include/all_hyper_proto.H1 new file mode 100644 index 00000000..343703bd --- /dev/null +++ b/src/include/all_hyper_proto.H1 @@ -0,0 +1,32 @@ +#include "addfile.H1" +#include "ReadBitmap.H1" +#include "dialog.H1" +#include "cond.H1" +#include "display.H1" +#include "event.H1" +#include "ex2ht.H1" +#include "form_ext.H1" +#include "extent1.H1" +#include "extent2.H1" +#include "halloc.H1" +#include "group.H1" +#include "hterror.H1" +#include "htinp.H1" +#include "hyper.H1" +#include "initx.H1" +#include "input.H1" +#include "keyin.H1" +#include "item.H1" +#include "lex.H1" +#include "parse.H1" +#include "macro.H1" +#include "parse_paste.H1" +#include "parse_aux.H1" +#include "parse_input.H1" +#include "show_types.H1" +#include "parse_types.H1" +#include "scrollbar.H1" +#include "titlebar.H1" +#include "spadint.H1" +#include "hash.H1" +#include "mem.H1" diff --git a/src/include/bsdsignal.H1 b/src/include/bsdsignal.H1 new file mode 100644 index 00000000..621b9307 --- /dev/null +++ b/src/include/bsdsignal.H1 @@ -0,0 +1 @@ +extern SignalHandlerFunc bsdSignal(int , SignalHandlerFunc , int ); diff --git a/src/include/bsdsignal.h b/src/include/bsdsignal.h new file mode 100644 index 00000000..e42e0fee --- /dev/null +++ b/src/include/bsdsignal.h @@ -0,0 +1,44 @@ +/* +Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _BSDSIGNAL_H_ +#define _BSDSIGNAL_H_ + + +#define RestartSystemCalls 1 +#define DontRestartSystemCalls 0 + + +typedef void (* SignalHandlerFunc)(int); + +#endif /* _BSDSIGNAL */ diff --git a/src/include/cfuns-c.H1 b/src/include/cfuns-c.H1 new file mode 100644 index 00000000..cb580a64 --- /dev/null +++ b/src/include/cfuns-c.H1 @@ -0,0 +1,7 @@ +extern int addtopath(char * ); +extern int directoryp(char * ); +extern int make_path_from_file(char * , char * ); +extern int writeablep(char * ); +extern int readablep(char * ); +extern long findString(char * , char * ); +extern int copyEnvValue(char * , char * ); diff --git a/src/include/com.h b/src/include/com.h new file mode 100644 index 00000000..9dfca2d1 --- /dev/null +++ b/src/include/com.h @@ -0,0 +1,160 @@ +/* +Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef AXIOM_COM_H_INCLUDED +#define AXIOM_COM_H_INCLUDED + +#ifdef __MINGW32__ +# include <winsock2.h> +#else +# include <sys/types.h> +# include <sys/socket.h> +# include <netinet/in.h> +#endif + +#include "axiom-c-macros.h" + +/* On Windows, a socket identifier is not a file descriptor. It is + represented by an integer type, but that integer type is not just + plain int as in the Unix world. It is an unsigned integer. + Consequently, we abstract over that variation, using the typedef + axiom_socket. */ + +#ifdef __MINGW32__ +typedef SOCKET axiom_socket; +#else +typedef int axiom_socket; +#endif + + +/* Close a socket communication endpoint. */ +extern void axiom_close_socket(axiom_socket); + +typedef struct { + axiom_socket socket; /* socket number returned by "socket" call */ + int type; /* socket type (AF_UNIX or AF_INET) */ + int purpose; /* can be SessionManager, GraphicsServer, etc. */ + int pid; /* process ID of connected socket */ + int frame; /* spad interpreter frame (for interpreter windows) */ + axiom_socket remote; /* file descriptor of remote socket */ + union { + struct sockaddr u_addr; + struct sockaddr_in i_addr; + } addr; + char *host_name; /* name of foreign host if type == AF_INET */ +} Sock; + + +#define MaxClients 150 + +/* possible socket types (purpose) */ + +#define SessionManager 1 +#define ViewportServer 2 +#define MenuServer 3 +#define SessionIO 4 +#define BaloonServer 5 +#define InterpWindow 6 +#define KillSpad 7 +#define DebugWindow 8 /* used for nagman */ +#define Forker 9 +#define AV 10 /*Simon's algebraic viewer */ + +#define Acknowledge 255 + +/* Timeout value for connection to remote socket */ + +#define Forever 0 + +/* Socket name for local AXIOM server and session manager */ + +#define SpadServer "/tmp/.d" +#define SessionServer "/tmp/.s" +#define SessionIOName "/tmp/.i" +#define MenuServerName "/tmp/.h" +#define ForkServerName "/tmp/.f" + + +#define MASK_SIZE (NBBY*sizeof(fd_set)) + + +/* table of dedicated socket types */ + +extern Sock *purpose_table[]; +extern Sock server[]; +extern Sock clients[]; +extern fd_set socket_mask; +extern fd_set server_mask; + +/* Commands sent over the AXIOM session manager or menu socket */ + +#define CreateFrame 1 +#define SwitchFrames 2 +#define EndOfOutput 3 +#define CallInterp 4 +#define EndSession 5 +#define LispCommand 6 +#define SpadCommand 7 +#define SendXEventToHyperTeX 8 +#define QuietSpadCommand 9 +#define CloseClient 10 +#define QueryClients 11 +#define QuerySpad 12 +#define NonSmanSession 13 +#define KillLispSystem 14 + +/* Commands from AXIOM menu server to interpreter windows */ + +#define ReceiveInputLine 100 +#define TestLine 101 + + +/* It is idiomatic in the Unix/POSIX world to use the standard + read() and write() functions on sockets. However, in the Windows + world, that is invalid. Consequently, portability suggests that + we restrict ourselves to the POSIX standard functions recv() and + send(). */ + +static inline int +axiom_write(Sock* s, const char* buf, size_t n) +{ + return send(s->socket, buf, n, 0); +} + +static inline int +axiom_read(Sock* s, char* buf, size_t n) +{ + return recv(s->socket, buf, n, 0); +} + +#endif diff --git a/src/include/cond.H1 b/src/include/cond.H1 new file mode 100644 index 00000000..a2843d4e --- /dev/null +++ b/src/include/cond.H1 @@ -0,0 +1,6 @@ +extern void change_cond(char * label , char * newcond); +extern int check_condition(TextNode * node); +extern void insert_cond(char * label , char * cond); +#ifdef _COND_C +static int check_memostack(TextNode * node); +#endif diff --git a/src/include/cursor.H1 b/src/include/cursor.H1 new file mode 100644 index 00000000..090e0573 --- /dev/null +++ b/src/include/cursor.H1 @@ -0,0 +1 @@ +extern int Cursor_shape(int ); diff --git a/src/include/debug.h b/src/include/debug.h new file mode 100644 index 00000000..c2dd9861 --- /dev/null +++ b/src/include/debug.h @@ -0,0 +1,36 @@ +/* +Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* redefine free */ +/* #define free hfree*/ + diff --git a/src/include/dialog.H1 b/src/include/dialog.H1 new file mode 100644 index 00000000..db5257ad --- /dev/null +++ b/src/include/dialog.H1 @@ -0,0 +1,33 @@ +extern void add_buffer_to_sym(char * buffer , InputItem * sym); +extern void dialog(XEvent * event , KeySym keysym , char * buffer); +extern void draw_inputsymbol(InputItem * sym); +extern void update_inputsymbol(InputItem * sym); +#ifdef _DIALOG_C +static void back_over_char(InputItem * sym); +static void back_over_eoln(InputItem * sym); +static void clear_cursor(InputItem * sym); +static void clear_cursorline(InputItem * sym); +static void dec_line_numbers(LineStruct * line); +static void decrease_line_numbers(LineStruct * line , int am); +static void delete_char(InputItem * sym); +static void delete_eoln(InputItem * sym); +static int delete_one_char(InputItem * sym); +static void delete_rest_of_line(InputItem * sym); +static void draw_cursor(InputItem * sym); +static void enter_new_line(InputItem * sym); +static void inc_line_numbers(LineStruct * line); +static void insert_buffer(char * buffer , InputItem * sym); +static int move_back_one_char(InputItem * sym); +static void move_cursor_backward(InputItem * sym); +static void move_cursor_down(InputItem * sym); +static void move_cursor_end(InputItem * sym); +static void move_cursor_forward(InputItem * sym); +static void move_cursor_home(InputItem * sym); +static void move_cursor_up(InputItem * sym); +static char move_rest_back(LineStruct * line , int size); +static int move_sym_forward(LineStruct * line , int num , int size , InputItem * sym); +static char * mystrncpy(char * buff1 , char * buff2 , int n); +static void overwrite_buffer(char * buffer , InputItem * item); +static void redraw_win(void); +static void tough_enter(InputItem * sym); +#endif diff --git a/src/include/display.H1 b/src/include/display.H1 new file mode 100644 index 00000000..8ccc2af5 --- /dev/null +++ b/src/include/display.H1 @@ -0,0 +1,4 @@ +extern void expose_page(HyperDocPage * page); +extern void paste_page(TextNode * node); +extern void scroll_page(HyperDocPage * page); +extern void show_page(HyperDocPage * page); diff --git a/src/include/edible.H1 b/src/include/edible.H1 new file mode 100644 index 00000000..d61da787 --- /dev/null +++ b/src/include/edible.H1 @@ -0,0 +1,13 @@ +extern void check_flip(void); +extern int main(int , char * []); +extern void catch_signals(void); +extern void init_parent(void); +extern void set_function_chars(void); +extern void hangup_handler(int ); +extern void terminate_handler(int ); +extern void interrupt_handler(int ); +extern void child_handler(int ); +extern void alarm_handler(int ); +extern void flip_canonical(int ); +extern void flip_raw(int ); +extern void etc_get_next_line(char * , int * , int ); diff --git a/src/include/edible.h b/src/include/edible.h new file mode 100644 index 00000000..99340a5e --- /dev/null +++ b/src/include/edible.h @@ -0,0 +1,222 @@ +/* +Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +extern int contNum; +extern struct termios childbuf; /** the childs normal operating termio ***/ + +/*** the terminals mapping of the function keys ***/ +extern unsigned char _INTR, _QUIT, _ERASE, _KILL, _EOF, _EOL, _RES1, _RES2; +extern short INS_MODE ; /** Flag for insert mode **/ +extern short ECHOIT; /** Flag for echoing **/ +extern short PTY; /* A flag which lets me know whether or not I am + talking to a socket or a pty. If I am not + talking to a PTY then I have to do things like echo + back newlines, and send interuppts with an eoln + */ +/*************************************************************************** + Here are the key mapping my routines need +****************************************************************************/ + + +#define _ESC 0X1B /** A character sent before every arrow key ***/ +#define _LBRACK 0X5B /** [ **/ +#define _EOLN '\n' /** eoln **/ +#define _CR 0X0D /** cr **/ +#define _BLANK 0X20 /** blank **/ +#define _BKSPC 0X08 /** backspace **/ +#define _DEL 0X7F /** delete **/ +#define _BELL 0X07 /*** ring the bell **/ +#define _INT 0X7F /*** interrupt **/ +#define _SQUASH 0X03 /** kill my process **/ +#define _CNTRL_W 0X17 /** cntrl-w, to back up a word **/ +#define _CARROT 0X5E /** circumflex **/ +#define _TAB 0X09 /** tab forward **/ + +#ifndef WCT +#define _A 0X41 /** A **/ +#define _B 0X42 /** B **/ +#define _C 0X43 /** C **/ +#define _D 0X44 /** D **/ +#define _Z 0X5A /** Z **/ +#define _H 0X48 /** H **/ +#define _M 0X4D /** M **/ +#define _x 0X78 /** x **/ +#define _z 0X7A /*** z **/ +#define _twiddle 0X7E /*** ~ **/ +#define _P 0X50 /*** P **/ +#define _1 0X31 /*** 1 **/ +#define _2 0X32 /*** 2 **/ +#define _3 0X33 /*** 3 **/ +#define _4 0X34 /*** 4 **/ +#define _5 0X35 /*** 5 **/ +#define _6 0X36 /*** 6 **/ +#define _7 0X37 /*** 7 **/ +#define _8 0X38 /*** 8 **/ +#define _9 0X39 /*** 9 **/ +#define _0 0X30 /*** 0 **/ +#define _q 0X71 /*** q **/ +#endif + + + +#define MAXLINE 1024 /** maximum chars. on a line ***/ +#define MAXBUFF 64 /** maximum lines saved in the buffer + queue ***/ + +/*** Here are the constants for my three different modes. ******/ +#define CLEFRAW 0 +#define CLEFCANONICAL 1 +#define CLEFCBREAK 2 + +extern int mode; /** One of the above # defines *****/ + +/** Here is the structure for storing bound pf-keys ***/ +typedef struct Fkey +{ + char *str; + short type; +} fkey; + +extern fkey function_key[13] ; /** strings which replace function + keys when a key is hit ***/ + + +extern char editorfilename[]; + +/**** Here are a bunch of constant, variable and function defs for edin.c */ +#define UP 0 /** Tells the replace buffer command ***/ +#define DOWN 1 /** to look up or down **/ + +#define inc(x) ((x+1)%MAXBUFF) /** returns the increment of the presented + pointer ***/ +#define dec(x) ( ((x-1) < 0) ?(MAXBUFF - 1):(x-1))/** ibid for decrementing */ + +#define flip(x) (x?(x=0):(x=1)) /*** flip the bit ***/ + +/* + All the previous commands will now be stored in a double linked list. + This way when I type a command I just have to circle through this list +*/ +typedef struct que_struct { + char buff[1024]; + int flags[1024]; + struct que_struct *prev, *next; + } QueStruct; + +typedef struct wct { + char *fname; + off_t fsize; + time_t ftime; + char *fimage; + int wordc; + char **wordv; + + struct wct *next; +} Wct; + +typedef struct wix { + Wct *pwct; + int word; +} Wix; + + +extern QueStruct *ring; +extern QueStruct *current; +extern int ring_size; +extern int prev_check; +extern int MAXRING; + +extern char buff[MAXLINE]; /** Buffers for collecting input and **/ +extern int buff_flag[MAXLINE]; /** flags for whether buff chars + are printing + or non-printing **/ + +extern char in_buff[1024]; /** buffer for characters read until they are + processed **/ +extern int num_read; +extern int num_proc; /** num chars processed after a read **/ +extern int buff_pntr; /** present length of buff **/ +extern int curr_pntr; /** the current position in buff **/ + +/** Here are a bunch of macros for edin.c. They are mostly just charcter + comparison stuff ***/ +#define back_word(x) (((*(x) == _5) && (*(x+1) == _9) && \ + (*(x+2) == _q))?(1):(0)) + +#define fore_word(x) (((*(x) == _6) && (*(x+1) == _8) && \ + (*(x+2) == _q))?(1):(0)) + +#define alt_f1(x) (((*(x) == _3) && (*(x+1) == _7) && \ + (*(x+2) == _q))?(1):(0)) + +#define cntrl_end(x) (((*(x) == _4) && (*(x+1) == _8) && \ + (*(x+2) == _q))?(1):(0)) + +#define insert_toggle(x) (((*(x) == _3) && (*(x+1) == _9) && \ + (*(x+2) == _q))?(1):(0)) + +#define end_key(x) (((*(x) == _4) && (*(x+1) == _6) && \ + (*(x+2) == _q))?(1):(0)) + +#define control_char(x) \ + (((x >= 0x01) && (x <= 0x1a))?(1):(0)) + + + +/*** + Some global defs needed for emulating a pty. This was taken from guru.h +***/ + + + +/* Return an integer that is represented by a character string */ +#define ciret(x) ((cintu.c4[0]=(x)[0]), (cintu.c4[1]=(x)[1]), \ + (cintu.c4[2]=(x)[2]), (cintu.c4[3]=(x)[3]), cintu.i4) + +/* move an integer (x) to a character string (y) */ + +#define icmove(x, y) ((cintu.i4=(x)), ((y)[0]=cintu.c4[0]), \ + ((y)[1]=cintu.c4[1]), ((y)[2]=cintu.c4[2]), \ + ((y)[3]=cintu.c4[3])) + +/* Return an integer that may not be on an integer boundary */ +#define iiret(x) ciret(((char *)&(x))) + + /* Min of two expressions */ +#define min(x, y) ((x)<(y)?(x):(y)) + + /* Max of two expressions */ +#define max(x, y) ((x)>(y)?(x):(y)) + + + diff --git a/src/include/edin.H1 b/src/include/edin.H1 new file mode 100644 index 00000000..5e5cf563 --- /dev/null +++ b/src/include/edin.H1 @@ -0,0 +1,17 @@ +extern void init_reader(void); +extern void init_flag(int * , int ); +extern void do_reading(void); +extern void send_line_to_child(void); +extern void insert_buff_nonprinting(int ); +extern void prev_buff(void); +extern void next_buff(void); +extern void insert_buff_printing(int ); +extern void insert_queue(void); +extern int convert_buffer(char * , char * , int * , int ); +extern void init_buff(char * , int ); +extern void forwardcopy(char * , char * , int ); +extern void forwardflag_cpy(int * ,int * , int ); +extern void flagcpy(int * , int * ); +extern void flagncpy(int * , int * , int ); +extern void send_function_to_child(void); +extern void send_buff_to_child(int ); diff --git a/src/include/event.H1 b/src/include/event.H1 new file mode 100644 index 00000000..f748adbf --- /dev/null +++ b/src/include/event.H1 @@ -0,0 +1,34 @@ +extern void exitHyperDoc(void ); +extern void helpForHyperDoc(void ); +extern void mainEventLoop(void ); +extern void make_window_link(char * name); +extern void quitHyperDoc(void ); +extern void get_new_window(void ); +#ifdef _EVENT_C +static void set_cursor(HDWindow * window , Cursor state); +static void change_cursor(Cursor state , HDWindow * window); +static void create_window(void ); +static void downlink(void ); +static HyperDocPage * find_page(TextNode * node); +static void handle_button(int button , XButtonEvent * event); +static void handle_event(XEvent * event); +static void handle_motion_event(XMotionEvent * event); +static int HyperDocErrorHandler(Display * display , XErrorEvent * xe); +static void init_cursor_states(void ); +static void killAxiomPage(HyperDocPage * page); +static void make_busy_cursor(HDWindow * window); +static void make_busy_cursors(void ); +static void memolink(void ); +static void set_error_handlers(void ); +static int set_window(Window window); +static void clear_exposures(Window w); +static void kill_page(HyperDocPage * page); +static HyperDocPage * returnlink(void ); +static HyperDocPage * uplink(void ); +static void windowlink_handler(TextNode * node); +static void lispwindowlink_handler(HyperLink * link); +static HyperDocPage * paste_button(PasteNode * paste); +static HyperLink * findButtonInList(HDWindow * window , int x , int y); +static HyperLink * get_hyper_link(XButtonEvent * event); +static void init_cursor_state(HDWindow * window); +#endif diff --git a/src/include/ex2ht.H1 b/src/include/ex2ht.H1 new file mode 100644 index 00000000..2dc0334d --- /dev/null +++ b/src/include/ex2ht.H1 @@ -0,0 +1,14 @@ +extern int main(int argc , char * * argv); +extern void openCoverPage(void); +extern void exToHt(char * filename); +extern void closeCoverPage(void); +extern void addFile(char * filename); +extern void closeCoverFile(void); +extern char * allocString(char * s); +extern char * strPrefix(char * prefix , char * s); +extern char * getExTitle(FILE * inFile , char * line); +extern void emitCoverLink(char * name , char * title); +extern void emitHeader(FILE * outFile , char * pageName , char * pageTitle); +extern void emitMenuEntry(char * line , FILE * outFile); +extern void emitSpadCommand(char * line , char * prefix , FILE * outFile); +extern void emitFooter(FILE * outFile); diff --git a/src/include/extent1.H1 b/src/include/extent1.H1 new file mode 100644 index 00000000..aae58d18 --- /dev/null +++ b/src/include/extent1.H1 @@ -0,0 +1,37 @@ +extern void compute_header_extent(HyperDocPage * page); +extern void compute_footer_extent(HyperDocPage * page); +extern void compute_scrolling_extent(HyperDocPage * page); +extern void compute_title_extent(HyperDocPage * page); +extern void compute_text_extent(TextNode * node); +#ifdef _EXTENT1_C +static void compute_begin_items_extent(TextNode * node); +static void compute_bf_extent(TextNode * node); +static void compute_box_extent(TextNode * node); +static void compute_button_extent(TextNode * node); +static void compute_center_extent(TextNode * node); +static void compute_dash_extent(TextNode * node); +static void compute_em_extent(TextNode * node); +static void compute_ifcond_extent(TextNode * node); +static void compute_image_extent(TextNode * node); +static void compute_input_extent(TextNode * node); +static void compute_ir_extent(TextNode * node); +static void compute_it_extent(TextNode * node); +static void compute_item_extent(TextNode * node); +static void compute_mbox_extent(TextNode * node); +static void compute_mitem_extent(TextNode * node); +static void compute_paste_extent(TextNode * node); +static void compute_pastebutton_extent(TextNode * node); +static void compute_punctuation_extent(TextNode * node); +static void compute_rm_extent(TextNode * node); +static void compute_spadcommand_extent(TextNode * node); +static void compute_spadsrc_extent(TextNode * node); +static void compute_spadsrctxt_extent(TextNode * node); +static void compute_table_extent(TextNode * * node); +static void compute_verbatim_extent(TextNode * node); +static void compute_word_extent(TextNode * node); +static void end_spadcommand_extent(TextNode * node); +static void end_spadsrc_extent(TextNode * node); +static void endbutton_extent(TextNode * node); +static void endif_extent(TextNode * node); +static void endpastebutton_extent(TextNode * node); +#endif diff --git a/src/include/extent2.H1 b/src/include/extent2.H1 new file mode 100644 index 00000000..c8d20d13 --- /dev/null +++ b/src/include/extent2.H1 @@ -0,0 +1,23 @@ +extern void init_extents(void ); +extern void init_text(void ); +extern void init_title_extents(HyperDocPage * page); +extern void insert_bitmap_file(TextNode * node); +extern void insert_pixmap_file(TextNode * node); +extern int max_x(TextNode * node , int Ender); +extern int plh(int height); +extern void start_newline(int distance , TextNode * node); +extern int text_height(TextNode * node , int Ender); +extern int text_width(TextNode * node , int Ender); +extern int total_width(TextNode * node , int Ender); +extern int trailing_space(TextNode * node); +#ifdef _EXTENT2_C +static void center_nodes(TextNode * begin_node , TextNode * end_node); +static int input_string_width(TextNode * node); +static int punctuation_width(TextNode * node); +static int text_height1(TextNode * node , int Ender); +static int verbatim_width(TextNode * node); +static int width_of_dash(TextNode * node); +static int word_width(TextNode * node); +static int x_value(TextNode * node); +#endif + diff --git a/src/include/fnct_key.H1 b/src/include/fnct_key.H1 new file mode 100644 index 00000000..cf920e85 --- /dev/null +++ b/src/include/fnct_key.H1 @@ -0,0 +1,6 @@ +extern void set_editor_key(void); +extern void define_function_keys(void); +extern int get_key(int , char * ); +extern int get_str(int , char * ); +extern void null_fnct(int ); +extern void handle_function_key(int , int ); diff --git a/src/include/form_ext.H1 b/src/include/form_ext.H1 new file mode 100644 index 00000000..c4c2db71 --- /dev/null +++ b/src/include/form_ext.H1 @@ -0,0 +1,8 @@ +extern void compute_form_page(HyperDocPage * page); +extern int window_width(int cols); +#ifdef _FORM_EXT_C +static int window_height(HyperDocPage * page); +static void form_header_extent(HyperDocPage * page); +static void form_footer_extent(HyperDocPage * page); +static void form_scrolling_extent(HyperDocPage * page); +#endif diff --git a/src/include/group.H1 b/src/include/group.H1 new file mode 100644 index 00000000..99c15afd --- /dev/null +++ b/src/include/group.H1 @@ -0,0 +1,14 @@ +extern void bf_top_group(void ); +extern GroupItem * copy_group_stack(void ); +extern void em_top_group(void ); +extern void free_group_stack(GroupItem * g); +extern void init_group_stack(void ); +extern void init_top_group(void ); +extern void line_top_group(void ); +extern int pop_group_stack(void ); +extern void push_active_group(void ); +extern void push_group_stack(void ); +extern void push_spad_group(void ); +extern void rm_top_group(void ); +extern void tt_top_group(void ); +extern void center_top_group(void ); diff --git a/src/include/halloc.H1 b/src/include/halloc.H1 new file mode 100644 index 00000000..717a7d0f --- /dev/null +++ b/src/include/halloc.H1 @@ -0,0 +1 @@ +extern char * halloc(int bytes , char * msg); diff --git a/src/include/hash.H1 b/src/include/hash.H1 new file mode 100644 index 00000000..2028b961 --- /dev/null +++ b/src/include/hash.H1 @@ -0,0 +1,12 @@ +extern char * alloc_string(char * str); +extern HashEntry * hash_copy_entry(HashEntry * e); +extern HashTable * hash_copy_table(HashTable * table); +extern void hash_delete(HashTable * table , char * key); +extern char * hash_find(HashTable * table , char * key); +extern void hash_init(HashTable * table , int size , EqualFunction equal ,HashcodeFunction hash_code); +extern void free_hash(HashTable * table , FreeFunction free_fun); +extern void hash_insert(HashTable * table , char * data , char * key); +extern void hash_map(HashTable * table , MappableFunction func); +extern char * hash_replace(HashTable * table , char * data , char * key); +extern int string_equal(char * s1 , char * s2); +extern int string_hash(char * s , int size); diff --git a/src/include/hash.h b/src/include/hash.h new file mode 100644 index 00000000..87b34610 --- /dev/null +++ b/src/include/hash.h @@ -0,0 +1,57 @@ +/* +Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _HASH_H_ +#define _HASH_H_ 1 + + + +typedef struct hash_entry { + char *key; /* pointer to key data */ + char *data; /* Pointer to entry */ + struct hash_entry *next; /* Link to next entry */ +} HashEntry; + +typedef int (*EqualFunction)(void *,void *); +typedef int (*HashcodeFunction)(void *,int); +typedef void (*MappableFunction) (void *); +typedef void (*FreeFunction) (void *); +typedef struct { + HashEntry **table; /* the actual table */ + int size; /* size of table */ + int num_entries; /* number of elements in a hash table */ + EqualFunction equal; /* equality predicate for keys */ + HashcodeFunction hash_code; /* create hash code for a key */ +} HashTable; + +#endif diff --git a/src/include/htadd.H1 b/src/include/htadd.H1 new file mode 100644 index 00000000..22ee5487 --- /dev/null +++ b/src/include/htadd.H1 @@ -0,0 +1,13 @@ +extern int main(int argc , char * * argv); +#ifdef _HTADD_C +static void add_file(char * dbname , char * name , int fresh); +static void add_new_pages(FILE * temp_db , FILE * new_file , char * addname , char * fullname); +static int build_db_filename(short flag , char * db_dir , char * dbfilename); +static void copy_file(char * f1 , char * f2); +static void delete_db(FILE * db , FILE * temp_db , char * name); +static int delete_file(char * dbname , char * name); +static void get_filename(void); +static void parse_args(char * * argv , char * db_dir , char * * filenames , short * fl); +static void update_db(FILE * db , FILE * temp_db , FILE * new_file , char * addname , char * fullname , int fresh); +static int writable(struct stat buff); +#endif diff --git a/src/include/hterror.H1 b/src/include/hterror.H1 new file mode 100644 index 00000000..128f8711 --- /dev/null +++ b/src/include/hterror.H1 @@ -0,0 +1,6 @@ +extern void print_page_and_filename(void ); +extern void jump(void ); +extern void print_token(void ); +extern void token_name(int type); +extern void print_next_ten_tokens(void ); +extern void htperror(char * msg , int errno); diff --git a/src/include/hthits.H1 b/src/include/hthits.H1 new file mode 100644 index 00000000..f210bb49 --- /dev/null +++ b/src/include/hthits.H1 @@ -0,0 +1,12 @@ +extern void regerr(int code); +extern int main(int argc , char * * argv); +extern void cmdline(int argc , char * * argv); +extern void handleHtdb(void); +extern void badDB(void); +extern void handleFile(FILE * htdbFile); +extern void handleFilePages(char * fname , int pgc , PgInfo * pgv); +extern void handlePage(FILE * infile , PgInfo * pg); +extern void splitpage(char * buf , char * * ptitle , char * * pbody); +extern void untexbuf(register char * s); +extern void searchPage(char * pgname , char * pgtitle , char * pgbody); +extern void squirt(char * s , int n); diff --git a/src/include/htinp.H1 b/src/include/htinp.H1 new file mode 100644 index 00000000..dbd87d65 --- /dev/null +++ b/src/include/htinp.H1 @@ -0,0 +1,18 @@ +extern void ht2_input(void ); +extern void make_record(void ); +extern void verify_record(void ); +extern char * strCopy(char * s); +extern void print_paste_line(FILE * pfile , char * str); +extern void get_spad_output(FILE * pfile , char * command , int com_type); +extern void get_graph_output(char * command , char * pagename , int com_type); +#ifdef _HTINP_C +static void make_input_file_list(void ); +static char * make_input_file_name(char * buf , char * filename); +static char * make_paste_file_name(char * buf , char * filename); +static void make_the_input_file(UnloadedPage * page); +static void make_input_file_from_page(HyperDocPage * page); +static int inListAndNewer(char * inputFile , char * htFile); +static void print_paste(FILE * pfile , char * realcom , char * command , char * pagename , int com_type); +static void print_graph_paste(FILE * pfile , char * realcom , char * command , char * pagename , int com_type); +static void send_command(char * command , int com_type); +#endif diff --git a/src/include/hyper.H1 b/src/include/hyper.H1 new file mode 100644 index 00000000..e0350f6a --- /dev/null +++ b/src/include/hyper.H1 @@ -0,0 +1,10 @@ +extern void sigusr2_handler(int sig); +extern void sigcld_handler(int sig); +extern void clean_socket(void); +extern int main(int argc , char * * argv); +extern void init_page_structs(HDWindow * w); +#ifdef _HYPER_C +static void init_hash(void); +static void make_server_connections(void); +static void check_arguments(void); +#endif diff --git a/src/include/initx.H1 b/src/include/initx.H1 new file mode 100644 index 00000000..347d99ff --- /dev/null +++ b/src/include/initx.H1 @@ -0,0 +1,17 @@ +extern void change_text(int color , XFontStruct * font); +extern int init_form_window(char * name , int cols); +extern int init_top_window(char * name); +extern void initializeWindowSystem(void); +extern int is_it_850(XFontStruct * fontarg); +#ifdef _INITX_C +static void get_GCs(HDWindow * window); +static int get_border_properties(void); +static int get_color(char * name , char * class , int def , Colormap * map); +static void ingItColors_and_fonts(void); +static void load_font(XFontStruct * * font_info , char * fontname); +static void mergeDatabases(void); +static void open_form_window(void); +static void open_window(Window w); +static void set_name_and_icon(void); +static void set_size_hints(Window w); +#endif diff --git a/src/include/input.H1 b/src/include/input.H1 new file mode 100644 index 00000000..99f79a35 --- /dev/null +++ b/src/include/input.H1 @@ -0,0 +1,11 @@ +extern InputItem * return_item(char * name); +extern void fill_box(Window w , ImageStruct * image); +extern void toggle_input_box(HyperLink * link); +extern void toggle_radio_box(HyperLink * link); +extern void change_input_focus(HyperLink * link); +extern void next_input_focus(void); +extern void prev_input_focus(void); +extern int delete_item(char * name); +#ifdef _INPUT_C +static void clear_rbs(InputBox * list); +#endif diff --git a/src/include/item.H1 b/src/include/item.H1 new file mode 100644 index 00000000..e462d98f --- /dev/null +++ b/src/include/item.H1 @@ -0,0 +1,5 @@ +extern void push_item_stack(void); +extern void clear_item_stack(void); +extern void pop_item_stack(void); +extern ItemStack * copy_item_stack(void); +extern void free_item_stack(ItemStack * is); diff --git a/src/include/keyin.H1 b/src/include/keyin.H1 new file mode 100644 index 00000000..0faab2fd --- /dev/null +++ b/src/include/keyin.H1 @@ -0,0 +1,2 @@ +extern void handle_key(XEvent * event); +extern void init_keyin(void); diff --git a/src/include/lex.H1 b/src/include/lex.H1 new file mode 100644 index 00000000..7f049204 --- /dev/null +++ b/src/include/lex.H1 @@ -0,0 +1,23 @@ +extern int connect_spad(void); +extern void get_expected_token(int type); +extern void parser_init(void); +extern void init_scanner(void); +extern void save_scanner_state(void); +extern void restore_scanner_state(void); +extern void unget_char(int c); +extern int get_char(void); +extern void unget_token(void); +extern int get_token(void); +extern void push_be_stack(int type , char * id); +extern void check_and_pop_be_stack(int type , char * id); +extern int clear_be_stack(void); +extern int be_type(char * which); +extern int begin_type(void); +extern int end_type(void); +extern void reset_connection(void); +extern int spad_busy(void); +#ifdef _LEX_C +static int get_char1(void ); +static void spad_error_handler(void ); +static int keyword_type(void ); +#endif diff --git a/src/include/macro.H1 b/src/include/macro.H1 new file mode 100644 index 00000000..f7853c72 --- /dev/null +++ b/src/include/macro.H1 @@ -0,0 +1,11 @@ +extern void scan_HyperDoc(void); +extern int number(char * str); +extern ParameterList init_parameter_elem(int number); +extern int push_parameters(ParameterList new); +extern int pop_parameters(void); +extern int parse_macro(void); +extern void parse_parameters(void); +#ifdef _MACRO_C +static char * load_macro(MacroStore * macro); +static void get_parameter_strings(int number , char * macro_name); +#endif diff --git a/src/include/mem.H1 b/src/include/mem.H1 new file mode 100644 index 00000000..a8e1a11b --- /dev/null +++ b/src/include/mem.H1 @@ -0,0 +1,32 @@ +extern ButtonList * alloc_button_list(void); +extern CondNode * alloc_condnode(void); +extern HDWindow * alloc_hd_window(void); +extern IfNode * alloc_ifnode(void); +extern InputBox * alloc_inputbox(void); +extern LineStruct * alloc_inputline(int size); +extern TextNode * alloc_node(void); +extern HyperDocPage * alloc_page(char * name); +extern PasteNode * alloc_paste_node(char * name); +extern RadioBoxes * alloc_rbs(void); +extern void free_button_list(ButtonList * bl); +extern void free_hd_window(HDWindow * w); +extern void free_input_item(InputItem * sym , short des); +extern void free_input_list(InputItem * il); +extern void free_node(TextNode * node , short des); +extern void free_page(HyperDocPage * page); +extern void free_patch(PatchStore * p); +extern void free_string(char * str); +extern char * resizeBuffer(int size , char * oldBuf , int * oldSize); +extern PatchStore * alloc_patchstore(void); +#ifdef _MEM_C +static void free_cond(CondNode * cond); +static void free_depend(SpadcomDepend * sd); +static void free_lines(LineStruct * lines); +static void dont_free(void * link); +static void free_if_non_NULL(void * p); +static void free_input_box(InputBox * box); +static void free_paste(PasteNode * paste , short des); +static void free_pastearea(TextNode * node , short des); +static void free_pastebutton(TextNode * node , short des); +static void free_radio_boxes(RadioBoxes * radio); +#endif diff --git a/src/include/nagman.H1 b/src/include/nagman.H1 new file mode 100644 index 00000000..4a58ccd1 --- /dev/null +++ b/src/include/nagman.H1 @@ -0,0 +1,7 @@ +extern void main(int argc , char * * argv); +#ifdef _NAGMAN_C +static void term(int sig); +static long size_of_file(char * filename); +static void rpcloop(void); +static void catchSignals(void); +#endif diff --git a/src/include/openpty.H1 b/src/include/openpty.H1 new file mode 100644 index 00000000..dc46a190 --- /dev/null +++ b/src/include/openpty.H1 @@ -0,0 +1,2 @@ +extern void makeNextPtyNames(char * , char * ); +extern int ptyopen(int * , int * , char * , char * ); diff --git a/src/include/parse.H1 b/src/include/parse.H1 new file mode 100644 index 00000000..fc2c346d --- /dev/null +++ b/src/include/parse.H1 @@ -0,0 +1,20 @@ +extern void display_page(HyperDocPage * page); +extern void init_parse_patch(HyperDocPage * page); +extern void load_page(HyperDocPage * page); +extern void parse_HyperDoc(void ); +extern void parse_from_string(char * str); +extern HyperDocPage * parse_page_from_socket(void ); +extern HyperDocPage * parse_page_from_unixfd(void ); +#ifdef _PARSE_C +static void end_a_page(void ); +static HyperDocPage * format_page(UnloadedPage * ulpage); +static void parse_page(HyperDocPage * page); +static void parse_replacepage(void ); +static void start_footer(void ); +static void start_scrolling(void ); +static void Push_MR(void ); +static void Pop_MR(void ); +static void parse_title(HyperDocPage * page); +static void parse_header(HyperDocPage * page); +static void init_parse_page(HyperDocPage * page); +#endif diff --git a/src/include/parse_aux.H1 b/src/include/parse_aux.H1 new file mode 100644 index 00000000..4de9b249 --- /dev/null +++ b/src/include/parse_aux.H1 @@ -0,0 +1,18 @@ +extern void add_dependencies(void ); +extern FILE * find_fp(FilePosition fp); +extern char * get_input_string(void ); +extern HyperLink * make_link_window(TextNode * link_node , int type , int isSubWin); +extern HyperLink * make_paste_window(PasteNode * paste); +extern void make_special_pages(HashTable * pageHashTable); +extern int window_code(Window * w , int size); +extern int window_equal(Window * w1 , Window * w2); +extern char * window_id(Window w); +extern void read_ht_db(HashTable * page_hash , HashTable * macro_hash , HashTable * patch_hash); +extern int get_filename(void); +extern int is_number(char * str); +extern void parser_error(char * str); +extern int get_where(void); +#ifdef _PARSE_AUX_C +static void read_ht_file(HashTable * page_hash , HashTable * macro_hash , HashTable * patch_hash , FILE * db_fp , char * db_file); +static HyperDocPage * make_special_page(int type , char * name); +#endif diff --git a/src/include/parse_input.H1 b/src/include/parse_input.H1 new file mode 100644 index 00000000..b837f89e --- /dev/null +++ b/src/include/parse_input.H1 @@ -0,0 +1,16 @@ +extern HyperLink * make_input_window(InputItem * item); +extern HyperLink * make_box_window(InputBox * box , int type); +extern void initialize_default(InputItem * item , char * buff); +extern void parse_inputstring(void); +extern void parse_simplebox(void); +extern void parse_radiobox(void); +extern void init_paste_item(InputItem * item); +extern void repaste_item(void); +extern InputItem * current_item(void); +extern int already_there(char * name); +extern void parse_radioboxes(void); +#ifdef _PARSE_INPUT_C +static void insert_item(InputItem * item); +static void add_box_to_rb_list(char * name , InputBox * box); +static int check_others(InputBox * list); +#endif diff --git a/src/include/parse_paste.H1 b/src/include/parse_paste.H1 new file mode 100644 index 00000000..771e995e --- /dev/null +++ b/src/include/parse_paste.H1 @@ -0,0 +1,6 @@ +extern void parse_paste(void); +extern void parse_pastebutton(void); +extern HyperDocPage * parse_patch(PasteNode * paste); +#ifdef _PARSE_PASTE_C +static void load_patch(PatchStore * patch); +#endif diff --git a/src/include/parse_types.H1 b/src/include/parse_types.H1 new file mode 100644 index 00000000..1dca22f8 --- /dev/null +++ b/src/include/parse_types.H1 @@ -0,0 +1,25 @@ +extern void parse_begin_items(void ); +extern void parse_box(void ); +extern void parse_button(void ); +extern void parse_centerline(void ); +extern void parse_command(void ); +extern void parse_env(TextNode * node); +extern void parse_free(void ); +extern void parse_help(void ); +extern void parse_ifcond(void ); +extern void parse_input_pix(void ); +extern void parse_item(void ); +extern void parse_mbox(void ); +extern void parse_mitem(void ); +extern void parse_newcond(void ); +extern void parse_setcond(void ); +extern void parse_spadcommand(TextNode * spad_node); +extern void parse_spadsrc(TextNode * spad_node); +extern void parse_table(void ); +extern void parse_value1(void ); +extern void parse_value2(void ); +extern void parse_verbatim(int type); +#ifdef _PARSE_TYPES_C +static void parse_condnode(void ); +static void parse_hasreturnto(void ); +#endif diff --git a/src/include/pixmap.H1 b/src/include/pixmap.H1 new file mode 100644 index 00000000..77c08cd2 --- /dev/null +++ b/src/include/pixmap.H1 @@ -0,0 +1,4 @@ +extern int file_exists(char * ); +extern FILE * zzopen(char * , char * ); +extern void write_pixmap_file(Display * , int , char * , Window , int , int , int , int ); +extern int read_pixmap_file(Display * , int , char * , XImage * * , int * , int * ); diff --git a/src/include/prt.H1 b/src/include/prt.H1 new file mode 100644 index 00000000..5c76fd80 --- /dev/null +++ b/src/include/prt.H1 @@ -0,0 +1,19 @@ +extern void myputchar(char ); +extern void clear_buff(void); +extern void move_end(void); +extern void move_home(void); +extern void move_fore_word(void); +extern void move_back_word(void); +extern void delete_current_char(void); +extern void del_print(int , int ); +extern void delete_to_end_of_line(void); +extern void delete_line(void); +extern void printbuff(int , int ); +extern void ins_print(int , int ); +extern void reprint(int ); +extern void back_up(int ); +extern void back_it_up(int ); +extern void print_whole_buff(void); +extern void move_ahead(void); +extern void move_back(void); +extern void back_over_current_char(void); diff --git a/src/include/rgb.h b/src/include/rgb.h new file mode 100644 index 00000000..cd3cd72b --- /dev/null +++ b/src/include/rgb.h @@ -0,0 +1,51 @@ +/* +Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +typedef struct _RGB { + float r,g,b; +} RGB ; + +typedef struct _HSV { + float h,s,v; +} HSV ; + +typedef struct _HLS { + float h,l,s; +} HLS ; + + + + + + + diff --git a/src/include/scrollbar.H1 b/src/include/scrollbar.H1 new file mode 100644 index 00000000..76a9ed43 --- /dev/null +++ b/src/include/scrollbar.H1 @@ -0,0 +1,19 @@ +extern void calculateScrollBarMeasures(void ); +extern void drawScrollLines(void ); +extern void hideScrollBars(HDWindow * hdWindow); +extern void getScrollBarMinimumSize(int * width , int * height); +extern void linkScrollBars(void ); +extern void makeScrollBarWindows(void ); +extern void moveScroller(HDWindow * hdWindow); +extern void scrollDown(void ); +extern void scrollDownPage(void ); +extern void scrollScroller(XButtonEvent * event); +extern void scrollToFirstPage(void ); +extern void scrollUp(void ); +extern void scrollUpPage(void ); +extern void showScrollBars(HDWindow * hdWindow); +#ifdef _SCROLLBAR_C +static int ch(int height); +static void changeWindowBackgroundPixmap(Window window , Pixmap pixmap); +static void drawScroller3DEffects(HDWindow * hdWindow , int x1 , int y1 , int x2 , int y2); +#endif diff --git a/src/include/session.H1 b/src/include/session.H1 new file mode 100644 index 00000000..4eadaabf --- /dev/null +++ b/src/include/session.H1 @@ -0,0 +1,15 @@ +extern int main(void); +#ifdef _SESSION_C +static void usr1_handler(int sig); +static void usr2_handler(int sig); +static void term_handler(int sig); +static void close_client(int frame); +static void read_SpadServer_command(void); +static int test_sock_for_process(Sock * sock); +static void read_menu_client_command(void); +static void read_from_spad_io(void); +static void kill_spad(void); +static int accept_session_connection(Sock * server_sock); +static void read_from_session(Sock * sock); +static void manage_sessions(void); +#endif diff --git a/src/include/show_types.H1 b/src/include/show_types.H1 new file mode 100644 index 00000000..1c125f2c --- /dev/null +++ b/src/include/show_types.H1 @@ -0,0 +1,10 @@ +extern void show_text(TextNode * node , int Ender); +#ifdef _SHOW_TYPES_C +static void show_image(TextNode * node , GC gc); +static void show_input(TextNode * node); +static void show_link(TextNode * node); +static void show_paste(TextNode * node); +static void show_pastebutton(TextNode * node); +static void show_simple_box(TextNode * node); +static void show_spadcommand(TextNode * node); +#endif diff --git a/src/include/sman.H1 b/src/include/sman.H1 new file mode 100644 index 00000000..20dbc909 --- /dev/null +++ b/src/include/sman.H1 @@ -0,0 +1,36 @@ +extern int main(int argc , char * argv[] , char * envp[]); +#ifdef _SMAN_C +static void process_arguments(int argc , char * * argv); +static int should_I_clef(void); +static int in_X(void); +static void set_up_defaults(void); +static void process_options(int argc , char * * argv); +static void death_handler(int sig); +static void nagman_handler(int sig); +static void sman_catch_signals(void); +static void fix_env(char * * envp , int spadnum); +static void init_term_io(void); +static char * strPrefix(char * prefix , char * s); +static void check_spad_proc(char * file , char * prefix); +static void clean_up_old_sockets(void); +static SpadProcess * fork_you(int death_action); +static void exec_command_env(char * command , char * * env); +static SpadProcess * spawn_of_hell(char * command , int death_action); +static void start_the_spadclient(void); +static void start_the_local_spadclient(void); +static void start_the_nagman(void); +static void start_the_session_manager(void); +static void start_the_hypertex(void); +static void start_the_graphics(void); +static void fork_Axiom(void); +static void start_the_Axiom(char * * envp); +static void clean_up_sockets(void); +static void read_from_spad_io(int ptcNum); +static void read_from_manager(int ptcNum); +static void manage_spad_io(int ptcNum); +static void init_spad_process_list(void); +static SpadProcess * find_child(int proc_id); +static void kill_all_children(void); +static void clean_up_terminal(void); +static void monitor_children(void); +#endif diff --git a/src/include/sockio-c.H1 b/src/include/sockio-c.H1 new file mode 100644 index 00000000..cc8360a3 --- /dev/null +++ b/src/include/sockio-c.H1 @@ -0,0 +1,64 @@ +extern int get_int(Sock * ); +extern char * get_string(Sock * ); +extern double get_float(Sock * ); +extern Sock * connect_to_local_server(char * , int , int ); +extern int sread(Sock * , char * , int , char * ); +extern double plus_infinity(void ); +extern double minus_infinity(void ); +extern double NANQ(void ); +extern void sigpipe_handler(int ); +extern int wait_for_client_read(Sock * , char * , int , char * ); +extern int wait_for_client_write(Sock * , char * , int , char * ); +extern int swrite(Sock * , char * , int , char * ); +extern int sselect(int , fd_set * , fd_set * , fd_set * , void * ); +extern int fill_buf(Sock * , char * , int , char * ); +extern int sock_get_int(int ); +extern int get_ints(Sock * , int * , int ); +extern int sock_get_ints(int , int * , int ); +extern int send_int(Sock * , int ); +extern int sock_send_int(int , int ); +extern int send_ints(Sock * , int * , int ); +extern int sock_send_ints(int , int * , int ); +extern int send_string(Sock * , char * ); +extern int send_string_len(Sock * , char * , int ); +extern int sock_send_string(int , char * ); +extern int sock_send_string_len(int , char * , int ); +extern int send_strings(Sock * , char * * , int ); +extern int sock_send_strings(int , char * * , int ); +extern char * sock_get_string(int ); +extern char * get_string_buf(Sock * , char * , int ); +extern char * sock_get_string_buf(int , char * , int ); +extern int get_strings(Sock * , char * * , int ); +extern int sock_get_strings(int , char * * , int ); +extern int send_float(Sock * , double ); +extern int sock_send_float(int , double ); +extern int send_sfloats(Sock * , float * , int ); +extern int sock_send_sfloats(int , float * , int ); +extern int send_floats(Sock * , double * , int ); +extern int sock_send_floats(int , double * , int ); +extern double sock_get_float(int ); +extern int get_sfloats(Sock * , float * , int ); +extern int sock_get_sfloats(int , float * , int ); +extern int get_floats(Sock * , double * , int ); +extern int sock_get_floats(int , double * , int ); +extern int wait_for_client_kill(Sock * , int ); +extern int sock_get_remote_fd(int ); +extern int send_signal(Sock * , int ); +extern int sock_send_signal(int , int ); +extern int send_wakeup(Sock * ); +extern int sock_send_wakeup(int ); +extern Sock * connect_to_local_server_new(char * , int , int ); +extern void remote_stdio(Sock * ); +extern void init_purpose_table(void ); +extern int make_server_number(void ); +extern void close_socket(axiom_socket, char * ); +extern int make_server_name(char * , char * ); +extern int open_server(char * ); +extern int accept_connection(Sock * ); +extern void get_socket_type(Sock * ); +extern int sock_accept_connection(int ); +extern void redirect_stdio(Sock * ); +extern void init_socks(void ); +extern int server_switch(void ); +extern void flush_stdout(void ); +extern void print_line(char * ); diff --git a/src/include/spadbuf.H1 b/src/include/spadbuf.H1 new file mode 100644 index 00000000..d5a0de9e --- /dev/null +++ b/src/include/spadbuf.H1 @@ -0,0 +1,7 @@ +extern int main(int argc , char * * argv); +#ifdef _SPADBUF_C +static void spadbuf_inter_handler(int sig); +static void spadbuf_function_chars(void); +static void interp_io(void); +static void init_parent(void); +#endif diff --git a/src/include/spadclient.H1 b/src/include/spadclient.H1 new file mode 100644 index 00000000..66cd1529 --- /dev/null +++ b/src/include/spadclient.H1 @@ -0,0 +1,4 @@ +extern int main(void); +#ifdef _SPADCLIENT_C +static void inter_handler(int sig); +#endif diff --git a/src/include/spadcolors.H1 b/src/include/spadcolors.H1 new file mode 100644 index 00000000..39a2317a --- /dev/null +++ b/src/include/spadcolors.H1 @@ -0,0 +1,9 @@ +extern RGB HSVtoRGB(HSV ); +extern RGB HLStoRGB(HLS ); +extern float value(float , float , float ); +extern int makeColors(Display * , int , Colormap * , unsigned long * * , int * ); +extern int makePermVector(Display * , int , unsigned long * * ); +extern int makeNewColorMap(Display * , Colormap , int ); +extern unsigned long XPixelColor(int ); +extern void FreePixels(Display * , Colormap , int ); +extern int AllocCells(Display * , Colormap , int ); diff --git a/src/include/spadcolors.h b/src/include/spadcolors.h new file mode 100644 index 00000000..43047242 --- /dev/null +++ b/src/include/spadcolors.h @@ -0,0 +1,64 @@ +/* +Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include <X11/X.h> +#define numOfColors 240 +#define totalHuesConst 27 +#define totalShadesConst 5 +#define hueEnd 360 +#define hueStep 12 /* hueEnd/totalHuesConst */ + +#define numPlanes 1 +#define numColors 10 +#define startColor 0 +#define endColor startColor+numColors + +#define colorStep (maxColors+1)/numColors + +#define yes 1 +#define no 0 + +#define smoothConst 50 +#define saymem(a,b,c) saymemWithLine(a,b,c,0) +#define Colorcells 256 /* KF number of elements in permutation vector */ +#define shade 5 +#define saturation 0.8 + +extern int smoothHue; +extern Colormap colorMap; +extern int num; +extern int scrn; + +#define maxColors DisplayCells(dsply,scrn)-1 + +#include "rgb.h" diff --git a/src/include/spadint.H1 b/src/include/spadint.H1 new file mode 100644 index 00000000..adace30d --- /dev/null +++ b/src/include/spadint.H1 @@ -0,0 +1,25 @@ +extern HyperDocPage * issue_server_command(HyperLink * link); +extern HyperDocPage * issue_unixlink(TextNode * node); +extern char * print_to_string(TextNode * command); +extern void issue_spadcommand(HyperDocPage * page , TextNode * command , int immediate , int type); +extern Sock * accept_menu_connection(Sock * server_sock); +extern char * print_to_string1(TextNode * command , int * sizeBuf); +extern int issue_serverpaste(TextNode * command); +extern void issue_unixcommand(TextNode * node); +extern int issue_unixpaste(TextNode * node); +extern void service_session_socket(void); +extern void send_lisp_command(char * command); +extern void escape_string(char * s); +extern void unescape_string(char * s); +extern char * print_source_to_string1(TextNode * command , int * sizeBuf); +extern char * print_source_to_string(TextNode * command); +#ifdef _SPADINT_C +static void start_user_buffer(HyperDocPage * page); +static void clear_execution_marks(HashTable * depend_hash); +static void issue_dependent_commands(HyperDocPage * page , TextNode * command , int type); +static void send_pile(Sock * sock , char * str); +static void mark_as_executed(HyperDocPage * page , TextNode * command , int type); +static void accept_menu_server_connection(HyperDocPage * page); +static void switch_frames(void ); +static void close_client(int pid); +#endif diff --git a/src/include/titlebar.H1 b/src/include/titlebar.H1 new file mode 100644 index 00000000..b5d564c1 --- /dev/null +++ b/src/include/titlebar.H1 @@ -0,0 +1,7 @@ +extern void getTitleBarMinimumSize(int * width , int * height); +extern void linkTitleBarWindows(void); +extern void makeTitleBarWindows(void); +extern void showTitleBar(void); +#ifdef _TITLEBAR_C +static void readTitleBarImages(void); +#endif diff --git a/src/include/useproto.h b/src/include/useproto.h new file mode 100644 index 00000000..4aa61ebc --- /dev/null +++ b/src/include/useproto.h @@ -0,0 +1,72 @@ +/* +Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _USEPROTO_H_ +#define _USEPROTO_H_ 1 + +#if defined(SGIplatform) || defined(LINUXplatform) || defined(HPplatform) || defined(RIOSplatform) || defined(RIOS4platform) || defined(SUN4OS5platform) || defined(MACOSXplatform) || defined(BSDplatform) +#ifdef _NO_PROTO +#undef _NO_PROTO +#endif +#ifndef NeedFunctionPrototypes +#define NeedFunctionPrototypes 1 +#endif +#endif /*SGIplatform ... */ + + +#if defined(ALPHAplatform) +#ifdef __STDC__ + +#ifdef _NO_PROTO +#undef _NO_PROTO +#endif +#ifndef NeedFunctionPrototypes +#define NeedFunctionPrototypes 1 +#endif + +#else + +#define _NO_PROTO +#undef NeedFunctionPrototypes + +#endif +#endif /* ALPHA */ + + + +#ifdef SUNplatform +#define _NO_PROTO +#define const +#endif + +#endif /* _USEPROTO_H_ */ diff --git a/src/include/util.H1 b/src/include/util.H1 new file mode 100644 index 00000000..bed0da32 --- /dev/null +++ b/src/include/util.H1 @@ -0,0 +1,6 @@ +extern int checker(int , int , char * ); +extern char * getmemWithLine(int , char * , int ); +extern char * saymemWithLine(char * , int , int , int ); +extern void myfree(void * , int ); +extern XPoint getWindowPositionXY(Display * , Window ); +extern XPoint getWindowSizeXY(Display * , Window ); diff --git a/src/include/view.h b/src/include/view.h new file mode 100644 index 00000000..63c1572c --- /dev/null +++ b/src/include/view.h @@ -0,0 +1,53 @@ +/* +Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* This file is to be included by all the viewport files */ + +#include "useproto.h" + +#define check(code) checker(code,__LINE__,errorStr) +#define saymem(a,b,c) saymemWithLine(a,b,c,__LINE__) +#define exitWithAck(ACK,ACKsize,i) check(write(Socket,&(ACK),sizeof(ACKsize))); exit(i); +#define NIL(type) ((type *)NULL) +/* #define monoColor(x) (mono)?foregroundColor:spadColors[x] */ + +#define oldNum 8 /* in the old system, we assumed an eight shade palette */ +#define oldOff 2 + +#define monoColor(x) (mono)?foregroundColor:XSolidColor((int)x/oldNum,(int)(x%oldNum)/oldOff) +#define monoDither(x,y) (mono)?foregroundColor:XSolidColor(x,y) +#define notANumber (0.0/0.0) + + /* error messages */ +#define fontErrMess " Try getting the font or changing the .Xdefaults entry" + diff --git a/src/include/wct.H1 b/src/include/wct.H1 new file mode 100644 index 00000000..b156c430 --- /dev/null +++ b/src/include/wct.H1 @@ -0,0 +1,26 @@ +extern time_t ftime(char * ); +extern void fatal(char * , char * ); +extern off_t fsize(char * ); +extern Wix * scanWct(Wct * , char * ); +extern void reintern1Wct(Wct * ); +extern Wix * rescanWct(void); +extern void skimWct(Wct * ); +extern void skim1Wct(Wct * ); +extern void printTime(long * ); +extern int skimString(char * , int , int , int ); +extern int prChar(int ); +extern Wct * reread1Wct(Wct * ); +extern void sfatal(char * ); +extern Wct * read1Wct(char * ); +extern Wct * nconcWct(Wct * , Wct * ); +extern void sortWct(Wct * ); +extern void sort1Wct(Wct * ); +extern int mystrcmp(const void * , const void * ); +extern void burstWct(Wct * ); +extern void burst1Wct(Wct * ); +extern Wct * intern1Wct(char * ); +extern void load_wct_file(char * ); +extern void skim_wct(void); +extern void rescan_wct(void); +extern void find_wct(void); + diff --git a/src/include/xpm.h b/src/include/xpm.h new file mode 100644 index 00000000..33da4b8e --- /dev/null +++ b/src/include/xpm.h @@ -0,0 +1,487 @@ +/* + * Copyright (C) 1989-95 GROUPE BULL + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of GROUPE BULL shall not be + * used in advertising or otherwise to promote the sale, use or other dealings + * in this Software without prior written authorization from GROUPE BULL. + */ + +/*****************************************************************************\ +* xpm.h: * +* * +* XPM library * +* Include file * +* * +* Developed by Arnaud Le Hors * +\*****************************************************************************/ + +/* + * The code related to FOR_MSW has been added by + * HeDu (hedu@cul-ipn.uni-kiel.de) 4/94 + */ + +#ifndef XPM_h +#define XPM_h + +/* + * first some identification numbers: + * the version and revision numbers are determined with the following rule: + * SO Major number = LIB minor version number. + * SO Minor number = LIB sub-minor version number. + * e.g: Xpm version 3.2f + * we forget the 3 which is the format number, 2 gives 2, and f gives 6. + * thus we have XpmVersion = 2 and XpmRevision = 6 + * which gives SOXPMLIBREV = 2.6 + * + * Then the XpmIncludeVersion number is built from these numbers. + */ +#define XpmFormat 3 +#define XpmVersion 4 +#define XpmRevision 9 +#define XpmIncludeVersion ((XpmFormat * 100 + XpmVersion) * 100 + XpmRevision) + +#ifndef XPM_NUMBERS + +#ifdef FOR_MSW +# define SYSV /* uses memcpy string.h etc. */ +# include <malloc.h> +# include "simx.h" /* defines some X stuff using MSW types */ +#define NEED_STRCASECMP /* at least for MSVC++ */ +#else /* FOR_MSW */ +# include <X11/Xlib.h> +# include <X11/Xutil.h> +#endif /* FOR_MSW */ + +/* let's define Pixel if it is not done yet */ +#if ! defined(_XtIntrinsic_h) && ! defined(PIXEL_ALREADY_TYPEDEFED) +typedef unsigned long Pixel; /* Index into colormap */ +# define PIXEL_ALREADY_TYPEDEFED +#endif + +/* make sure we know whether function prototypes are needed or not */ +#ifndef NeedFunctionPrototypes +# if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) +# define NeedFunctionPrototypes 1 +# else +# define NeedFunctionPrototypes 0 +# endif +#endif + + +/* Return ErrorStatus codes: + * null if full success + * positive if partial success + * negative if failure + */ + +#define XpmColorError 1 +#define XpmSuccess 0 +#define XpmOpenFailed -1 +#define XpmFileInvalid -2 +#define XpmNoMemory -3 +#define XpmColorFailed -4 + +typedef struct { + char *name; /* Symbolic color name */ + char *value; /* Color value */ + Pixel pixel; /* Color pixel */ +} XpmColorSymbol; + +typedef struct { + char *name; /* name of the extension */ + unsigned int nlines; /* number of lines in this extension */ + char **lines; /* pointer to the extension array of strings */ +} XpmExtension; + +typedef struct { + char *string; /* characters string */ + char *symbolic; /* symbolic name */ + char *m_color; /* monochrom default */ + char *g4_color; /* 4 level grayscale default */ + char *g_color; /* other level grayscale default */ + char *c_color; /* color default */ +} XpmColor; + +typedef struct { + unsigned int width; /* image width */ + unsigned int height; /* image height */ + unsigned int cpp; /* number of characters per pixel */ + unsigned int ncolors; /* number of colors */ + XpmColor *colorTable; /* list of related colors */ + unsigned int *data; /* image data */ +} XpmImage; + +typedef struct { + unsigned long valuemask; /* Specifies which attributes are defined */ + char *hints_cmt; /* Comment of the hints section */ + char *colors_cmt; /* Comment of the colors section */ + char *pixels_cmt; /* Comment of the pixels section */ + unsigned int x_hotspot; /* Returns the x hotspot's coordinate */ + unsigned int y_hotspot; /* Returns the y hotspot's coordinate */ + unsigned int nextensions; /* number of extensions */ + XpmExtension *extensions; /* pointer to array of extensions */ +} XpmInfo; + +typedef int (*XpmAllocColorFunc)( +#if NeedFunctionPrototypes + Display* /* display */, + Colormap /* colormap */, + char* /* colorname */, + XColor* /* xcolor */, + void* /* closure */ +#endif +); + +typedef int (*XpmFreeColorsFunc)( +#if NeedFunctionPrototypes + Display* /* display */, + Colormap /* colormap */, + Pixel* /* pixels */, + int /* npixels */, + void* /* closure */ +#endif +); + +typedef struct { + unsigned long valuemask; /* Specifies which attributes are + defined */ + + Visual *visual; /* Specifies the visual to use */ + Colormap colormap; /* Specifies the colormap to use */ + unsigned int depth; /* Specifies the depth */ + unsigned int width; /* Returns the width of the created + pixmap */ + unsigned int height; /* Returns the height of the created + pixmap */ + unsigned int x_hotspot; /* Returns the x hotspot's + coordinate */ + unsigned int y_hotspot; /* Returns the y hotspot's + coordinate */ + unsigned int cpp; /* Specifies the number of char per + pixel */ + Pixel *pixels; /* List of used color pixels */ + unsigned int npixels; /* Number of used pixels */ + XpmColorSymbol *colorsymbols; /* List of color symbols to override */ + unsigned int numsymbols; /* Number of symbols */ + char *rgb_fname; /* RGB text file name */ + unsigned int nextensions; /* Number of extensions */ + XpmExtension *extensions; /* List of extensions */ + + unsigned int ncolors; /* Number of colors */ + XpmColor *colorTable; /* List of colors */ +/* 3.2 backward compatibility code */ + char *hints_cmt; /* Comment of the hints section */ + char *colors_cmt; /* Comment of the colors section */ + char *pixels_cmt; /* Comment of the pixels section */ +/* end 3.2 bc */ + unsigned int mask_pixel; /* Color table index of transparent + color */ + + /* Color Allocation Directives */ + Bool exactColors; /* Only use exact colors for visual */ + unsigned int closeness; /* Allowable RGB deviation */ + unsigned int red_closeness; /* Allowable red deviation */ + unsigned int green_closeness; /* Allowable green deviation */ + unsigned int blue_closeness; /* Allowable blue deviation */ + int color_key; /* Use colors from this color set */ + + Pixel *alloc_pixels; /* Returns the list of alloc'ed color + pixels */ + Bool nalloc_pixels; /* Returns the number of alloc'ed + color pixels */ + + Bool alloc_close_colors; /* Specify whether close colors should + be allocated using XAllocColor + or not */ + int bitmap_format; /* Specify the format of 1bit depth + images: ZPixmap or XYBitmap */ + + /* Color functions */ + XpmAllocColorFunc alloc_color; /* Application color allocator */ + XpmFreeColorsFunc free_colors; /* Application color de-allocator */ + void *color_closure; /* Application private data to pass to + alloc_color and free_colors */ + +} XpmAttributes; + +/* XpmAttributes value masks bits */ +#define XpmVisual (1L<<0) +#define XpmColormap (1L<<1) +#define XpmDepth (1L<<2) +#define XpmSize (1L<<3) /* width & height */ +#define XpmHotspot (1L<<4) /* x_hotspot & y_hotspot */ +#define XpmCharsPerPixel (1L<<5) +#define XpmColorSymbols (1L<<6) +#define XpmRgbFilename (1L<<7) +/* 3.2 backward compatibility code */ +#define XpmInfos (1L<<8) +#define XpmReturnInfos XpmInfos +/* end 3.2 bc */ +#define XpmReturnPixels (1L<<9) +#define XpmExtensions (1L<<10) +#define XpmReturnExtensions XpmExtensions + +#define XpmExactColors (1L<<11) +#define XpmCloseness (1L<<12) +#define XpmRGBCloseness (1L<<13) +#define XpmColorKey (1L<<14) + +#define XpmColorTable (1L<<15) +#define XpmReturnColorTable XpmColorTable + +#define XpmReturnAllocPixels (1L<<16) +#define XpmAllocCloseColors (1L<<17) +#define XpmBitmapFormat (1L<<18) + +#define XpmAllocColor (1L<<19) +#define XpmFreeColors (1L<<20) +#define XpmColorClosure (1L<<21) + + +/* XpmInfo value masks bits */ +#define XpmComments XpmInfos +#define XpmReturnComments XpmComments + +/* XpmAttributes mask_pixel value when there is no mask */ +#ifndef FOR_MSW +#define XpmUndefPixel 0x80000000 +#else +/* int is only 16 bit for MSW */ +#define XpmUndefPixel 0x8000 +#endif + +/* + * color keys for visual type, they must fit along with the number key of + * each related element in xpmColorKeys[] defined in XpmI.h + */ +#define XPM_MONO 2 +#define XPM_GREY4 3 +#define XPM_GRAY4 3 +#define XPM_GREY 4 +#define XPM_GRAY 4 +#define XPM_COLOR 5 + + +/* macros for forward declarations of functions with prototypes */ +#if NeedFunctionPrototypes +#define FUNC(f, t, p) extern t f p +#define LFUNC(f, t, p) static t f p +#else +#define FUNC(f, t, p) extern t f() +#define LFUNC(f, t, p) static t f() +#endif + + +/* + * functions declarations + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* FOR_MSW, all ..Pixmap.. are excluded, only the ..XImage.. are used */ + +#ifndef FOR_MSW + FUNC(XpmCreatePixmapFromData, int, (Display *display, + Drawable d, + char **data, + Pixmap *pixmap_return, + Pixmap *shapemask_return, + XpmAttributes *attributes)); + + FUNC(XpmCreateDataFromPixmap, int, (Display *display, + char ***data_return, + Pixmap pixmap, + Pixmap shapemask, + XpmAttributes *attributes)); + + FUNC(XpmReadFileToPixmap, int, (Display *display, + Drawable d, + char *filename, + Pixmap *pixmap_return, + Pixmap *shapemask_return, + XpmAttributes *attributes)); + + FUNC(XpmWriteFileFromPixmap, int, (Display *display, + char *filename, + Pixmap pixmap, + Pixmap shapemask, + XpmAttributes *attributes)); +#endif /* ndef FOR_MSW */ + + FUNC(XpmCreateImageFromData, int, (Display *display, + char **data, + XImage **image_return, + XImage **shapemask_return, + XpmAttributes *attributes)); + + FUNC(XpmCreateDataFromImage, int, (Display *display, + char ***data_return, + XImage *image, + XImage *shapeimage, + XpmAttributes *attributes)); + + FUNC(XpmReadFileToImage, int, (Display *display, + char *filename, + XImage **image_return, + XImage **shapeimage_return, + XpmAttributes *attributes)); + + FUNC(XpmWriteFileFromImage, int, (Display *display, + char *filename, + XImage *image, + XImage *shapeimage, + XpmAttributes *attributes)); + + FUNC(XpmCreateImageFromBuffer, int, (Display *display, + char *buffer, + XImage **image_return, + XImage **shapemask_return, + XpmAttributes *attributes)); +#ifndef FOR_MSW + FUNC(XpmCreatePixmapFromBuffer, int, (Display *display, + Drawable d, + char *buffer, + Pixmap *pixmap_return, + Pixmap *shapemask_return, + XpmAttributes *attributes)); + + FUNC(XpmCreateBufferFromImage, int, (Display *display, + char **buffer_return, + XImage *image, + XImage *shapeimage, + XpmAttributes *attributes)); + + FUNC(XpmCreateBufferFromPixmap, int, (Display *display, + char **buffer_return, + Pixmap pixmap, + Pixmap shapemask, + XpmAttributes *attributes)); +#endif /* ndef FOR_MSW */ + FUNC(XpmReadFileToBuffer, int, (char *filename, char **buffer_return)); + FUNC(XpmWriteFileFromBuffer, int, (char *filename, char *buffer)); + + FUNC(XpmReadFileToData, int, (char *filename, char ***data_return)); + FUNC(XpmWriteFileFromData, int, (char *filename, char **data)); + + FUNC(XpmAttributesSize, int, ()); + FUNC(XpmFreeAttributes, void, (XpmAttributes *attributes)); + FUNC(XpmFreeExtensions, void, (XpmExtension *extensions, + int nextensions)); + + FUNC(XpmFreeXpmImage, void, (XpmImage *image)); + FUNC(XpmFreeXpmInfo, void, (XpmInfo *info)); + FUNC(XpmGetErrorString, char *, (int errcode)); + FUNC(XpmLibraryVersion, int, ()); + + /* XpmImage functions */ + FUNC(XpmReadFileToXpmImage, int, (char *filename, + XpmImage *image, + XpmInfo *info)); + + FUNC(XpmWriteFileFromXpmImage, int, (char *filename, + XpmImage *image, + XpmInfo *info)); +#ifndef FOR_MSW + FUNC(XpmCreatePixmapFromXpmImage, int, (Display *display, + Drawable d, + XpmImage *image, + Pixmap *pixmap_return, + Pixmap *shapemask_return, + XpmAttributes *attributes)); +#endif + FUNC(XpmCreateImageFromXpmImage, int, (Display *display, + XpmImage *image, + XImage **image_return, + XImage **shapeimage_return, + XpmAttributes *attributes)); + + FUNC(XpmCreateXpmImageFromImage, int, (Display *display, + XImage *image, + XImage *shapeimage, + XpmImage *xpmimage, + XpmAttributes *attributes)); +#ifndef FOR_MSW + FUNC(XpmCreateXpmImageFromPixmap, int, (Display *display, + Pixmap pixmap, + Pixmap shapemask, + XpmImage *xpmimage, + XpmAttributes *attributes)); +#endif + FUNC(XpmCreateDataFromXpmImage, int, (char ***data_return, + XpmImage *image, + XpmInfo *info)); + + FUNC(XpmCreateXpmImageFromData, int, (char **data, + XpmImage *image, + XpmInfo *info)); + + FUNC(XpmCreateXpmImageFromBuffer, int, (char *buffer, + XpmImage *image, + XpmInfo *info)); + + FUNC(XpmCreateBufferFromXpmImage, int, (char **buffer_return, + XpmImage *image, + XpmInfo *info)); + + FUNC(XpmFree, void, (void *ptr)); + +#ifdef __cplusplus +} /* for C++ V2.0 */ +#endif + + +/* backward compatibility */ + +/* for version 3.0c */ +#define XpmPixmapColorError XpmColorError +#define XpmPixmapSuccess XpmSuccess +#define XpmPixmapOpenFailed XpmOpenFailed +#define XpmPixmapFileInvalid XpmFileInvalid +#define XpmPixmapNoMemory XpmNoMemory +#define XpmPixmapColorFailed XpmColorFailed + +#define XpmReadPixmapFile(dpy, d, file, pix, mask, att) \ + XpmReadFileToPixmap(dpy, d, file, pix, mask, att) +#define XpmWritePixmapFile(dpy, file, pix, mask, att) \ + XpmWriteFileFromPixmap(dpy, file, pix, mask, att) + +/* for version 3.0b */ +#define PixmapColorError XpmColorError +#define PixmapSuccess XpmSuccess +#define PixmapOpenFailed XpmOpenFailed +#define PixmapFileInvalid XpmFileInvalid +#define PixmapNoMemory XpmNoMemory +#define PixmapColorFailed XpmColorFailed + +#define ColorSymbol XpmColorSymbol + +#define XReadPixmapFile(dpy, d, file, pix, mask, att) \ + XpmReadFileToPixmap(dpy, d, file, pix, mask, att) +#define XWritePixmapFile(dpy, file, pix, mask, att) \ + XpmWriteFileFromPixmap(dpy, file, pix, mask, att) +#define XCreatePixmapFromData(dpy, d, data, pix, mask, att) \ + XpmCreatePixmapFromData(dpy, d, data, pix, mask, att) +#define XCreateDataFromPixmap(dpy, data, pix, mask, att) \ + XpmCreateDataFromPixmap(dpy, data, pix, mask, att) + +#endif /* XPM_NUMBERS */ +#endif |