CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
littlefs_searching.h
Go to the documentation of this file.
1#ifndef INCLUDE_GUARD__LITTLEFS_SEARCHING_H
2#define INCLUDE_GUARD__LITTLEFS_SEARCHING_H
3
4#include <stdint.h>
5#include <stdlib.h>
6#include "littlefs/lfs.h"
7
8
10 const char *filename,
11 const uint8_t *needle,
12 size_t needle_len
13);
14
15
17 const char *filename,
18 const uint8_t *needle,
19 size_t needle_len,
20 uint16_t n,
21 lfs_soff_t *out_offset
22);
23
24#endif // INCLUDE_GUARD__LITTLEFS_SEARCHING_H
int32_t lfs_soff_t
Definition lfs.h:43
int32_t LFS_search_find_nth_occurrence(const char *filename, const uint8_t *needle, size_t needle_len, uint16_t n, lfs_soff_t *out_offset)
Find the byte offset of the nth occurrence of a string/byte pattern in an LFS file.
Definition littlefs_searching.c:76
int32_t LFS_search_count_occurrences(const char *filename, const uint8_t *needle, size_t needle_len)
Count the number of occurrences of a string/byte pattern in an LFS file.
Definition littlefs_searching.c:13