Source to jet/jet.c


Enter a symbol's name here to quickly find it.

#include <Events.h>

#include "osbind.h"

#define START "mint.prg"
#define CMDMAX 127

static void setcmd(char *cmd);

static char *env = "JET=1\0";

int main(void)
{
	char cmd[CMDMAX];

	setcmd(cmd);
	p_exec(0, START, cmd, env);
	/* shouldn't reach here */
	p_term(0);
	return 0;
}

static void setcmd(char *cmd)
{
	char *p;
	short c, n;
	EventRecord event;
	
	cmd[0] = 0;
	EventAvail(0, &event);
	if (event.modifiers & cmdKey) {
		c_conws("enter command line parameters: ");
		p = cmd;
		n = CMDMAX;
		c = b_conin(2);
		while (c != '\r' && --n) {
			if (c >= 0x20) {
				b_conout(2, c);
				*p++ = c;
			}
			c = b_conin(2);
		}
		*p = 0;
  	}
}