* syntax.c: Make structures key_word, context_rule and

_syntax_marker opaque.
This commit is contained in:
Pavel Roskin 2002-11-30 18:07:42 +00:00
parent 41fbb5099f
commit 75fbf0b2f5
4 changed files with 53 additions and 52 deletions

View File

@ -1,5 +1,8 @@
2002-11-30 Pavel Roskin <proski@gnu.org>
* syntax.c: Make structures key_word, context_rule and
_syntax_marker opaque.
* edit.c: Use g_malloc() and g_free() on buffers1 and buffers2.
Eliminate CMalloc.
(edit_get_buffer_as_text): Remove, it's unused.

View File

@ -3,41 +3,32 @@
#include "src/dlg.h" /* Widget */
#define MAXBUFF 1024
#define MAX_MACRO_LENGTH 1024
struct macro {
short command;
short ch;
};
#define BOOK_MARK_COLOR ((25 << 8) | 5)
#define BOOK_MARK_FOUND_COLOR ((26 << 8) | 4)
struct _book_mark {
int line; /* line number */
int c; /* color */
struct _book_mark *next;
struct _book_mark *prev;
};
struct syntax_rule {
unsigned short keyword;
unsigned char end;
unsigned char context;
unsigned char _context;
#define RULE_ON_LEFT_BORDER 1
#define RULE_ON_RIGHT_BORDER 2
unsigned char border;
};
/*there are a maximum of ... */
#define MAXBUFF 1024
#define MAX_MACRO_LENGTH 1024
struct _syntax_marker {
long offset;
struct syntax_rule rule;
struct _syntax_marker *next;
};
struct _book_mark {
int line; /* line number */
/* #define BOOK_MARK_COLOR ((0 << 8) | 26) */ /* black on white */
#define BOOK_MARK_COLOR ((25 << 8) | 5)
#define BOOK_MARK_FOUND_COLOR ((26 << 8) | 4)
int c; /* colour */
struct _book_mark *next;
struct _book_mark *prev;
};
struct WEdit {
Widget widget;
#define from_here num_widget_lines

View File

@ -116,36 +116,6 @@ struct selection {
int len;
};
#define MAX_WORDS_PER_CONTEXT 1024
#define MAX_CONTEXTS 128
struct key_word {
char *keyword;
unsigned char first;
char *whole_word_chars_left;
char *whole_word_chars_right;
#define NO_COLOR 0x7FFFFFFF
#define SPELLING_ERROR 0x7EFEFEFE
int line_start;
int color;
};
struct context_rule {
char *left;
unsigned char first_left;
char *right;
unsigned char first_right;
char line_start_left;
char line_start_right;
int between_delimiters;
char *whole_word_chars_left;
char *whole_word_chars_right;
char *keyword_first_chars;
int spelling;
/* first word is word[1] */
struct key_word **keyword;
};
struct WEdit;
typedef struct WEdit WEdit;

View File

@ -42,6 +42,43 @@
#define UNKNOWN_FORMAT "unknown"
#define MAX_WORDS_PER_CONTEXT 1024
#define MAX_CONTEXTS 128
#define RULE_ON_LEFT_BORDER 1
#define RULE_ON_RIGHT_BORDER 2
struct key_word {
char *keyword;
unsigned char first;
char *whole_word_chars_left;
char *whole_word_chars_right;
int line_start;
int color;
};
struct context_rule {
char *left;
unsigned char first_left;
char *right;
unsigned char first_right;
char line_start_left;
char line_start_right;
int between_delimiters;
char *whole_word_chars_left;
char *whole_word_chars_right;
char *keyword_first_chars;
int spelling;
/* first word is word[1] */
struct key_word **keyword;
};
struct _syntax_marker {
long offset;
struct syntax_rule rule;
struct _syntax_marker *next;
};
int option_syntax_highlighting = 1;
static inline void *syntax_malloc (size_t x)