paul@277 | 1 | /* |
paul@277 | 2 | * Utility functions for stat structures. |
paul@277 | 3 | * |
paul@648 | 4 | * Copyright (C) 2022, 2024 Paul Boddie <paul@boddie.org.uk> |
paul@277 | 5 | * |
paul@277 | 6 | * This program is free software; you can redistribute it and/or |
paul@277 | 7 | * modify it under the terms of the GNU General Public License as |
paul@277 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@277 | 9 | * the License, or (at your option) any later version. |
paul@277 | 10 | * |
paul@277 | 11 | * This program is distributed in the hope that it will be useful, |
paul@277 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@277 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@277 | 14 | * GNU General Public License for more details. |
paul@277 | 15 | * |
paul@277 | 16 | * You should have received a copy of the GNU General Public License |
paul@277 | 17 | * along with this program; if not, write to the Free Software |
paul@277 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@277 | 19 | * Boston, MA 02110-1301, USA |
paul@277 | 20 | */ |
paul@277 | 21 | |
paul@277 | 22 | #include "stat.h" |
paul@277 | 23 | |
paul@648 | 24 | void (*systypes_copy_from_sys_stat_override)(struct stat *, sys_stat_t *) = NULL; |
paul@648 | 25 | void (*systypes_copy_to_sys_stat_override)(struct stat *, sys_stat_t *) = NULL; |
paul@277 | 26 | |
paul@277 | 27 | void systypes_copy_from_sys_stat(struct stat *st, sys_stat_t *sst) |
paul@277 | 28 | { |
paul@648 | 29 | if (systypes_copy_from_sys_stat_override != NULL) |
paul@648 | 30 | systypes_copy_from_sys_stat_override(st, sst); |
paul@648 | 31 | else |
paul@648 | 32 | COPY_STAT(st, sst) |
paul@277 | 33 | } |
paul@277 | 34 | |
paul@277 | 35 | void systypes_copy_to_sys_stat(struct stat *st, sys_stat_t *sst) |
paul@277 | 36 | { |
paul@648 | 37 | if (systypes_copy_from_sys_stat_override != NULL) |
paul@648 | 38 | systypes_copy_to_sys_stat_override(st, sst); |
paul@648 | 39 | else |
paul@648 | 40 | COPY_STAT(sst, st) |
paul@277 | 41 | } |
paul@277 | 42 | |
paul@648 | 43 | /* vim: tabstop=2 expandtab shiftwidth=2 |
paul@648 | 44 | */ |