]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/regex/test/c_compiler_checks/posix_api_check.c
3 * Copyright (c) 1998-2002
6 * Use, modification and distribution are subject to the
7 * Boost Software License, Version 1.0. (See accompanying file
8 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
13 * LOCATION: see http://www.boost.org for most recent version.
14 * FILE posix_api_compiler_check.c
15 * VERSION see <boost/version.hpp>
16 * DESCRIPTION: Verify that POSIX API calls compile: note this is a compile
23 #include <boost/regex.h>
25 const char* expression
= "^";
26 const char* text
= "\n ";
27 regmatch_t matches
[1];
28 int flags
= REG_EXTENDED
| REG_BASIC
| REG_NOSPEC
| REG_ICASE
| REG_NOSUB
|
29 REG_NEWLINE
| REG_PEND
| REG_NOCOLLATE
| REG_ESCAPE_IN_LISTS
|
30 REG_NEWLINE_ALT
| REG_PERL
| REG_AWK
| REG_GREP
| REG_EGREP
;
37 result
= regcompA(&re
, expression
, REG_AWK
);
38 if(result
> (int)REG_NOERROR
)
41 regerrorA(result
, &re
, buf
, sizeof(buf
));
45 assert(re
.re_nsub
== 0);
47 matches
[0].rm_eo
= strlen(text
);
48 result
= regexecA(&re
, text
, 1, matches
, REG_NOTBOL
| REG_NOTEOL
| REG_STARTEND
);
49 if(result
> (int)REG_NOERROR
)
52 regerrorA(result
, &re
, buf
, sizeof(buf
));
57 assert((matches
[0].rm_so
== matches
[0].rm_eo
) && (matches
[0].rm_eo
== 1));
59 printf("no errors found\n");