View | Details | Raw Unified | Return to bug 184632
Collapse All | Expand All

(-)instant/tables.c (-1 / +1 lines)
Lines 84-90 Link Here
84
#include <sys/types.h>
84
#include <sys/types.h>
85
#include <errno.h>
85
#include <errno.h>
86
86
87
#include <regexp.h>
87
#include <regex.h>
88
#include "general.h"
88
#include "general.h"
89
#include "translate.h"
89
#include "translate.h"
90
90
(-)instant/traninit.c (-1 / +18 lines)
Lines 69-75 Link Here
69
#include <memory.h>
69
#include <memory.h>
70
#include <sys/types.h>
70
#include <sys/types.h>
71
#include <errno.h>
71
#include <errno.h>
72
#include <regexp.h>
72
#include <regex.h>
73
73
74
#include "general.h"
74
#include "general.h"
75
#include "translate.h"
75
#include "translate.h"
Lines 100-105 Link Here
100
void	AddSDATA(const char *from, const char *to);
100
void	AddSDATA(const char *from, const char *to);
101
101
102
/* ______________________________________________________________________ */
102
/* ______________________________________________________________________ */
103
/* minimal compatibility wrapper for UNIX V8 regexp, match only
104
 */
105
106
static regex_t *v8_regcomp(const char *pattern)
107
{
108
	regex_t *re;
109
	if ((re = malloc(sizeof(regex_t))) != NULL) {
110
		if (regcomp(re, pattern, REG_EXTENDED|REG_NOSUB)) {
111
			free(re);
112
			return NULL;
113
		}
114
	}
115
	return re;
116
}
117
#define regcomp	v8_regcomp
118
119
/* ______________________________________________________________________ */
103
/*  Read the translation specs from the input file, storing in memory.
120
/*  Read the translation specs from the input file, storing in memory.
104
 *  Arguments:
121
 *  Arguments:
105
 *	Name of translation spec file.
122
 *	Name of translation spec file.
(-)instant/translate.c (-1 / +13 lines)
Lines 69-75 Link Here
69
#include <memory.h>
69
#include <memory.h>
70
#include <sys/types.h>
70
#include <sys/types.h>
71
#include <errno.h>
71
#include <errno.h>
72
#include <regexp.h>
72
#include <regex.h>
73
73
74
#include "general.h"
74
#include "general.h"
75
#define STORAGE
75
#define STORAGE
Lines 82-87 Link Here
82
static void	WasProcessed(Element_t *);
82
static void	WasProcessed(Element_t *);
83
83
84
/* ______________________________________________________________________ */
84
/* ______________________________________________________________________ */
85
/* minimal compatibility wrapper for UNIX V8 regexp, match only 
86
 */
87
88
static int v8_regexec(const regex_t *re, const char *string)
89
{
90
	if (re == NULL)
91
		return 0;
92
	return !regexec(re, string, 0, NULL, 0);
93
}
94
#define regexec	v8_regexec
95
96
/* ______________________________________________________________________ */
85
/*  Translate the subtree starting at 'e'. Output goes to 'fp'.
97
/*  Translate the subtree starting at 'e'. Output goes to 'fp'.
86
 *  This is the entry point for translating an instance.
98
 *  This is the entry point for translating an instance.
87
 *  Arguments:
99
 *  Arguments:
(-)instant/translate.h (-5 / +4 lines)
Lines 75-81 Link Here
75
typedef struct {
75
typedef struct {
76
    char	*name;		/* attribute name string */
76
    char	*name;		/* attribute name string */
77
    char	*val;		/* attribute value string */
77
    char	*val;		/* attribute value string */
78
    regexp	*rex;		/* attribute value reg expr (compiled) */
78
    regex_t	*rex;		/* attribute value reg expr (compiled) */
79
} AttPair_t;
79
} AttPair_t;
80
80
81
typedef struct _Trans {
81
typedef struct _Trans {
Lines 83-101 Link Here
83
    char	*gi;		/* element name of tag under consideration */
83
    char	*gi;		/* element name of tag under consideration */
84
    char	**gilist;	/* list of element names (multiple gi's) */
84
    char	**gilist;	/* list of element names (multiple gi's) */
85
    char	*context;	/* context in tree - looking depth levels up */
85
    char	*context;	/* context in tree - looking depth levels up */
86
    regexp	*context_re;	/* tree heirarchy looking depth levels up */
86
    regex_t	*context_re;	/* tree heirarchy looking depth levels up */
87
    int		depth;		/* number of levels to look up the tree */
87
    int		depth;		/* number of levels to look up the tree */
88
    AttPair_t	*attpair;	/* attr name-value pairs */
88
    AttPair_t	*attpair;	/* attr name-value pairs */
89
    int		nattpairs;	/* number of name-value pairs */
89
    int		nattpairs;	/* number of name-value pairs */
90
    char	*parent;	/* GI has this element as parent */
90
    char	*parent;	/* GI has this element as parent */
91
    int		nth_child;	/* GI is Nth child of this of parent element */
91
    int		nth_child;	/* GI is Nth child of this of parent element */
92
    char	*content;	/* element has this string in content */
92
    char	*content;	/* element has this string in content */
93
    regexp	*content_re;	/* content reg expr (compiled) */
93
    regex_t	*content_re;	/* content reg expr (compiled) */
94
    char	*pattrset;	/* is this attr set (any value) in parent? */
94
    char	*pattrset;	/* is this attr set (any value) in parent? */
95
    char	*var_name;	/* variable name */
95
    char	*var_name;	/* variable name */
96
    char	*var_value;	/* variable value */
96
    char	*var_value;	/* variable value */
97
    char	*var_RE_name;	/* variable name (for VarREValue) */
97
    char	*var_RE_name;	/* variable name (for VarREValue) */
98
    regexp	*var_RE_value;	/* variable value (compiled, for VarREValue) */
98
    regex_t	*var_RE_value;	/* variable value (compiled, for VarREValue) */
99
    Map_t	*relations;	/* various relations to check */
99
    Map_t	*relations;	/* various relations to check */
100
100
101
    /* actions */
101
    /* actions */
Lines 150-153 Link Here
150
void	OSFtable(Element_t *, FILE *, char **, int);
150
void	OSFtable(Element_t *, FILE *, char **, int);
151
151
152
/* ______________________________________________________________________ */
152
/* ______________________________________________________________________ */
153
(-)instant/tranvar.c (-1 / +1 lines)
Lines 66-72 Link Here
66
#include <sys/types.h>
66
#include <sys/types.h>
67
#include <errno.h>
67
#include <errno.h>
68
68
69
#include <regexp.h>
69
#include <regex.h>
70
#include "general.h"
70
#include "general.h"
71
#include "translate.h"
71
#include "translate.h"
72
72
(-)instant/util.c (-1 / +1 lines)
Lines 85-91 Link Here
85
#include <sys/stat.h>
85
#include <sys/stat.h>
86
#include <sys/file.h>
86
#include <sys/file.h>
87
#include <errno.h>
87
#include <errno.h>
88
#include <regexp.h>
88
#include <regex.h>
89
/* CSS don't have it and I don't see where it's used
89
/* CSS don't have it and I don't see where it's used
90
#include <values.h>
90
#include <values.h>
91
*/
91
*/

Return to bug 184632