Imported Upstream version 3.2.2
[debian/gnuradio] / pmt / src / scheme / gnuradio / pmt-serial-tags.scm
1 ;;; -*-scheme-*-
2 ;;;
3 ;;; Copyright 2007 Free Software Foundation, Inc.
4 ;;; 
5 ;;; This file is part of GNU Radio
6 ;;; 
7 ;;; GNU Radio is free software; you can redistribute it and/or modify
8 ;;; it under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3, or (define at your option)
10 ;;; any later version.
11 ;;; 
12 ;;; GNU Radio is distributed in the hope that it will be useful,
13 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ;;; GNU General Public License for more details.
16 ;;; 
17 ;;; You should have received a copy of the GNU General Public License along
18 ;;; with this program; if not, write to the Free Software Foundation, Inc.,
19 ;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 ;;;
21
22 ;;; definitions of tag values used for marshalling pmt data
23
24 (define pst-true                #x00)
25 (define pst-false               #x01)
26 (define pst-symbol              #x02)   ; untagged-int16 n; followed by n bytes of symbol name
27 (define pst-int32               #x03)
28 (define pst-double              #x04)
29 (define pst-complex             #x05)   ; complex<double>: real, imag
30 (define pst-null                #x06)
31 (define pst-pair                #x07)   ; followed by two objects
32 (define pst-vector              #x08)   ; untagged-int32 n; followed by n objects
33 (define pst-dict                #x09)   ; untagged-int32 n; followed by n key/value tuples
34
35 (define pst-uniform-vector      #x0a)
36
37 ;; u8, s8, u16, s16, u32, s32, u64, s64, f32, f64, c32, c64
38 ;;
39 ;;   untagged-uint8  tag
40 ;;   untagged-uint8  uvi (define uniform vector info, see below)
41 ;;   untagged-int32  n-items
42 ;;   untagged-uint8  npad
43 ;;   npad bytes of zeros to align binary data
44 ;;   n-items binary numeric items
45 ;;
46 ;; uvi:
47 ;; +-+-+-+-+-+-+-+-+
48 ;; |B|   subtype   |
49 ;; +-+-+-+-+-+-+-+-+
50 ;;
51 ;; B == 0, numeric data is little-endian.
52 ;; B == 1, numeric data is big-endian.
53
54     (define uvi-endian-mask     #x80)
55     (define uvi-subtype-mask    #x7f)
56
57     (define uvi-little-endian   #x00)
58     (define uvi-big-endian      #x80)
59
60     (define uvi-u8              #x00)
61     (define uvi-s8              #x01)
62     (define uvi-u16             #x02)
63     (define uvi-s16             #x03)
64     (define uvi-u32             #x04)
65     (define uvi-s32             #x05)
66     (define uvi-u64             #x06)
67     (define uvi-s64             #x07)
68     (define uvi-f32             #x08)
69     (define uvi-f64             #x09)
70     (define uvi-c32             #x0a)
71     (define uvi-c64             #x0b)
72
73
74 (define pst-comment             #x3b)   ; ascii ';'
75 (define pst-comment-end         #x0a)   ; ascii '\n'