Select one of the symbols to view example projects that use it.
 
Outline
#include <jim.h>
Jim_globInit(Jim_Interp *)
Files
loading...
SourceVuDevelopment ToolsOpenOCDbuild/Mainstream/Release/jimtcl-cmake/glob.c
 
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* autogenerated - do not edit */ #include <jim.h> int Jim_globInit(Jim_Interp *interp) { if (Jim_PackageProvide(interp, "glob", "1.0", JIM_ERRMSG)) return JIM_ERR; return Jim_EvalSource(interp, "glob.tcl", 1, "\n" "\n" "\n" "\n" "\n" "\n" "\n" "package require readdir\n" "\n" "\n" "proc glob.globdir {dir pattern} {\n" " if {[file exists $dir/$pattern]} {\n" "\n" " return [list $pattern]\n" " }\n" "\n" " set result {}\n" " set files [readdir $dir]\n" " lappend files . ..\n" "\n" " foreach name $files {\n" " if {[string match $pattern $name]} {\n" "\n" " if {[string index $name 0] eq \".\" && [string index $pattern 0] ne \".\"} {\n" " continue\n" " }\n" " lappend result $name\n" " }\n" " }\n" "\n" " return $result\n" "}\n" "\n" "\n" "\n" "\n" "proc glob.explode {pattern} {\n" " set oldexp {}\n" " set newexp {\"\"}\n" "\n" " while 1 {\n" " set oldexp $newexp\n" " set newexp {}\n" " set ob [string first \\{ $pattern]\n" " set cb [string first \\} $pattern]\n" "\n" " if {$ob < $cb && $ob != -1} {\n" " set mid [string range $pattern 0 $ob-1]\n" " set subexp [lassign [glob.explode [string range $pattern $ob+1 end]] pattern]\n" " if {$pattern eq \"\"} {\n" " error \"unmatched open brace in glob pattern\"\n" " }\n" " set pattern [string range $pattern 1 end]\n" "\n" " foreach subs $subexp {\n" " foreach sub [split $subs ,] {\n" " foreach old $oldexp {\n" " lappend newexp $old$mid$sub\n" " }\n" " }\n" " }\n" " } elseif {$cb != -1} {\n" " set suf [string range $pattern 0 $cb-1]\n" " set rest [string range $pattern $cb end]\n" " break\n" " } else {\n" " set suf $pattern\n" " set rest \"\"\n" " break\n" " }\n" " }\n" "\n" " foreach old $oldexp {\n" " lappend newexp $old$suf\n" " }\n" " list $rest {*}$newexp\n" "}\n" "\n" "\n" "\n" "proc glob.glob {base pattern} {\n" " set dir [file dirname $pattern]\n" " if {$pattern eq $dir || $pattern eq \"\"} {\n" " return [list [file join $base $dir] $pattern]\n" " } elseif {$pattern eq [file tail $pattern]} {\n" " set dir \"\"\n" " }\n" "\n" "\n" " set dirlist [glob.glob $base $dir]\n" " set pattern [file tail $pattern]\n" "\n" "\n" " set result {}\n" " foreach {realdir dir} $dirlist {\n" " if {![file isdir $realdir]} {\n" " continue\n" " }\n" " if {[string index $dir end] ne \"/\" && $dir ne \"\"} {\n" " append dir /\n" " }\n" " foreach name [glob.globdir $realdir $pattern] {\n" " lappend result [file join $realdir $name] $dir$name\n" " }\n" " }\n" " return $result\n" "}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "proc glob {args} {\n" " set nocomplain 0\n" " set base \"\"\n" " set tails 0\n" "\n" " set n 0\n" " foreach arg $args {\n" " if {[info exists param]} {\n" " set $param $arg\n" " unset param\n" " incr n\n" " continue\n" " }\n" " switch -glob -- $arg {\n" " -d* {\n" " set switch $arg\n" " set param base\n" " }\n" " -n* {\n" " set nocomplain 1\n" " }\n" " -ta* {\n" " set tails 1\n" " }\n" " -- {\n" " incr n\n" " break\n" " }\n" " -* {\n" " return -code error \"bad option \\\"$arg\\\": must be -directory, -nocomplain, -tails, or --\"\n" " }\n" " * {\n" " break\n" " }\n" " }\n" " incr n\n" " }\n" " if {[info exists param]} {\n" " return -code error \"missing argument to \\\"$switch\\\"\"\n" " }\n" " if {[llength $args] <= $n} {\n" " return -code error \"wrong # args: should be \\\"glob ?options? pattern ?pattern ...?\\\"\"\n" " }\n" "\n" " set args [lrange $args $n end]\n" "\n" " set result {}\n" " foreach pattern $args {\n" " set escpattern [string map {\n" " \\\\\\\\ \\x01 \\\\\\{ \\x02 \\\\\\} \\x03 \\\\, \\x04\n" " } $pattern]\n" " set patexps [lassign [glob.explode $escpattern] rest]\n" " if {$rest ne \"\"} {\n" " return -code error \"unmatched close brace in glob pattern\"\n" " }\n" " foreach patexp $patexps {\n" " set patexp [string map {\n" " \\x01 \\\\\\\\ \\x02 \\{ \\x03 \\} \\x04 ,\n" " } $patexp]\n" " foreach {realname name} [glob.glob $base $patexp] {\n" " incr n\n" " if {$tails} {\n" " lappend result $name\n" " } else {\n" " lappend result [file join $base $name]\n" " }\n" " }\n" " }\n" " }\n" "\n" " if {!$nocomplain && [llength $result] == 0} {\n" " set s $(([llength $args] > 1) ? \"s\" : \"\")\n" " return -code error \"no files matched glob pattern$s \\\"[join $args]\\\"\"\n" " }\n" "\n" " return $result\n" "}\n"); }{ ... }
Details
Show:
from
Types: Columns:
Click anywhere in the source to view detailed information here...