Fossil

Check-in [b29b7fd3]
Login

Check-in [b29b7fd3]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:re-shuffle LOOK_XXX flags such that LOOK_CR and LOOK_LF are last
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | pending-review
Files: files | file ages | folders
SHA1: b29b7fd3617362449112705cfbfd06c7b10dbe69
User & Date: jan.nijtmans 2015-11-12 11:32:14
Context
2015-11-12
11:37
Micro-optimization in lookslike* functions, proving that LOOK_CR can be expressed as (LOOK_LONE_CR | LOOK_CRLF) and LOOK_LF as (LOOK_LONE_LF | LOOK_CRLF). This saves 6 assembler-instructions in the loops. Ready to be reviewed. ... (check-in: 13c796a4 user: jan.nijtmans tags: pending-review)
11:32
re-shuffle LOOK_XXX flags such that LOOK_CR and LOOK_LF are last ... (check-in: b29b7fd3 user: jan.nijtmans tags: pending-review)
2015-11-10
16:38
Add the "fossil all config pull" command. ... (check-in: d3b14a8e user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/lookslike.c.
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52


53
54
55
56
57
58
59

/*
** Output flags for the looks_like_utf8() and looks_like_utf16() routines used
** to convey status information about the blob content.
*/
#define LOOK_NONE    ((int)0x00000000) /* Nothing special was found. */
#define LOOK_NUL     ((int)0x00000001) /* One or more NUL chars were found. */
#define LOOK_CR      ((int)0x00000002) /* One or more CR chars were found. */
#define LOOK_LONE_CR ((int)0x00000004) /* An unpaired CR char was found. */
#define LOOK_LF      ((int)0x00000008) /* One or more LF chars were found. */
#define LOOK_LONE_LF ((int)0x00000010) /* An unpaired LF char was found. */
#define LOOK_CRLF    ((int)0x00000020) /* One or more CR/LF pairs were found. */
#define LOOK_LONG    ((int)0x00000040) /* An over length line was found. */
#define LOOK_ODD     ((int)0x00000080) /* An odd number of bytes was found. */
#define LOOK_SHORT   ((int)0x00000100) /* Unable to perform full check. */
#define LOOK_INVALID ((int)0x00000200) /* Invalid sequence was found. */
#define LOOK_BINARY  (LOOK_NUL | LOOK_LONG | LOOK_SHORT) /* May be binary. */
#define LOOK_EOL     (LOOK_LONE_CR | LOOK_LONE_LF | LOOK_CRLF) /* Line seps. */


#endif /* INTERFACE */


/*
** This function attempts to scan each logical line within the blob to
** determine the type of content it appears to contain.  The return value
** is a combination of one or more of the LOOK_XXX flags (see above):







<
|
<
|
|
|
|
|
|


>
>







35
36
37
38
39
40
41

42

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

/*
** Output flags for the looks_like_utf8() and looks_like_utf16() routines used
** to convey status information about the blob content.
*/
#define LOOK_NONE    ((int)0x00000000) /* Nothing special was found. */
#define LOOK_NUL     ((int)0x00000001) /* One or more NUL chars were found. */

#define LOOK_LONE_CR ((int)0x00000002) /* An unpaired CR char was found. */

#define LOOK_LONE_LF ((int)0x00000004) /* An unpaired LF char was found. */
#define LOOK_CRLF    ((int)0x00000008) /* One or more CR/LF pairs were found. */
#define LOOK_LONG    ((int)0x00000010) /* An over length line was found. */
#define LOOK_ODD     ((int)0x00000020) /* An odd number of bytes was found. */
#define LOOK_SHORT   ((int)0x00000040) /* Unable to perform full check. */
#define LOOK_INVALID ((int)0x00000080) /* Invalid sequence was found. */
#define LOOK_BINARY  (LOOK_NUL | LOOK_LONG | LOOK_SHORT) /* May be binary. */
#define LOOK_EOL     (LOOK_LONE_CR | LOOK_LONE_LF | LOOK_CRLF) /* Line seps. */
#define LOOK_CR      ((int)0x00000100) /* One or more CR chars. */
#define LOOK_LF      ((int)0x00000200) /* One or more LF chars. */
#endif /* INTERFACE */


/*
** This function attempts to scan each logical line within the blob to
** determine the type of content it appears to contain.  The return value
** is a combination of one or more of the LOOK_XXX flags (see above):