bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 1 | /* |
| 2 | uct.c (09.11.10) |
| 3 | Upper Case Table creation code. |
| 4 | |
bigbiff bigbiff | 61cdc02 | 2013-08-08 08:35:06 -0400 | [diff] [blame] | 5 | Free exFAT implementation. |
Matt Mower | 09ef1e4 | 2015-12-13 11:29:45 -0600 | [diff] [blame] | 6 | Copyright (C) 2011-2015 Andrew Nayenko |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 7 | |
bigbiff bigbiff | 61cdc02 | 2013-08-08 08:35:06 -0400 | [diff] [blame] | 8 | This program is free software; you can redistribute it and/or modify |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 9 | it under the terms of the GNU General Public License as published by |
bigbiff bigbiff | 61cdc02 | 2013-08-08 08:35:06 -0400 | [diff] [blame] | 10 | the Free Software Foundation, either version 2 of the License, or |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 11 | (at your option) any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
bigbiff bigbiff | 61cdc02 | 2013-08-08 08:35:06 -0400 | [diff] [blame] | 18 | You should have received a copy of the GNU General Public License along |
| 19 | with this program; if not, write to the Free Software Foundation, Inc., |
| 20 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 21 | */ |
| 22 | |
| 23 | #include "uct.h" |
| 24 | #include "uctc.h" |
| 25 | |
Spegelius | d69ac2b | 2014-11-23 15:15:06 +0200 | [diff] [blame] | 26 | static loff_t uct_alignment(void) |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 27 | { |
| 28 | return get_cluster_size(); |
| 29 | } |
| 30 | |
Spegelius | d69ac2b | 2014-11-23 15:15:06 +0200 | [diff] [blame] | 31 | static loff_t uct_size(void) |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 32 | { |
| 33 | return sizeof(upcase_table); |
| 34 | } |
| 35 | |
| 36 | static int uct_write(struct exfat_dev* dev) |
| 37 | { |
| 38 | if (exfat_write(dev, upcase_table, sizeof(upcase_table)) < 0) |
| 39 | { |
| 40 | exfat_error("failed to write upcase table of %zu bytes", |
| 41 | sizeof(upcase_table)); |
| 42 | return 1; |
| 43 | } |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | const struct fs_object uct = |
| 48 | { |
| 49 | .get_alignment = uct_alignment, |
| 50 | .get_size = uct_size, |
| 51 | .write = uct_write, |
| 52 | }; |