shtr_cache.h (1558B)
1 /* Copyright (C) 2022, 2025, 2026 |Méso|Star> (contact@meso-star.com) 2 * Copyright (C) 2025, 2026 Université de Lorraine 3 * Copyright (C) 2022 Centre National de la Recherche Scientifique 4 * Copyright (C) 2022 Université Paul Sabatier 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 18 19 #ifndef SHTR_CACHE_H 20 #define SHTR_CACHE_H 21 22 #include "shtr_line_list_c.h" 23 24 /* Forward declarations */ 25 struct shtr; 26 struct cache; 27 28 extern LOCAL_SYM res_T 29 cache_create 30 (struct shtr* shtr, 31 struct cache** cache); 32 33 extern LOCAL_SYM void 34 cache_ref_get 35 (struct cache* cache); 36 37 extern LOCAL_SYM void 38 cache_ref_put 39 (struct cache* cache); 40 41 /* Returns RES_BAD_ARG if the line is not in the cache */ 42 extern LOCAL_SYM res_T 43 cache_get_line 44 (struct cache* cache, 45 const size_t line_id, 46 struct line* line); 47 48 extern LOCAL_SYM void 49 cache_put_chunk 50 (struct cache* cache, 51 const size_t chunk_id, 52 const struct line lines[NLINES_PER_CHUNK]); 53 54 #endif /* SHTR_CACHE_H */