File: macro.h

package info (click to toggle)
joe 3.7-2.3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,304 kB
  • sloc: ansic: 34,071; sh: 3,426; makefile: 138
file content (71 lines) | stat: -rw-r--r-- 1,943 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 *	Keyboard macros
 *	Copyright
 *		(C) 1992 Joseph H. Allen
 *
 *	This file is part of JOE (Joe's Own Editor)
 */
#ifndef _JOE_MACRO_H
#define _JOE_MACRO_H 1

struct macro {
	int k; /* Keycode */
	int flg; /* Flags: bit 0: this step wants the negative arg,
	                   bit 1: ignore return value of this step, but use it as return value of macro */
	CMD *cmd; /* Command address */
	int n; /* Number of steps */
	int size; /* Malloc size of steps */
	MACRO **steps; /* Block */
};

struct recmac {
	struct recmac *next;
	int	n;
	MACRO	*m;
};

extern struct recmac *recmac; /* Set when macro is recording: for status line */

/* Macro construction functions */
MACRO *mkmacro PARAMS((int k, int arg, int n, CMD *cmd));
void addmacro PARAMS((MACRO *macro, MACRO *m));
MACRO *dupmacro PARAMS((MACRO *mac));
void rmmacro PARAMS((MACRO *macro));
MACRO *macstk PARAMS((MACRO *m, int k));
MACRO *macsta PARAMS((MACRO *m, int a));

void chmac PARAMS((void));

/* Text to macro / Macro to text */
MACRO *mparse PARAMS((MACRO *m, unsigned char *buf, int *sta));
unsigned char *mtext PARAMS((unsigned char *s, MACRO *m));

/* Execute a macro */
extern MACRO *curmacro; /* Current macro being executed */
int exemac PARAMS((MACRO *m));
int exmacro PARAMS((MACRO *m, int u));

/* Keyboard macros user interface */
int uplay PARAMS((BW *bw, int c));
int ustop PARAMS((void));
int urecord PARAMS((BW *bw, int c));
int uquery PARAMS((BW *bw));
int umacros PARAMS((BW *bw));

/* Repeat prefix user command */
int uarg PARAMS((BW *bw));
int uuarg PARAMS((BW *bw, int c));
int uif PARAMS((BW *bw));
int uelsif PARAMS((BW *bw));
int uelse PARAMS((BW *bw));
int uendif PARAMS((BW *bw));

unsigned char *unescape PARAMS((unsigned char *ptr,int c));

void load_macros PARAMS((FILE *f));
void save_macros PARAMS((FILE *f));

extern int current_arg; /* Current macro repeat argument */
extern int current_arg_set; /* Set if repeat arg was given */

#endif