summary refs log tree commit diff stats
path: root/src/gifs/blinkies/transnow2.gif
blob: 7f705aacca55fa223dac846dc51d94ddec96a94d (plain)
ofshex dumpascii
0000 47 49 46 38 39 61 58 00 1f 00 e3 0a 00 3c 3c 3c bf 38 38 c1 42 be 77 77 77 44 8b d1 aa aa aa 80 GIF89aX......<<<.88.B.wwwD......
0020 c0 ff ff 99 ff cf cf cf ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 21 f9 04 .............................!..
0040 01 0a 00 0f 00 2c 00 00 00 00 58 00 1f 00 00 04 fe b0 a4 49 ab bd 38 eb cd bb 2e 92 27 8e 64 a9 .....,....X........I..8.....'.d.
0060 01 20 a2 ae 6c eb be 70 2c cf b4 0b a0 45 ad ef 7c 1f df 29 95 a9 02 13 18 8f 88 a3 71 a5 54 2d ....l..p,....E..|..)........q.T-
0080 93 02 68 93 07 cc 21 0a 86 ac 76 cb ed 1a 00 2f 65 14 ea 8c 3e 97 48 f4 d8 87 a8 aa b0 de 78 17 ..h...!...v..../e...>.H.......x.
00a0 5c 5c 9f cd 63 75 53 bc d6 b9 af 72 81 5a 74 61 76 53 7c 64 48 2c 4f 3b 7f 70 82 72 84 2e 8c 6a \\..cuS....r.ZtavS|dH,O;.p.r...j
00c0 65 96 77 2d 8c 7e 38 6f 07 9e 9f a0 a1 a2 07 92 99 86 97 79 78 a8 53 8d 9c 57 a3 b0 a3 a5 6c b4 e.w-.~8o...........yx.S..W....l.
00e0 9b 41 05 b1 b9 9f b3 b5 bd 3f ae b8 ba b9 bc 2f 04 c6 c6 2a c7 c8 c9 c7 cc ce ca c8 d0 04 2b 8e .A.......?...../...*..........+.
0100 43 14 c4 2e cb cb 08 db da d3 de dc ca ce 36 c0 d6 13 d8 2d e0 e3 e1 e9 d0 2b dd ee 2a d5 e6 e8 C.............6....-.....+..*...
0120 2c f1 eb d1 f9 f8 d3 d9 fc 6d e5 f4 74 e8 7b e7 af d9 40 78 c5 fc cd b3 56 8f e0 b3 78 ee d4 b1 ,........m..t.{...@x....V...x...
0140 63 26 4e 1e 30 61 c3 7c 69 9c e1 08 63 ac 86 85 1b 6b 75 f4 28 ab 56 80 00 2a 4e 22 38 c9 32 25 c&N.0a.|i...c....ku.(.V..*N"8.2%
0160 ca 95 2f 5d c6 7c 31 92 64 28 90 30 5a aa 54 09 b3 a7 4f 98 3c 61 38 82 14 08 e7 0b 96 3a 5f ee ../].|1.d(.0Z.T...O.<a8......:_.
0180 44 d9 52 e6 4c 72 b7 88 46 32 c9 74 a9 4b a0 4d 81 72 04 26 35 8e 51 17 3c ad f6 44 2a 96 c6 d0 D.R.Lr..F2.t.K.M.r.&5.Q.<..D*...
01a0 ae 73 a8 5e 25 5b 15 e9 cf ad 41 10 0c 98 4b b7 ae dd bb 03 42 ea 85 6a 65 af df 8d 7f fe 0a 16 .s.^%[....A...K.....B..je.......
01c0 89 03 af e1 c3 88 13 2b 5e cc 78 00 8a c6 90 23 4b 9e 3c 37 02 00 3b .......+^.x....#K.<7..;
be32ae7fa'>0893d65e ^
da925d06 ^

ebea4c3f ^
0893d65e ^
aefe0592 ^
7a84094a ^
ebea4c3f ^
760f683f ^
f03c9c05 ^
ebea4c3f ^


7a84094a ^
0893d65e ^
7a84094a ^
ebea4c3f ^
80df524b ^
ebea4c3f ^
0893d65e ^
6641b247 ^
ea19d0dc ^
80df524b ^
ebea4c3f ^
760f683f ^
ea19d0dc ^
f03c9c05 ^
ebea4c3f ^


da925d06 ^

f03c9c05 ^
da925d06 ^


80df524b ^
10bbca64 ^
da925d06 ^


da925d06 ^
ff16e04f ^
a621ef95 ^

f03c9c05 ^
ebea4c3f ^

7a84094a ^

ebea4c3f ^
80df524b ^
ebea4c3f ^
08f4628e ^
ebea4c3f ^






0893d65e ^
a621ef95 ^

760f683f ^
2d3d88d9 ^
0893d65e ^
2d3d88d9 ^
7a84094a ^
2d3d88d9 ^





0893d65e ^
a621ef95 ^

760f683f ^
a621ef95 ^


80df524b ^
a621ef95 ^



ff16e04f ^
da925d06 ^
2d3d88d9 ^
0893d65e ^
2d3d88d9 ^


760f683f ^
2d3d88d9 ^
80df524b ^
2d3d88d9 ^



ea19d0dc ^
0893d65e ^

ea19d0dc ^
0893d65e ^
2d3d88d9 ^
7a84094a ^

0230a6cc ^
80df524b ^
0230a6cc ^
0893d65e ^
0230a6cc ^
80df524b ^
0230a6cc ^
0893d65e ^
0230a6cc ^


7a84094a ^
0893d65e ^

2d3d88d9 ^
7a84094a ^
2d3d88d9 ^
80df524b ^
2d3d88d9 ^
0893d65e ^
2d3d88d9 ^


0893d65e ^
2d3d88d9 ^
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
                                                                           

                          

                     

 
                    

               

 
                                                                                  

                  
   
                      
                      
                                               
                                 
                                                              
                                              


                    
                 
                                                  
                         
   
                                         
                  
                                  
                 
                                              
                                                
                      
                                                              
                                                  
                                                       


                    

 
                                                                      


                  
                                             
                 


                         
                    
                          

 
                                                                           

                  

                             
   
                                         
                  
                                






                         
                                                                                            

                  
                                                          
   
                      
                      
                                               





                                                             
                                                                               

 
                                                                             


                  
                                             



                          
                          
 
 
                                                                                                                                     


                             
                               
   
                                             



                        
                                      

                                                   
                              
                                                  
                                              

                         
   
                                         
                  
                                  
                                         
                                                
                      
                                    


                                                  
                           

                                                     
                       
                 
   
                                         
                  
                                  


                               
                                        
 
# Wrappers around file system primitives that take a 'resources' object and
# are thus easier to test.

container resources [
  data:&:@:resource
]

container resource [
  name:text
  contents:text
]

def start-reading resources:&:resources, filename:text -> contents:&:source:char [
  local-scope
  load-ingredients
  {
    break-if resources
    # real file system
    file:num <- $open-file-for-reading filename
    assert file, [file not found]
    contents:&:source:char, sink:&:sink:char <- new-channel 30
    start-running receive-from-file file, sink
    return
  }
  # fake file system
  i:num <- copy 0
  data:&:@:resource <- get *resources, data:offset
  len:num <- length *data
  {
    done?:bool <- greater-or-equal i, len
    break-if done?
    tmp:resource <- index *data, i
    i <- add i, 1
    curr-filename:text <- get tmp, name:offset
    found?:bool <- equal filename, curr-filename
    loop-unless found?
    contents:&:source:char, sink:&:sink:char <- new-channel 30
    curr-contents:text <- get tmp, contents:offset
    start-running receive-from-text curr-contents, sink
    return
  }
  return 0/not-found
]

def receive-from-file file:num, sink:&:sink:char -> sink:&:sink:char [
  local-scope
  load-ingredients
  {
    c:char, eof?:bool <- $read-from-file file
    break-if eof?
    sink <- write sink, c
    loop
  }
  sink <- close sink
  file <- $close-file file
]

def receive-from-text contents:text, sink:&:sink:char -> sink:&:sink:char [
  local-scope
  load-ingredients
  i:num <- copy 0
  len:num <- length *contents
  {
    done?:bool <- greater-or-equal i, len
    break-if done?
    c:char <- index *contents, i
    sink <- write sink, c
    i <- add i, 1
    loop
  }
  sink <- close sink
]

def start-writing resources:&:resources, filename:text -> sink:&:sink:char, routine-id:num [
  local-scope
  load-ingredients
  source:&:source:char, sink:&:sink:char <- new-channel 30
  {
    break-if resources
    # real file system
    file:num <- $open-file-for-writing filename
    assert file, [no such file]
    routine-id <- start-running transmit-to-file file, source
    reply
  }
  # fake file system
  # beware: doesn't support multiple concurrent writes yet
  routine-id <- start-running transmit-to-fake-file resources, filename, source
]

def transmit-to-file file:num, source:&:source:char -> source:&:source:char [
  local-scope
  load-ingredients
  {
    c:char, done?:bool, source <- read source
    break-if done?
    $write-to-file file, c
    loop
  }
  file <- $close-file file
]

def transmit-to-fake-file resources:&:resources, filename:text, source:&:source:char -> resources:&:resources, source:&:source:char [
  local-scope
  load-ingredients
  # compute new file contents
  buf:&:buffer <- new-buffer 30
  {
    c:char, done?:bool, source <- read source
    break-if done?
    buf <- append buf, c
    loop
  }
  contents:text <- buffer-to-array buf
  new-resource:resource <- merge filename, contents
  # write to resources
  curr-filename:text <- copy 0
  data:&:@:resource <- get *resources, data:offset
  # replace file contents if it already exists
  i:num <- copy 0
  len:num <- length *data
  {
    done?:bool <- greater-or-equal i, len
    break-if done?
    tmp:resource <- index *data, i
    curr-filename <- get tmp, name:offset
    found?:bool <- equal filename, curr-filename
    loop-unless found?
    put-index *data, i, new-resource
    reply
  }
  # if file didn't already exist, make room for it
  new-len:num <- add len, 1
  new-data:&:@:resource <- new resource:type, new-len
  put *resources, data:offset, new-data
  # copy over old files
  i:num <- copy 0
  {
    done?:bool <- greater-or-equal i, len
    break-if done?
    tmp:resource <- index *data, i
    put-index *new-data, i, tmp
  }
  # write new file
  put-index *new-data, len, new-resource
]