mirror of
https://github.com/ksherlock/dict.git
synced 2024-05-27 19:48:25 +00:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
91f4b65920 | ||
|
1155573111 | ||
|
8085d2c934 | ||
|
eb69b619c9 | ||
|
41674ac33d | ||
|
316f1423a9 | ||
|
8a5efb4fa7 | ||
|
9133fa7a94 |
|
@ -2,6 +2,13 @@
|
|||
BIN_OBJ = o/main.a o/connection.a
|
||||
NDA_OBJ = o/nda.a o/connection.a o/tools.a
|
||||
|
||||
.PHONY: all clean clobber
|
||||
all : dict dict.nda
|
||||
clean:
|
||||
$(RM) -r o
|
||||
clobber : clean
|
||||
$(RM) dict dict.nda
|
||||
|
||||
dict : $(BIN_OBJ)
|
||||
iix link o/main o/connection keep=$@
|
||||
|
||||
|
|
3
README.md
Normal file
3
README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
An RFC 2229 [DICT](http://www.dict.org/) protocol client, in NDA form.
|
||||
|
||||
![screenshot](images/image-1.png)
|
BIN
images/image-1.png
Normal file
BIN
images/image-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
14
nda.c
14
nda.c
|
@ -46,7 +46,6 @@ void NDAResourceShutDown(NDAResourceCookie *cookie);
|
|||
Word NDAResourceStartUp(Word memID, Word access, NDAResourceCookie *cookie);
|
||||
|
||||
Word MyID;
|
||||
Word ipid;
|
||||
Word FlagTCP;
|
||||
Word ToolsLoaded;
|
||||
GrafPortPtr MyWindow;
|
||||
|
@ -107,7 +106,7 @@ void AppendText(word length, char *cp) {
|
|||
size = TextHandleUsed + length;
|
||||
if (size > TextHandleSize) {
|
||||
size += 4095;
|
||||
size &= 4096;
|
||||
size &= ~4095;
|
||||
|
||||
if (h) {
|
||||
HUnlock(h);
|
||||
|
@ -116,11 +115,10 @@ void AppendText(word length, char *cp) {
|
|||
HLock(h);
|
||||
TextHandleSize = size;
|
||||
} else {
|
||||
TextHandle = h = NewHandle(size, MyID, attrLocked, 0);
|
||||
TextHandle = h = NewHandle(size, MyID, attrLocked|attrNoSpec, 0);
|
||||
if (_toolErr) return;
|
||||
TextHandleSize = size;
|
||||
}
|
||||
HLock(h);
|
||||
}
|
||||
BlockMove(cp, *h + TextHandleUsed, length);
|
||||
TextHandleUsed += length;
|
||||
|
@ -155,7 +153,7 @@ void SetText(void) {
|
|||
longword oldStart, oldEnd;
|
||||
|
||||
TESetSelection((Pointer)-1, (Pointer)-1, TECtrlHandle);
|
||||
TESetText(teDataIsTextBox2|teTextIsPtr, (Ref)*TextHandle, TextHandleUsed, NULL, NULL, TECtrlHandle);
|
||||
TESetText(teDataIsTextBox2|teTextIsPtr, (Ref)*TextHandle, TextHandleUsed, 0, NULL, TECtrlHandle);
|
||||
|
||||
|
||||
TextHandleUsed = 0;
|
||||
|
@ -396,7 +394,6 @@ pascal word HandleRequest(word request, longword dataIn, longword dataOut) {
|
|||
|
||||
if (request == TCPIPSaysNetworkDown) {
|
||||
FlagTCP = false;
|
||||
ipid = 0;
|
||||
UpdateStatus(true);
|
||||
}
|
||||
SetCurResourceApp(oldRApp);
|
||||
|
@ -435,7 +432,6 @@ void NDAInit(Word code) {
|
|||
ToolsLoaded = false;
|
||||
|
||||
MyID = MMStartUp();
|
||||
ipid = 0;
|
||||
st = st_none;
|
||||
} else {
|
||||
if (ToolsLoaded)
|
||||
|
@ -449,6 +445,7 @@ void NDAClose(void) {
|
|||
|
||||
AcceptRequests(ReqName, MyID, NULL);
|
||||
ConnectionAbort(&connection);
|
||||
st = st_none;
|
||||
|
||||
CloseWindow(MyWindow);
|
||||
MyWindow = NULL;
|
||||
|
@ -470,6 +467,7 @@ GrafPortPtr NDAOpen(void) {
|
|||
TextHandle = NULL;
|
||||
TextHandleSize = 0;
|
||||
TextHandleSize = 0;
|
||||
st = st_none;
|
||||
|
||||
if (!ToolsLoaded) {
|
||||
if (NDAStartUpTools(MyID, &ss)) {
|
||||
|
@ -542,7 +540,7 @@ void DoDefine(void) {
|
|||
|
||||
handle = (Handle)GetCtlHandleFromID(MyWindow, rCtrlTE);
|
||||
|
||||
TESetText(teDataIsTextBlock, (Ref)"", 0, NULL, NULL, handle);
|
||||
TESetText(teDataIsTextBlock|teTextIsPtr, (Ref)"", 0, 0, NULL, handle);
|
||||
|
||||
GetLETextByID(MyWindow, rCtrlLE, (StringPtr)word_to_define);
|
||||
|
||||
|
|
6
nda.rez
6
nda.rez
|
@ -114,7 +114,7 @@ resource rText (0x4) {
|
|||
resource rComment (1) {
|
||||
"Dict NDA\n\n"
|
||||
"Written by Kelvin W Sherlock\n"
|
||||
"2018-2019"
|
||||
"2018-2021"
|
||||
};
|
||||
|
||||
resource rVersion (1) {
|
||||
|
@ -123,9 +123,9 @@ resource rVersion (1) {
|
|||
0,
|
||||
0,
|
||||
alpha,
|
||||
0
|
||||
1
|
||||
},
|
||||
verUS,
|
||||
"Dict",
|
||||
"(C) 2018-2019 Kelvin Sherlock "
|
||||
"(C) 2018-2021 Kelvin Sherlock "
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user