Debian Codegraph @

share/libc/strings.h

raw
1 /**************************************************************************/
2 /* */
3 /* This file is part of Frama-C. */
4 /* */
5 /* Copyright (C) 2007-2022 */
6 /* CEA (Commissariat à l'énergie atomique et aux énergies */
7 /* alternatives) */
8 /* */
9 /* you can redistribute it and/or modify it under the terms of the GNU */
10 /* Lesser General Public License as published by the Free Software */
11 /* Foundation, version 2.1. */
12 /* */
13 /* It is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
16 /* GNU Lesser General Public License for more details. */
17 /* */
18 /* See the GNU Lesser General Public License version 2.1 */
19 /* for more details (enclosed in the file licenses/LGPLv2.1). */
20 /* */
21 /**************************************************************************/
22
23 #ifndef __FC_STRINGS_H_
24 #define __FC_STRINGS_H_
25 #include "features.h"
26 __PUSH_FC_STDLIB
27 #include "__fc_define_size_t.h"
28 #include "__fc_string_axiomatic.h"
29
30 __BEGIN_DECLS
31
32 extern int bcmp(const void *, const void *, size_t);
33 extern void bcopy(const void *, void *, size_t);
34
35
36 /*@ requires valid_memory_area: \valid (((char*) s)+(0 .. n-1));
37 assigns ((char*) s)[0 .. n-1] \from \nothing;
38 ensures s_initialized:initialization:\initialized(((char*) s)+(0 .. n-1));
39 ensures zero_initialized: \subset(((char*) s)[0 .. n-1], {0}); */
40 extern void bzero(void *s, size_t n);
41 extern int ffs(int);
42 extern char *index(const char *, int);
43 extern char *rindex(const char *, int);
44
45 /*@
46 requires valid_string_s1: valid_read_string(s1);
47 requires valid_string_s2: valid_read_string(s2);
48 assigns \result \from indirect:s1[0..], indirect:s2[0..];
49 */
50 extern int strcasecmp(const char *s1, const char *s2);
51
52 /*@
53 requires valid_string_s1: valid_read_nstring(s1, n);
54 requires valid_string_s2: valid_read_nstring(s2, n);
55 assigns \result \from indirect:n, indirect:s1[0..n-1], indirect:s2[0..n-1];
56 */
57 extern int strncasecmp(const char *s1, const char *s2, size_t n);
58
59 __END_DECLS
60
61 __POP_FC_STDLIB
62 #endif