mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
* syntax.c: Make structures key_word, context_rule and
_syntax_marker opaque.
This commit is contained in:
parent
41fbb5099f
commit
75fbf0b2f5
@ -1,5 +1,8 @@
|
|||||||
2002-11-30 Pavel Roskin <proski@gnu.org>
|
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.
|
* edit.c: Use g_malloc() and g_free() on buffers1 and buffers2.
|
||||||
Eliminate CMalloc.
|
Eliminate CMalloc.
|
||||||
(edit_get_buffer_as_text): Remove, it's unused.
|
(edit_get_buffer_as_text): Remove, it's unused.
|
||||||
|
@ -3,41 +3,32 @@
|
|||||||
|
|
||||||
#include "src/dlg.h" /* Widget */
|
#include "src/dlg.h" /* Widget */
|
||||||
|
|
||||||
|
#define MAXBUFF 1024
|
||||||
|
#define MAX_MACRO_LENGTH 1024
|
||||||
|
|
||||||
struct macro {
|
struct macro {
|
||||||
short command;
|
short command;
|
||||||
short ch;
|
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 {
|
struct syntax_rule {
|
||||||
unsigned short keyword;
|
unsigned short keyword;
|
||||||
unsigned char end;
|
unsigned char end;
|
||||||
unsigned char context;
|
unsigned char context;
|
||||||
unsigned char _context;
|
unsigned char _context;
|
||||||
#define RULE_ON_LEFT_BORDER 1
|
|
||||||
#define RULE_ON_RIGHT_BORDER 2
|
|
||||||
unsigned char border;
|
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 {
|
struct WEdit {
|
||||||
Widget widget;
|
Widget widget;
|
||||||
#define from_here num_widget_lines
|
#define from_here num_widget_lines
|
||||||
|
30
edit/edit.h
30
edit/edit.h
@ -116,36 +116,6 @@ struct selection {
|
|||||||
int len;
|
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;
|
struct WEdit;
|
||||||
typedef struct WEdit WEdit;
|
typedef struct WEdit WEdit;
|
||||||
|
|
||||||
|
@ -42,6 +42,43 @@
|
|||||||
|
|
||||||
#define UNKNOWN_FORMAT "unknown"
|
#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;
|
int option_syntax_highlighting = 1;
|
||||||
|
|
||||||
static inline void *syntax_malloc (size_t x)
|
static inline void *syntax_malloc (size_t x)
|
||||||
|
Loading…
Reference in New Issue
Block a user