Check-in [d396379ac9]
Not logged in

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

Overview
Comment:added (load/save)-bytevector to thunder-utils
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d396379ac9fdf7d9d0de128bd51a08a0b0a5509d
User & Date: aldo 2017-08-01 11:22:09
Context
2017-08-01
11:23
use int64 instead of int for sqlite3 bind, minor fix in sqlite3_finalize check-in: 86bf6c2faf user: aldo tags: trunk
11:22
added (load/save)-bytevector to thunder-utils check-in: d396379ac9 user: aldo tags: trunk
2017-05-03
18:01
many fixes to usb.sls check-in: cd7a31d87b user: aldo tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to thunder-utils.sls.

12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
...
107
108
109
110
111
112
113








114
115
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

(library (thunder-utils)
  (export string-split string-replace bytevector-copy* read-string
	  print-stack-trace
	  sub-bytevector  sub-bytevector=?)

  
  (import (scheme) (srfi s14 char-sets))

  ;; POSSIBLE THAT NOT EXISTS THIS FUNCTION???
  ;; s is a string , c is a character-set
  ;; null strings are discarded from result by default unless #f is specified as third argument
  (define string-split
................................................................................
	 (bytevector-copy! b start x 0 n)
	 x)]))

  (define (sub-bytevector=? b1 start1 b2 start2 len)
    (bytevector=? (sub-bytevector b1 start1 (+ start1 len))
		  (sub-bytevector b2 start2 (+ start2 len))))









  );library








|
>







 







>
>
>
>
>
>
>
>


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
...
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

(library (thunder-utils)
  (export string-split string-replace bytevector-copy* read-string
	  print-stack-trace
	  sub-bytevector  sub-bytevector=?
	  load-bytevector save-bytevector)
  
  (import (scheme) (srfi s14 char-sets))

  ;; POSSIBLE THAT NOT EXISTS THIS FUNCTION???
  ;; s is a string , c is a character-set
  ;; null strings are discarded from result by default unless #f is specified as third argument
  (define string-split
................................................................................
	 (bytevector-copy! b start x 0 n)
	 x)]))

  (define (sub-bytevector=? b1 start1 b2 start2 len)
    (bytevector=? (sub-bytevector b1 start1 (+ start1 len))
		  (sub-bytevector b2 start2 (+ start2 len))))

  (define (load-bytevector path)
    (call-with-port (open-file-input-port path)
		    (lambda (p) (get-bytevector-all p))))
  
  (define (save-bytevector path data)
    (call-with-port (open-file-output-port path)
		    (lambda (p) (put-bytevector p data))))

  );library