1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-24 15:17:06 +03:00
Rusty Russell ed349eabd9 lib/ccan/str: relicense to public domain.
LGPL is overkill for trivial wrappers like this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 942f2788e165bb203b0f160f29bd4592f32dc344)
2011-12-05 16:42:45 +10:30

53 lines
1.3 KiB
Plaintext

#include <stdio.h>
#include <string.h>
#include "config.h"
/**
* str - string helper routines
*
* This is a grab bag of functions for string operations, designed to enhance
* the standard string.h.
*
* Note that if you define CCAN_STR_DEBUG, you will get extra compile
* checks on common misuses of the following functions (they will now
* be out-of-line, so there is a runtime penalty!).
*
* strstr, strchr, strrchr:
* Return const char * if first argument is const (gcc only).
*
* isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph,
* islower, isprint, ispunct, isspace, isupper, isxdigit:
* Static and runtime check that input is EOF or an *unsigned*
* char, as per C standard (really!).
*
* Example:
* #include <stdio.h>
* #include <ccan/str/str.h>
*
* int main(int argc, char *argv[])
* {
* if (argv[1] && streq(argv[1], "--verbose"))
* printf("verbose set\n");
* if (argv[1] && strstarts(argv[1], "--"))
* printf("Some option set\n");
* if (argv[1] && strends(argv[1], "cow-powers"))
* printf("Magic option set\n");
* return 0;
* }
*
* License: Public domain
* Author: Rusty Russell <rusty@rustcorp.com.au>
*/
int main(int argc, char *argv[])
{
if (argc != 2)
return 1;
if (strcmp(argv[1], "depends") == 0) {
printf("ccan/build_assert\n");
return 0;
}
return 1;
}