vsort.c (d1d015864103b253b3fcb2f72a0da5b0cfeb31b6) vsort.c (f79477ebd57d7b0e69654281387ba5db8950ebd8)
1/*-
2 * Copyright (C) 2012 Oleg Moskalenko <mom040267@gmail.com>
3 * Copyright (C) 2012 Gabor Kovesdan <gabor@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 26 unchanged lines hidden (view full) ---

35#include <string.h>
36
37#include "sort.h"
38#include "vsort.h"
39
40static inline bool
41isdigit_clocale(wchar_t c)
42{
1/*-
2 * Copyright (C) 2012 Oleg Moskalenko <mom040267@gmail.com>
3 * Copyright (C) 2012 Gabor Kovesdan <gabor@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 26 unchanged lines hidden (view full) ---

35#include <string.h>
36
37#include "sort.h"
38#include "vsort.h"
39
40static inline bool
41isdigit_clocale(wchar_t c)
42{
43
44 return (c >= L'0' && c <= L'9');
45}
46
47static inline bool
48isalpha_clocale(wchar_t c)
49{
43 return (c >= L'0' && c <= L'9');
44}
45
46static inline bool
47isalpha_clocale(wchar_t c)
48{
50
51 return ((c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z'));
52}
53
54static inline bool
55isalnum_clocale(wchar_t c)
56{
49 return ((c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z'));
50}
51
52static inline bool
53isalnum_clocale(wchar_t c)
54{
57
58 return ((c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z') ||
59 (c >= L'0' && c <= L'9'));
60}
61
62/*
63 * Find string suffix of format: (\.[A-Za-z~][A-Za-z0-9~]*)*$
64 * Set length of string before suffix.
65 */

--- 44 unchanged lines hidden (view full) ---

110
111 if (!sfx)
112 *len = clen;
113}
114
115static inline int
116cmp_chars(wchar_t c1, wchar_t c2)
117{
55 return ((c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z') ||
56 (c >= L'0' && c <= L'9'));
57}
58
59/*
60 * Find string suffix of format: (\.[A-Za-z~][A-Za-z0-9~]*)*$
61 * Set length of string before suffix.
62 */

--- 44 unchanged lines hidden (view full) ---

107
108 if (!sfx)
109 *len = clen;
110}
111
112static inline int
113cmp_chars(wchar_t c1, wchar_t c2)
114{
118
119 if (c1 == c2)
120 return (0);
121
122 if (c1 == L'~')
123 return (-1);
124 if (c2 == L'~')
125 return (+1);
126

--- 139 unchanged lines hidden ---
115 if (c1 == c2)
116 return (0);
117
118 if (c1 == L'~')
119 return (-1);
120 if (c2 == L'~')
121 return (+1);
122

--- 139 unchanged lines hidden ---