T.R | Title | User | Personal Name | Date | Lines |
---|
22.1 | appl_read, appl_write | PRNSYS::LOMICKAJ | Jeff Lomicka | Thu Apr 07 1988 11:20 | 22 |
| According to the Mark Williams documentation, I expect that you are
referring to the routines appl_write() and appl_read(). These are AES
routines, and are called as follows:
appl_write( handle, length, buffer)
int handle; /* Application handle to receive message */
int length; /* Length of message in bytes */
char *buffer; /* message to send */
appl_read( handle, length, buffer)
int handle; /* Handle of app. that owns the pipe to be read (?) */
int length; /* Number of bytes to read */
char *buffer; /* Place to put the data */
Both routines return 0 on error. There is some possibility that these
routines will interact with the "message" event type of evnt_multi().
I have never tried these routines, and the documentation isn't all that
clear. Please let us know if they do anything useful for you, and if
so, how.
|
22.2 | works fine... | SUOSW2::KAISER | Holy St. Asap ! | Thu Apr 07 1988 13:26 | 10 |
| Your're right, these routines work. I played around with them about a year
ago. I've been able to send a message from an accessory to a GEM program
and vice versa. As I did not have any use for the trick I did not look
at the source since then. May be I even don't have it any more. I will try
to find it at home, if you want me to. Another way I tried was to use something
called scratchpad, if I remember well. I think this way it was much easier
to exchange messages. Anyway, I will have a look when I'm at home.
-Hans
|
22.3 | Sorry: I did it in PASCAL | SUOSW2::KAISER | Holy St. Asap ! | Thu Apr 07 1988 13:28 | 0 |
22.4 | shel_get and shel_put | BOLT::MINOW | Je suis marxiste, tendance Groucho | Thu Apr 07 1988 21:54 | 73 |
| There's also a (badly documented) pair of routines that, as far as
I can tell, read and write the in-memory representation of DESKTOP.INF.
They're called shel_get and shel_put. I use them in my terminal emulator
to get the Baud rate. I learned how to call them by decompiling the VT52
desk accessory. Don't assume the following is correct.
Martin.
-----
char shel_buffer[128];
#define END_SHEL_BUFFER (shel_buffer + sizeof shel_buffer)
/*
* These routines were invented by dumping EMULATOR.ACC. Of course,
* the information is undocumented anywhere. shel_get() reads
* a 128 byte buffer consisting of a series of lines of the
* format
* #a stuff \r\n
* #b stuff \r\n
* #c stuff \r\n
* #d \r\n
* The text is taken from the desktop.inf file in the root directory.
* It appears that you can update this buffer by calling shel_put().
* The #a line is for the terminal -- the first five bytes are used:
* -- the "ctrl" byte
* -- the next four bytes are the arguments to Rsconf() -- munged
* for conformance to the new desktop.
* shel_put() updates this buffer (I hope).
*/
get_current_rs232_parameters()
{
register char *tp;
register int i;
static char mung_rs232[] = {
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */
1, 2, 7, 9, 0, 3, 4, 5, 6, 8,10,11,12,13,14,15
};
shel_get(shel_buffer, sizeof shel_buffer);
for (tp = shel_buffer; tp < END_SHEL_BUFFER; tp++) {
if (*tp++ == '#'
&& *tp++ == 'a') {
for (i = 0; i < 5; i++)
rs232_info[i] = *tp++ - '0';
rs232_info[1] = mung_rs232[rs232_info[1]];
break;
}
}
}
save_current_rs232_parameters()
{
register char *tp;
static char unmung_rs232[] = {
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */
'4','0','1','5','6','7','8','2','9','3',':',';','<','=','>','?'
};
shel_get(shel_buffer, sizeof shel_buffer);
for (tp = shel_buffer; tp < END_SHEL_BUFFER; tp++) {
if (*tp++ == '#'
&& *tp++ == 'a') {
*tp++ = rs232_info[0] + '0';
*tp++ = unmung_rs232[rs232_info[1]];
*tp++ = rs232_info[2] + '0';
*tp++ = rs232_info[3] + '0';
*tp++ = rs232_info[4] + '0';
shel_put(shel_buffer, sizeof shel_buffer);
break;
}
}
}
|
22.5 | Thanx, but. . . | AKOV11::KING | George Orwell was an Optimist! | Fri Apr 08 1988 02:59 | 8 |
| I was asking about MWC to get an indication of whether (sp?) or
not I should buy the package, I don't currently own it. I would
*love* to see the pascal code, was it OSS pascal? anyone know if
these routines can be called in assembler, and if so, where are
they?!?
Thanx for all the info so far.
Bob K.
|
22.6 | Pascal examples | SUOSW2::KAISER | Holy St. Asap ! | Fri Apr 08 1988 03:26 | 202 |
| Here is my Pascal example of appl_read and appl_write, but I'm a bit confused
now.
I tried to start my old .PRG with the .ACC loaded, but after a few seconds it
hung. I don't know the reason, may be it's because the files were compiled
under a former version of my Pascal and on my old 520 ST+ (now I have a
MEGA ST2). I didn't have the time to compile it again, but I will try
some time later.
I hope the examples are useful to anyone.
-Hans
File APP.INC
------------
procedure aes_call(op : integer:
var int_in : int_in_parms;
var int_out : int_out_parms;
var addr_in : addr_in_parms;
var addr_out : addr_out_parms); external;
procedure vdi_call(cmd, sub_cmd : integer;
nints, pints : integer;
var ctrl : ctrl_parms;
var int_in : int_in_parms;
var int_out : int_out_parms;
var pts_in : pts_in_parms;
var pts_out : pts_out_parms;
translate : boolean); external;
function appl_find(var filename : string) : integer;
{ AES call 13 : find application id of process with file name FILENAME }
begin
new(addr_in[0]);
addr_in[0]^ := filename;
aes_call(13, int_in, int_out, addr_in, addr_out);
appl_find := int_out[0];
dispose(addr_in[0]]
end;
function appl_read(app_id : integer:
msg_length : integer:
var message : string) : integer;
{ AES call 11 : read MESSAGE_LENGTH characters out of the message buffer
of application APP_ID }
begin
new(addr_in[0]);
int_in[0] := app_id;
int_in[1] := msg_length;
aes_call(11, int_in, int_out, addr_in, addr_out);
message := addr_in[0]^;
appl_read := int_out[0];
end;
function appl_write(app_id : integer:
msg_length : integer:
var message : string) : integer;
{ AES call 12 : write MESSAGE_LENGTH characters into the message buffer
of application APP_ID }
begin
new(addr_in[0]);
addr_in[0]^ := message;
int_in[0] := app_id;
int_in[1] := msg_length;
aes_call(12, int_in, int_out, addr_in, addr_out);
appl_write := int_out[0];
end;
A1.PAS
------
.
.
.
const app_file_name = 'MSG_ACC.ACC';
{$Iapp.inc}
.
.
.
begin
my_app_id := init_gem;
name := app_file_name;
if my_app_id>0 then
begin
.
.
.
m := 'Message from A1';
app_id := appl_find(name);
status := appl_write(app_id, 15, m);
.
.
.
exit_gem
end
end.
MSG_ACC.PAS
-----------
.
.
.
{$Iapp.inc}
.
.
.
begin
my_app_id := init_gem;
.
.
.
{...in event loop...}
status := appl_read(my_app_id, 80, message);
.
.
.
Another way is to use the AES clipboard (not 'scratchpad', sorry).
These programs still work with the old compiled .PRG's.
procedure scrp_read(var message : string);
{ AES call 80 : read string from clipboard }
begin
new(addr_in[0]);
aes_call(80, int_int, int_out, addr_in, addr_out);
message( := addr_in[0]^
end;
procedure scrp_write(var message : string);
{ AES call 81 : write string to clipboard }
begin
new(addr_in[0]);
aes_call(81, int_int, int_out, addr_in, addr_out);
end;
P1.PAS
------
.
.
.
begin
.
.
.
m := 'Message from P1';
scrp_write(m);
.
.
.
end.
P2.PAS
------
{ start it after P1.PRG has finished }
.
.
.
begin
.
.
.
scrp_read(m);
writeln(m);
.
.
.
end.
|
22.7 | Alternate parameter file? | THE780::MESSENGER | An Index of Metals | Fri Apr 08 1988 13:51 | 9 |
| < Note 22.4 by BOLT::MINOW "Je suis marxiste, tendance Groucho" >
>There's also a (badly documented) pair of routines that, as far as
>I can tell, read and write the in-memory representation of DESKTOP.INF.
>They're called shel_get and shel_put. I use them in my terminal emulator
Hmmm, does this mean I could use those functions to invoke an alternate
DESKTOP.INF after system boot?
- HBM
|