File: leditcfns.c

package info (click to toggle)
xemacs21 21.4.22-3.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 32,540 kB
  • ctags: 32,511
  • sloc: ansic: 243,759; lisp: 94,063; sh: 7,453; cpp: 5,726; perl: 1,095; makefile: 843; cs: 775; python: 279; asm: 248; lex: 119; yacc: 95; sed: 22; csh: 9
file content (20 lines) | stat: -rw-r--r-- 462 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Synched up with: FSF 19.28. */

#include <sgtty.h>
#include <signal.h>
#define STRLEN 100
static char str[STRLEN+1] = "%?emacs"; /* extra char for the null */

switch_to_proc(){
    char *ptr = str;
    while (*ptr) ioctl(0, TIOCSTI, ptr++);
    ioctl(0, TIOCSTI, "\n");
    kill(getpid(), SIGTSTP);
    }

set_proc_str(ptr) char *ptr; {
    if (strlen(ptr) <= STRLEN)
	strcpy(str, ptr);
    else
	printf("string too long for set-proc-str: %s\n", ptr);
    }