1 unit gpcsmapi;
2 
3 interface
4 
5 uses gpcstrings;
6 {$define pack4}
7 {$packrecords 1}
8 const
9  MSGAREA_NORMAL:word=0;
10  MSGAREA_CREATE:word=1;
11  MSGAREA_CRIFNEC:word=2;
12  UID_EXACT:word=0;
13  UID_NEXT:word=1;
14  UID_PREV:word=2;
15 
16  MSGTYPE_SDM:word=1;
17  MSGTYPE_SQUISH:word=2;
18  MSGTYPE_ECHO:word=$80;
19 
20  MOPEN_CREATE:word=0;
21  MOPEN_READ:word=1;
22  MOPEN_WRITE:word=2;
23  MOPEN_RW:word=3;
24 {$ifdef __GPC__}
25  {$l smapilnx}
26 {$endif}
27 
28 {$ifdef LINUX}
29   {$linklib smapilnx}
30   {$linklib gcc}
31   {$linklib c}
32 {$endif}
33 
34 {$ifdef GO32V2}
35   {$linklib smapidjp}
36   {$linklib c}
37 {$endif}
38 
39 const
40  msgid=$0201414;
41 
42  {_XMSG.ATTR}
43  MSGPRIVATE =01;
44  MSGCRASH   =$02;
45  MSGREAD    =$04;
46  MSGSENT    =$08;
47  MSGFILE    =$10;
48  MSGFWD     =$20;
49  MSGORPHAN  =$40;
50  MSGKILL    =$80;
51  MSGLOCAL   =$100;
52  MSGHOLD    =$200;
53  MSGXX2     =$400;
54  MSGFRQ     =$800;
55  MSGRRQ     =$1000;
56  MSGCPT     =$2000;
57  MSGARQ     =$4000;
58  MSGURQ     =$8000;
59  MSGSCANNED =$10000;
60 
61 
62 type
63  array035=array[0..35] of char;
64  p_netaddr=^netaddr;
65  netaddr=record
66            zone,net,node,point:word;
67           end;
68  pxmsg=^_xmsg;
69  _xmsg=record
70     attr:longint;
71     fromname:array035;
72     toname:array035;
73     subj:array[0..71] of char;
74     orig,dest:netaddr;
75     date_written,date_arrived:record
76          date:word;
77          {$ifdef pack4} timedummy:word; {$endif}
78          time:word;
79          {$ifdef pack4} datedummy:word; {$endif}
80     end;
81     {$ifdef pack4} timedummy2:word; {$endif}
82     utc_ofs:integer;
83     replyto:longint;
84     replies:array[0..9] of longint;
85     __ftsc_date:array[0..19] of char;
86    end;
87  p_minf=^_minf;
88  _minf=record
89        req_version,def_zone,havesahre:word;
90       end;
91 
92  phmsg=^hmsg;
93  hmsg=record
94        sq:pointer;
95        id:longint;
96        bytes_written:longint;
97        cur_pos:longint;
98       end;
99 
100  pfkt=^fkt;
101  pharea=^harea;
102 
103  fkt=record
hnull104        CloseArea:function(mh:pharea):byte;
105            {sword(EXPENTRY * CloseArea) (MSG * mh);}
106 
hnull107        OpenMsg:function(mh:pharea;mode:word;n:longint):phmsg;
108            { MSGH *(EXPENTRY * OpenMsg) (MSG * mh, word mode, dword n);}
109 
hnull110        CloseMsg:function(mh:phmsg):integer;
111            {sword(EXPENTRY * CloseMsg) (MSGH * msgh);}
112 
hnull113        ReadMsg:function(mh:phmsg;XMSG:PXMSG;ofs:longint;bytes:longint;text:pchar;cbyt:longint;ctxt:pchar):longint;
114            {dword(EXPENTRY * ReadMsg) (MSGH * msgh, XMSG * msg, dword ofs, dword bytes, byte * text, dword cbyt, byte * ctxt);}
115 
hnull116        WriteMsg:function(mh:phmsg;appending:word;xmsg:pxmsg;text:pchar;textlen:longint;totlen:longint;clen:longint;ctxt:pchar):longint;
117           {sword(EXPENTRY * WriteMsg) (MSGH * msgh, word append, XMSG * msg, byte * text, dword textlen, dword totlen, dword clen, byte * ctxt);}
118 
hnull119        KillMsg:function(mh:pharea;msgnum:longint):byte;
120           {sword(EXPENTRY * KillMsg) (MSG * mh, dword msgnum);}
121 
hnull122        Lock:function(mh:pharea):byte;
123           {sword(EXPENTRY * Lock) (MSG * mh);}
124 
hnull125        Unlock:function(mh:pharea):byte;
126           {sword(EXPENTRY * Unlock) (MSG * mh);}
127 
hnull128        SetCurpos:function(mh:phmsg;pos:longint):byte;
129           {sword(EXPENTRY * SetCurPos) (MSGH * msgh, dword pos);}
130 
hnull131        GetCurpos:function(mh:phmsg):longint;
132           {dword(EXPENTRY * GetCurPos) (MSGH * msgh);}
133 
hnull134        MsgnToUid:function(mh:pharea;msgnum:longint):longint;
135           {UMSGID(EXPENTRY * MsgnToUid) (MSG * mh, dword msgnum);}
136 
hnull137        UidToMsgn:function(mh:pharea;umsgid:longint;type_:word):longint;
138           {dword(EXPENTRY * UidToMsgn) (MSG * mh, UMSGID umsgid, word type);}
139 
hnull140        GetHighWater:function(mh:pharea):longint;
141           {dword(EXPENTRY * GetHighWater) (MSG * mh);}
142 
hnull143        SetHighWater:function(mh:pharea;hwm:longint):byte;
144           {sword(EXPENTRY * SetHighWater) (MSG * mh, dword hwm);}
145 
sghnull146        GetTextLen:function(msgh:phmsg):longint;
147           {dword(EXPENTRY * GetTextLen) (MSGH * msgh);}
148 
sghnull149        GetCtrlLen:function(msgh:phmsg):longint;
150           {dword(EXPENTRY * GetCtrlLen) (MSGH * msgh);}
151      end;
152  harea=record
153        id:longint;
154        len:word;
155        type_:word;
156        num_msg:longint;
157        cur_msg:longint;
158        high_msg:longint;
159        high_water:longint;
160        sz_xmsg:word;
161 {       locked:byte;
162        isecho:byte; }
163        mix:word;
164        f:pfkt;
165 
166 {    void *apidata;}
167         dummy:array[1..20000] of char;
168       end;
169 
MsgOpenApinull170 function MsgOpenApi(_minf:p_minf):byte;asmname 'MsgOpenApi';  {return 0 if OK}
MsgCloseApinull171 function MsgCloseApi:byte; asmname 'MsgCloseApi';
172 
MsgOpenAreanull173 function MsgOpenArea(name:pchar;mode:word;AreaType:word):pharea; asmname 'MsgOpenArea';
InvalidMsghnull174 function InvalidMsgh(hmsg:phmsg):boolean;
InvalidMhnull175 function InvalidMh(HAREA:pharea):boolean; asmname 'InvalidMh';
MsgOpenMsgnull176 function MsgOpenMsg(h:pharea;mode:word;msgn:longint):phmsg;
MsgReadMsgnull177 function MsgReadMsg(p:phmsg;ofs:longint;bytes:longint;text:pchar;cbtye:longint;ctext:pchar):longint;
MsgValidatenull178 function MsgValidate(type_:word;name:pchar):byte;
179          {sword EXPENTRY MsgValidate(word type, byte * name);}
180 
181 {function MsgGetCurMsg(HAREA:pharea):longint;
182 function MsgGetNumMsg(HAREA:pharea):longint;
183 function MsgGetHighMsg(HAREA:pharea):longint;
184 byte *EXPENTRY CvtCtrlToKludge(byte * ctrl);
185 byte *EXPENTRY GetCtrlToken(byte * where, byte * what);
186 byte *EXPENTRY CopyToControlBuf(byte * txt, byte ** newtext, unsigned *length);
187 word EXPENTRY NumKludges(char *txt);
188                                             }
189 {function RemoveFromCtrl(ctrl:pchar;what:pchar);
190 function ConvertControlInfo(ctrl:pchar;orig:p_netaddr;dest:p_netaddr);
191 }
192 
193 
194 implementation
195 const
196    RCSID: PChar = '$Id$';
197 
198 end.
199