1 /* 2 * Utility functions for stat structures. 3 * 4 * Copyright (C) 2022, 2024 Paul Boddie <paul@boddie.org.uk> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (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, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA 20 */ 21 22 #include "stat.h" 23 24 void (*systypes_copy_from_sys_stat_override)(struct stat *, sys_stat_t *) = NULL; 25 void (*systypes_copy_to_sys_stat_override)(struct stat *, sys_stat_t *) = NULL; 26 27 void systypes_copy_from_sys_stat(struct stat *st, sys_stat_t *sst) 28 { 29 if (systypes_copy_from_sys_stat_override != NULL) 30 systypes_copy_from_sys_stat_override(st, sst); 31 else 32 COPY_STAT(st, sst) 33 } 34 35 void systypes_copy_to_sys_stat(struct stat *st, sys_stat_t *sst) 36 { 37 if (systypes_copy_to_sys_stat_override != NULL) 38 systypes_copy_to_sys_stat_override(st, sst); 39 else 40 COPY_STAT(sst, st) 41 } 42 43 /* vim: tabstop=2 expandtab shiftwidth=2 44 */