-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.lisp
45 lines (35 loc) · 1.14 KB
/
config.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;; Copyright (c) Flavio Egoavil <[email protected]> aka D E F U N K Y D R U M M E R
;; MIT License
(common-lisp:defpackage :auto-text/config
(:use :cl)
(:export
:*eol*
:*chunk-size*
:*eol-buffer-size*
:*delimiter-chars-vector*
:*valid-csv-delimiters*))
(common-lisp:in-package :auto-text/config)
(defparameter *eol*
'(:cr #(13)
:lf #(10)
:crlf #(13 10))
"Vectors for searching line endings.")
(defparameter *chunk-size* (* 1 (expt 2 20))
"Size of block to read from file in binary mode.") ; 1MB of chunk size
(defparameter *eol-buffer-size* (* 32 (expt 2 10)) ;32K
"Buffer size for locating an end of line.
Needs to be bigger than the largest expected line!")
(defparameter *delimiter-chars-vector*
(vector (char-code #\Tab)
(char-code #\|)
(char-code #\,)
(char-code #\;)
13 ;CR
10) ;LF
"Delimiter chars to look for")
(defparameter *valid-csv-delimiters*
(vector (char-code #\Tab)
(char-code #\|)
(char-code #\,)
(char-code #\;))
"Valid CSV delimiters for parsing a file.")