Article View: comp.sys.atari.st
Article #25126Re: Question on Exec with Lattice C
From: turner
Date: Mon, 16 Feb 1987 19:23
Date: Mon, 16 Feb 1987 19:23
68 lines
3084 bytes
3084 bytes
in article <852@laidbak.UUCP>, tm@laidbak.UUCP (Takis Mercouris) says:
>
> Also, I looked in some usenet code (I think stmake) and the author seemed to
> be encoding the length of the tail in its first byte. However, this is not
> documented neither in my Lattice C manual (of course), nor in the Abacus
> internals.
undocumented as it may be, it's correct. the length of the tail must
be the first byte of the tail `string`, also the max length of the
tail is 127 bytes (0x7f) for example
char command[128],env[128],tail[128]; /* these could be pointers and */
/* the exact amount of storage */
/* malloc'd */
strcpy(command,"d:\\bin\\emacs"); /* command */
env = NULL; /* inherit the parent's env */
strcpy(tail," @d:emacs.rc myfile.txt"); /* note the leading blank */
tail[0] = 22; /* length of tail */
ierr = Pexec(0,command,tail,env); /* 0 mode - load and go */
.
.
.
>
> Finally, is the Abacus function number $4B for exec correct?
>
Yes it is
> Any sample program, clue, hint will be greatly appreciated
see above, just for the heck of it here's the mode table:
---------------------------------------------------------
| |
|______mode_________ptr1________ptr2__________ptr3______|
| 0 = load and go | file | command | environment |
| | to exec | tail | string |
---------------------------------------------------------
| 3 = load, no go | file | command | environment |
| | to load | tail | string |
---------------------------------------------------------
| 4 = just go | basepage| (unused) | (unused) |
| | address | | |
---------------------------------------------------------
| 5 = create | (unused)| command | environment |
| basepage | | tail | string |
---------------------------------------------------------
the environment string is either NULL or a pointer to series of
NULL terminated strings of the form:
string1\0
string2\0
.
.
stringn\0
\0
if you need any more info, i suggest you get the dev kit..
(quick, duck! incoming flames)
--
---------------
C'est la vie, C'est la guerre, C'est la pomme de terre
Mail: Imagen Corp. 2650 San Tomas Expressway Santa Clara, CA 95052-8101
UUCP: ...{decvax,ucbvax}!decwrl!imagen!turner AT&T: (408) 986-9400
Technical Details
Message-ID:
<878@imagen.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!mit-eddie!genrad!decvax!decwrl!sun!imagen!turnerReferences:
<852@laidbak.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!mit-eddie!genrad!decvax!decwrl!sun!imagen!turner From: turner@imagen.UUCP Newsgroups: comp.sys.atari.st Subject: Re: Question on Exec with Lattice C Message-ID: <878@imagen.UUCP> Date: Mon, 16-Feb-87 14:23:29 EST Article-I.D.: imagen.878 Posted: Mon Feb 16 14:23:29 1987 Date-Received: Tue, 17-Feb-87 21:31:55 EST References: <852@laidbak.UUCP> Organization: The Houses of the Holy Lines: 68