# https://stackoverflow.com/questions/6336440/how-can-i-make-git-am-git-apply-work-fuzzy-like-the-patch-command
# https://www.thegeekstuff.com/2014/12/patch-command-examples/

# files that need a patch only related to filepaths
# src/libxls/brdb.h
# src/libxls/endian.c
# src/libxls/endian.h
# src/libxls/ole.c
# src/libxls/ole.h
# src/libxls/xls.c
# src/libxls/xlsstruct.h
# src/libxls/xlstool.c
# src/libxls/xlstool.h

# file that has a patch related to filepaths (but also other patches)
# src/libxls/locale.c

# I implemented the filepath changes (and only the filepath changes) and did:
# git diff ':!maintenance/02_apply-our-libxls-patches.txt' > maintenance/patches/filepaths.patch
# https://stackoverflow.com/questions/10415100/exclude-file-from-git-diff
# undo those changes
# git apply maintenance/patches/filepaths.patch

# Implement the change where we mask functions cran doesn't like in this file:
# src/libxls/xlstypes.h
# then make the .patch file
# git diff ':!maintenance/02_apply-our-libxls-patches.txt' > maintenance/patches/cran.patch
# undo those changes
# git apply maintenance/patches/cran.patch

# Implement the locale related changes in
# src/libxls/locale.c
# src/libxls/locale.h
# then make the .patch file
# git diff ':!maintenance/02_apply-our-libxls-patches.txt' > maintenance/patches/locale.patch
# undo those changes
# git apply maintenance/patches/locale.patch

# Implement the fix for this warning:
# libxls/endian.c:38:21: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
# libxls/locale.c:50:30: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
# then make the .patch file
# git diff ':!maintenance/02_apply-our-libxls-patches.txt' > maintenance/patches/strict-prototypes.patch
# discard changes
# git apply maintenance/patches/strict-prototypes.patch

# Implement the snprintf() for sprintf() swap:
# git diff ':!maintenance/02_apply-our-libxls-patches.txt' > maintenance/patches/snprintf.patch
# discard changes
# git apply maintenance/patches/snprintf.patch
