diff options
author | Mattias Andrée <maandree@kth.se> | 2024-01-09 22:04:24 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-01-09 22:04:24 +0100 |
commit | ae850b1ac755f471beac4dbfef4654fe3fbaaae9 (patch) | |
tree | 319e7f7f1b99cd1ee75e100f0a29b0f7c827ccea /libpatch_style_requires_text.c | |
download | libpatch-master.tar.gz libpatch-master.tar.bz2 libpatch-master.tar.xz |
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libpatch_style_requires_text.c')
-rw-r--r-- | libpatch_style_requires_text.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libpatch_style_requires_text.c b/libpatch_style_requires_text.c new file mode 100644 index 0000000..631f9fb --- /dev/null +++ b/libpatch_style_requires_text.c @@ -0,0 +1,22 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +int +libpatch_style_requires_text(enum libpatch_style style, int multifile) +{ + switch (style) { + case LIBPATCH_STYLE_NORMAL: + case LIBPATCH_STYLE_COPIED: + case LIBPATCH_STYLE_UNIFIED: + return 0; + case LIBPATCH_STYLE_ED: + case LIBPATCH_STYLE_ED_ALTERNATIVE: + return LIBPATCH_STYLE_REQUIRES_LF_TERMINATION; + case LIBPATCH_STYLE_RCS: + return multifile ? LIBPATCH_STYLE_REQUIRES_LF_TERMINATION : 0; + default: + errno = EINVAL; + return -1; + } +} |