25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: console.c,v 1.8 2005/05/29 17:51:45 debug Exp $ |
* $Id: console.c,v 1.9 2005/06/26 11:36:27 debug Exp $ |
29 |
* |
* |
30 |
* Generic console support functions. |
* Generic console support functions. |
31 |
* |
* |
186 |
a[4] = console_handles[handle].name; |
a[4] = console_handles[handle].name; |
187 |
a[5] = "-e"; |
a[5] = "-e"; |
188 |
a[6] = progname; |
a[6] = progname; |
189 |
a[7] = malloc(50); |
a[7] = malloc(80); |
190 |
sprintf(a[7], "-WW@S%i,%i", filedes[0], filedesB[1]); |
snprintf(a[7], 80, "-WW@S%i,%i", filedes[0], filedesB[1]); |
191 |
a[8] = NULL; |
a[8] = NULL; |
192 |
|
|
193 |
p = fork(); |
p = fork(); |
641 |
int console_start_slave(struct machine *machine, char *consolename) |
int console_start_slave(struct machine *machine, char *consolename) |
642 |
{ |
{ |
643 |
int handle; |
int handle; |
644 |
|
size_t mlen; |
645 |
struct console_handle *chp; |
struct console_handle *chp; |
646 |
|
|
647 |
if (machine == NULL || consolename == NULL) { |
if (machine == NULL || consolename == NULL) { |
651 |
|
|
652 |
chp = console_new_handle(consolename, &handle); |
chp = console_new_handle(consolename, &handle); |
653 |
|
|
654 |
chp->name = malloc(strlen(machine->name) + strlen(consolename) + 100); |
mlen = strlen(machine->name) + strlen(consolename) + 40; |
655 |
|
chp->name = malloc(mlen); |
656 |
if (chp->name == NULL) { |
if (chp->name == NULL) { |
657 |
printf("out of memory\n"); |
printf("out of memory\n"); |
658 |
exit(1); |
exit(1); |
659 |
} |
} |
660 |
sprintf(chp->name, "GXemul: '%s' %s", machine->name, consolename); |
snprintf(chp->name, mlen, "GXemul: '%s' %s", |
661 |
|
machine->name, consolename); |
662 |
|
|
663 |
#if 0 |
#if 0 |
664 |
if (!machine->use_x11) { |
if (!machine->use_x11) { |
687 |
{ |
{ |
688 |
struct console_handle *chp; |
struct console_handle *chp; |
689 |
int handle; |
int handle; |
690 |
|
size_t mlen; |
691 |
|
|
692 |
if (machine == NULL || consolename == NULL) { |
if (machine == NULL || consolename == NULL) { |
693 |
printf("console_start_slave(): NULL ptr\n"); |
printf("console_start_slave(): NULL ptr\n"); |
697 |
chp = console_new_handle(consolename, &handle); |
chp = console_new_handle(consolename, &handle); |
698 |
chp->inputonly = 1; |
chp->inputonly = 1; |
699 |
|
|
700 |
chp->name = malloc(strlen(machine->name) + strlen(consolename) + 100); |
mlen = strlen(machine->name) + strlen(consolename) + 40; |
701 |
|
chp->name = malloc(mlen); |
702 |
if (chp->name == NULL) { |
if (chp->name == NULL) { |
703 |
printf("out of memory\n"); |
printf("out of memory\n"); |
704 |
exit(1); |
exit(1); |
705 |
} |
} |
706 |
sprintf(chp->name, "GXemul: '%s' %s", machine->name, consolename); |
snprintf(chp->name, mlen, "GXemul: '%s' %s", |
707 |
|
machine->name, consolename); |
708 |
|
|
709 |
return handle; |
return handle; |
710 |
} |
} |