diff options
Diffstat (limited to 'bittorrent/mbtstr/src/contains.c')
| -rw-r--r-- | bittorrent/mbtstr/src/contains.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bittorrent/mbtstr/src/contains.c b/bittorrent/mbtstr/src/contains.c new file mode 100644 index 0000000..b1bcafc --- /dev/null +++ b/bittorrent/mbtstr/src/contains.c @@ -0,0 +1,16 @@ +#include <complex.h> +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> + +#include "mbtstr/view.h" + +bool mbt_cview_contains(struct mbt_cview view, char c) +{ + for (size_t i = 0; i < view.size; i++) + { + if (view.data[i] == c) + return true; + } + return false; +} |
