about summary refs log tree commit diff stats
ModeNameSize
-rw-r--r--.hgtags360log stats plain blame
-rw-r--r--LICENSE1120log stats plain blame
-rw-r--r--Makefile1535log stats plain blame
-rw-r--r--README1094log stats plain blame
-rw-r--r--client.c9041log stats plain blame
-rw-r--r--config.arg.h2147log stats plain blame
-rw-r--r--config.default.h2185log stats plain blame
-rw-r--r--config.mk464log stats plain blame
-rw-r--r--draw.c4982log stats plain blame
-rw-r--r--dwm.12628log stats plain blame
-rw-r--r--dwm.h3303log stats plain blame
-rw-r--r--dwm.html5247log stats plain blame
-rw-r--r--dwm.png373log stats plain blame
-rw-r--r--event.c7960log stats plain blame
-rw-r--r--favicon.ico198log stats plain blame
-rw-r--r--main.c6860log stats plain blame
-rw-r--r--tag.c5311log stats plain blame
-rw-r--r--util.c1143log stats plain blame
am.mu?h=hlt&id=4f3510d05a144addc9612a046a1f2fa31a8a8c41'>4f3510d0 ^
9acf5c0f ^




760f683f ^
050a93ac ^

51b0936f ^
7a84094a ^
a0331a9b ^
7a84094a ^
51b0936f ^
4f3510d0 ^

760f683f ^
4f3510d0 ^

050a93ac ^


760f683f ^
77d5b5d6 ^
104854ca ^
7a84094a ^
ea19d0dc ^
7a84094a ^
748b6865 ^



8fb0e672 ^

760f683f ^
77d5b5d6 ^
104854ca ^
7a84094a ^
a0331a9b ^
7a84094a ^
104854ca ^
8fb0e672 ^
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

                                            
           
                

 
                                                     
             
                  
                                      

                                         

 
                                                   
             
                  
                                 

 
                                                                            

                  
                        
                                  
                                     
                      
                                          

                        
                                          

                                




                                   
                                                         

                  
                             
                                  
                                     
                      
                                          

                        
                                          

                                


                         
                                                                 
             
                  
                                  
                                
                                              



                                        

 
                                                     
             
                  
                                  
                                     
                      
                                     
 
# new type to help incrementally scan arrays
container stream:_elem [
  index:num
  data:&:@:_elem
]

def new-stream s:&:@:_elem -> result:&:stream:_elem [
  local-scope
  load-ingredients
  result <- new {(stream _elem): type}
  *result <- put *result, index:offset, 0
  *result <- put *result, data:offset, s
]

def rewind in:&:stream:_elem -> in:&:stream:_elem [
  local-scope
  load-ingredients
  *in <- put *in, index:offset, 0
]

def read in:&:stream:_elem -> result:_elem, empty?:bool, in:&:stream:_elem [
  local-scope
  load-ingredients
  empty? <- copy 0/false
  idx:num <- get *in, index:offset
  s:&:@:_elem <- get *in, data:offset
  len:num <- length *s
  at-end?:bool <- greater-or-equal idx len
  {
    break-unless at-end?
    empty-result:&:_elem <- new _elem:type
    return *empty-result, 1/true
  }
  result <- index *s, idx
  idx <- add idx, 1
  *in <- put *in, index:offset, idx
]

def peek in:&:stream:_elem -> result:_elem, empty?:bool [
  local-scope
  load-ingredients
  empty?:bool <- copy 0/false
  idx:num <- get *in, index:offset
  s:&:@:_elem <- get *in, data:offset
  len:num <- length *s
  at-end?:bool <- greater-or-equal idx len
  {
    break-unless at-end?
    empty-result:&:_elem <- new _elem:type
    return *empty-result, 1/true
  }
  result <- index *s, idx
]

def read-line in:&:stream:char -> result:text, in:&:stream:char [
  local-scope
  load-ingredients
  idx:num <- get *in, index:offset
  s:text <- get *in, data:offset
  next-idx:num <- find-next s, 10/newline, idx
  result <- copy-range s, idx, next-idx
  idx <- add next-idx, 1  # skip newline
  # write back
  *in <- put *in, index:offset, idx
]

def end-of-stream? in:&:stream:_elem -> result:bool [
  local-scope
  load-ingredients
  idx:num <- get *in, index:offset
  s:&:@:_elem <- get *in, data:offset
  len:num <- length *s
  result <- greater-or-equal idx, len
]