aboutsummaryrefslogtreecommitdiffstats
path: root/libpatch_get_label_format.c
blob: a43ab5481fdb8f8a34be72c07fbc458f66bca8ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* See LICENSE file for copyright and license details. */
#include "common.h"


enum libpatch_label_format
libpatch_get_label_format(enum libpatch_style style)
{
	switch (style) {
	case LIBPATCH_STYLE_NORMAL:
	case LIBPATCH_STYLE_ED:
	case LIBPATCH_STYLE_ED_ALTERNATIVE:
	case LIBPATCH_STYLE_RCS:
		return LIBPATCH_LABEL_NONE;
	case LIBPATCH_STYLE_COPIED:
		return LIBPATCH_LABEL_FILE_SPACE_MTIME;
	case LIBPATCH_STYLE_UNIFIED:
		return LIBPATCH_LABEL_FILE_TAB_MTIME;
	default:
		errno = EINVAL;
		return LIBPATCH_LABEL_ERROR;
	}
}