| 6 |
and semantics are as close as possible to those of the Perl 5 language. |
and semantics are as close as possible to those of the Perl 5 language. |
| 7 |
|
|
| 8 |
Written by Philip Hazel |
Written by Philip Hazel |
| 9 |
Copyright (c) 1997-2007 University of Cambridge |
Copyright (c) 1997-2009 University of Cambridge |
| 10 |
|
|
| 11 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 12 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 48 |
|
|
| 49 |
|
|
| 50 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
| 51 |
#include <config.h> |
#include "config.h" |
| 52 |
#endif |
#endif |
| 53 |
|
|
| 54 |
#include "pcre_internal.h" |
#include "pcre_internal.h" |
| 73 |
*/ |
*/ |
| 74 |
|
|
| 75 |
BOOL |
BOOL |
| 76 |
_pcre_is_newline(const uschar *ptr, int type, const uschar *endptr, |
_pcre_is_newline(USPTR ptr, int type, USPTR endptr, int *lenptr, BOOL utf8) |
|
int *lenptr, BOOL utf8) |
|
| 77 |
{ |
{ |
| 78 |
int c; |
int c; |
| 79 |
if (utf8) { GETCHAR(c, ptr); } else c = *ptr; |
if (utf8) { GETCHAR(c, ptr); } else c = *ptr; |
| 122 |
*/ |
*/ |
| 123 |
|
|
| 124 |
BOOL |
BOOL |
| 125 |
_pcre_was_newline(const uschar *ptr, int type, const uschar *startptr, |
_pcre_was_newline(USPTR ptr, int type, USPTR startptr, int *lenptr, BOOL utf8) |
|
int *lenptr, BOOL utf8) |
|
| 126 |
{ |
{ |
| 127 |
int c; |
int c; |
| 128 |
ptr--; |
ptr--; |
| 129 |
|
#ifdef SUPPORT_UTF8 |
| 130 |
if (utf8) |
if (utf8) |
| 131 |
{ |
{ |
| 132 |
BACKCHAR(ptr); |
BACKCHAR(ptr); |
| 133 |
GETCHAR(c, ptr); |
GETCHAR(c, ptr); |
| 134 |
} |
} |
| 135 |
else c = *ptr; |
else c = *ptr; |
| 136 |
|
#else /* no UTF-8 support */ |
| 137 |
|
c = *ptr; |
| 138 |
|
#endif /* SUPPORT_UTF8 */ |
| 139 |
|
|
| 140 |
if (type == NLTYPE_ANYCRLF) switch(c) |
if (type == NLTYPE_ANYCRLF) switch(c) |
| 141 |
{ |
{ |