I don't know; they aren't part of standard C.
I think a common use for macros like this is to facilitate sharing
headers between C and C++ by defining them something like this:
#ifdef __cplusplus
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
#else
#define __BEGIN_DECLS
#define __END_DECLS
#endif
The OP could check whether this is true in his case by grepping for
something like "#define *__BEGIN_DECLS" in his BSD headers.
Also not part of standard C. We could speculate, though, that to
that particular implementation, it means that the routine has no
side effects.
Specifically, this informs the compiler that it can optimize away calls
to strlen. If there's also
my_do_all_function(const char *filename);
and I have code like
char *s=get_input();
strlen(s); /* discard the return value */
my_do_all_function(s); /* discard the return value */
then the fact that strlen is pure tells the compiler it doesn't need to
include code for the strlen call, whereas it can't just get rid of the
call to my_do_all_function because it might have side effects.
You can also add __pure to your own function definitions, but for
maximum portability (other compilers may have a different syntax, or not
support it at all) use preprocessor macros like:
#ifdef __foo_bar_compiler
#define PURE __pure
#else
#define PURE
#endif
int simple_count(const char **s, size_t n) PURE
{
/* function with no side_effects */
}