projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changing _CONFIG_H to CONFIG_H_INCLUDED.
[privoxy.git]
/
pcrs.h
diff --git
a/pcrs.h
b/pcrs.h
index
6b635fb
..
31fb887
100644
(file)
--- a/
pcrs.h
+++ b/
pcrs.h
@@
-1,5
+1,5
@@
-#ifndef
_PCRS_H
-#define
_PCRS_H
+#ifndef
PCRS_H_INCLUDED
+#define
PCRS_H_INCLUDED
/*********************************************************************
*
/*********************************************************************
*
@@
-26,6
+26,14
@@
*
* Revisions :
* $Log: pcrs.h,v $
*
* Revisions :
* $Log: pcrs.h,v $
+ * Revision 1.5 2001/07/18 17:27:00 oes
+ * Changed interface; Cosmetics
+ *
+ * Revision 1.4 2001/06/29 13:33:19 oes
+ * - Cleaned up, commented and adapted to reflect the
+ * changes in pcrs.c
+ * - Introduced the PCRS_* flags
+ *
* Revision 1.3 2001/06/09 10:58:57 jongfoster
* Removing a single unused #define which referenced BUFSIZ
*
* Revision 1.3 2001/06/09 10:58:57 jongfoster
* Removing a single unused #define which referenced BUFSIZ
*
@@
-49,11
+57,15
@@
*
*********************************************************************/
*
*********************************************************************/
-#define PCRS_H_VERSION "$Id: pcrs.h,v 1.
3 2001/06/09 10:58:57 jongfoster
Exp $"
+#define PCRS_H_VERSION "$Id: pcrs.h,v 1.
5 2001/07/18 17:27:00 oes
Exp $"
\f
#include <pcre.h>
\f
#include <pcre.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Constants:
*/
/*
* Constants:
*/
@@
-74,14
+86,14
@@
/* Flags */
#define PCRS_GLOBAL 1 /* Job should be applied globally, as with perl's g option */
#define PCRS_SUCCESS 2 /* Job did previously match */
/* Flags */
#define PCRS_GLOBAL 1 /* Job should be applied globally, as with perl's g option */
#define PCRS_SUCCESS 2 /* Job did previously match */
-#define PCRS_TRIVIAL 4 /*
No backreferences need to be parsed in the substitute
*/
+#define PCRS_TRIVIAL 4 /*
Backreferences in the substitute are ignored
*/
/*
* Data types:
*/
/* A compiled substitute */
/*
* Data types:
*/
/* A compiled substitute */
-typedef struct
S_
PCRS_SUBSTITUTE {
+typedef struct PCRS_SUBSTITUTE {
char *text; /* The plaintext part of the substitute, with all backreferences stripped */
int backrefs; /* The number of backreferences */
int block_offset[PCRS_MAX_SUBMATCHES]; /* Array with the offsets of all plaintext blocks in text */
char *text; /* The plaintext part of the substitute, with all backreferences stripped */
int backrefs; /* The number of backreferences */
int block_offset[PCRS_MAX_SUBMATCHES]; /* Array with the offsets of all plaintext blocks in text */
@@
-90,20
+102,20
@@
typedef struct S_PCRS_SUBSTITUTE {
int backref_count[PCRS_MAX_SUBMATCHES]; /* Array with the number of reference to each backref index */
} pcrs_substitute;
int backref_count[PCRS_MAX_SUBMATCHES]; /* Array with the number of reference to each backref index */
} pcrs_substitute;
-typedef struct
S_
PCRS_MATCH {
+typedef struct PCRS_MATCH {
/* char *buffer; */
int submatches; /* Number of submatches. Note: The zeroth is the whole match */
int submatch_offset[PCRS_MAX_SUBMATCHES]; /* Offset for each submatch in the subject */
int submatch_length[PCRS_MAX_SUBMATCHES]; /* Length of each submatch in the subject */
} pcrs_match;
/* char *buffer; */
int submatches; /* Number of submatches. Note: The zeroth is the whole match */
int submatch_offset[PCRS_MAX_SUBMATCHES]; /* Offset for each submatch in the subject */
int submatch_length[PCRS_MAX_SUBMATCHES]; /* Length of each submatch in the subject */
} pcrs_match;
-typedef struct
S_
PCRS_JOB {
+typedef struct PCRS_JOB {
pcre *pattern; /* The compiled pcre pattern */
pcre_extra *hints; /* The pcre hints for the pattern */
int options; /* The pcre options (numeric) */
int flags; /* The pcrs and user flags (see "Flags" above) */
pcrs_substitute *substitute; /* The compiles pcrs substitute */
pcre *pattern; /* The compiled pcre pattern */
pcre_extra *hints; /* The pcre hints for the pattern */
int options; /* The pcre options (numeric) */
int flags; /* The pcrs and user flags (see "Flags" above) */
pcrs_substitute *substitute; /* The compiles pcrs substitute */
- struct
S_PCRS_JOB *next;
/* Pointer for chaining jobs to joblists */
+ struct
PCRS_JOB *next;
/* Pointer for chaining jobs to joblists */
} pcrs_job;
/*
} pcrs_job;
/*
@@
-111,8
+123,8
@@
typedef struct S_PCRS_JOB {
*/
/* Main usage */
*/
/* Main usage */
-extern pcrs_job *pcrs_compile(char *command, int *errptr);
-extern pcrs_job *pcrs_
make_job
(char *pattern, char *substitute, char *options, int *errptr);
+extern pcrs_job *pcrs_compile
_command
(char *command, int *errptr);
+extern pcrs_job *pcrs_
compile
(char *pattern, char *substitute, char *options, int *errptr);
extern int pcrs_execute(pcrs_job *job, char *subject, int subject_length, char **result, int *result_length);
/* Freeing jobs */
extern int pcrs_execute(pcrs_job *job, char *subject, int subject_length, char **result, int *result_length);
/* Freeing jobs */
@@
-123,7
+135,11
@@
extern void pcrs_free_joblist(pcrs_job *joblist);
extern int pcrs_compile_perl_options(char *optstring, int *flags);
extern pcrs_substitute *pcrs_compile_replacement(char *replacement, int trivialflag, int *errptr);
extern int pcrs_compile_perl_options(char *optstring, int *flags);
extern pcrs_substitute *pcrs_compile_replacement(char *replacement, int trivialflag, int *errptr);
-#endif /* ndef _PCRS_H */
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* ndef PCRS_H_INCLUDED */
/*
Local Variables:
/*
Local Variables: