uct.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. uct.c (09.11.10)
  3. Upper Case Table creation code.
  4. Copyright (C) 2011-2013 Andrew Nayenko
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "uct.h"
  17. #include "uctc.h"
  18. static off_t uct_alignment(void)
  19. {
  20. return get_cluster_size();
  21. }
  22. static off_t uct_size(void)
  23. {
  24. return sizeof(upcase_table);
  25. }
  26. static int uct_write(struct exfat_dev* dev)
  27. {
  28. if (exfat_write(dev, upcase_table, sizeof(upcase_table)) < 0)
  29. {
  30. exfat_error("failed to write upcase table of %zu bytes",
  31. sizeof(upcase_table));
  32. return 1;
  33. }
  34. return 0;
  35. }
  36. const struct fs_object uct =
  37. {
  38. .get_alignment = uct_alignment,
  39. .get_size = uct_size,
  40. .write = uct_write,
  41. };