summary refs log blame commit diff stats
path: root/test.c
blob: ff6b1375148ec7118f8e10abe4ba56ecdf7283e4 (plain) (tree)
1
2
                  
                   






















                                                              
                










                                                           




                          


                    
#include <stdio.h>
#include <stdlib.h>

#include "yuri.h"

static void
_print_uri(struct uri *u)
{
	int i;

	printf("Scheme: \"%s\"\n", u->scheme);
	printf("Authority type: %d\n", u->authority.type);
	printf("Authority user: \"%s\"\n", u->authority.user);
	printf("Authority host: \"%s\"\n", u->authority.host);
	printf("Authority port: %d\n", u->authority.port);
	for (i = 0; i < u->npath; i++)
		printf("Path: %d: \"%s\"\n", i+1, u->path[i]);
	printf("Query: \"%s\"\n", u->query);
	printf("Fragment: \"%s\"\n", u->fragment);
}

int
main(int argc, char *argv[])
{
	struct uri *u;
	char *p;

	if (argc < 2) {
		fprintf(stderr, "Usage %s url\n", argv[0]);
		return 1;
	}
	u = uri_decode(argv[1]);
	if (u == NULL)
		return 1;
	if (uri_normalize(u) == -1)
		return 1;
	_print_uri(u);
	p = uri_encode(u);
	if (p == NULL)
		return 1;
	printf("%s\n", p);
	free(p);
	uri_free(u);
	return 0;
}
='Blame the previous revision' href='/novaburst/xombrero/blame/xombrero.conf?id=8c87a2283c7cec587d11bcd165dfe0408451aea6'>^
aaa662a ^



aaa662a ^
4f4eccd ^
aaa662a ^


47224e6 ^


7259121 ^
ea6e846 ^

aaa662a ^
02e49e4 ^







aaa662a ^

6b5a850 ^
77b17b2 ^
6b5a850 ^
aaa662a ^

77b17b2 ^
aaa662a ^

16ca85e ^




8797fa4 ^
aaa662a ^


3c461a7 ^
aaa662a ^
2e50e6f ^
aaa662a ^
0a996f2 ^
aaa662a ^

51ec974 ^
4f4eccd ^
aaa662a ^

bb7626e ^
facf22a ^
aaa662a ^
















0c240f7 ^








aaa662a ^




568d018 ^
0b332ff ^


aaa662a ^
facf22a ^


aaa662a ^
2e50e6f ^
facf22a ^
aaa662a ^
42b8eaf ^
58c7ecb ^
aaa662a ^
2e50e6f ^

5ef2a7e ^
719118b ^

aaa662a ^




77b17b2 ^
aaa662a ^

91ffa05 ^
aaa662a ^

















88e0d31 ^
aaa662a ^

958f63e ^
aaa662a ^







958f63e ^
aaa662a ^





















2e50e6f ^








90c5cff ^
aaa662a ^

e4176be ^

71f1e5a ^
51ec974 ^
aaa662a ^
b5dceea ^
aaa662a ^











e4176be ^

71f1e5a ^
ee6e9dc ^
aaa662a ^





ee6e9dc ^



aaa662a ^








ee6e9dc ^

aaa662a ^
ee6e9dc ^
989f863 ^


9f01fb5 ^
0feb9b2 ^
9f01fb5 ^









ee6e9dc ^


9f01fb5 ^


ee6e9dc ^
140b93b ^
9f01fb5 ^

ee6e9dc ^
0feb9b2 ^
f13ae81 ^
0feb9b2 ^

6e798a1 ^
ee6e9dc ^
9f01fb5 ^





fc0ce85 ^
ee6e9dc ^





ee6e9dc ^
0c1cd0f ^
9f01fb5 ^
0c1cd0f ^
9f01fb5 ^
0c1cd0f ^
9f01fb5 ^

ee6e9dc ^




c219d76 ^
9f01fb5 ^


fc0ce85 ^
ee6e9dc ^
9f01fb5 ^
















02e49e4 ^
9f01fb5 ^




1b1398e ^

77b17b2 ^
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394


                   
 









                                                                           



                                                                   

                                
                             

                                   





                                 
                                                    
                                     
                               
                            




                               
                             
                               
                                           
                           
                             




                           
                           
                           
                           
                           

                           
                           

                           
                                                             
                           

                           
                              
                                
                           
                           
                           
 

                                                                
 







                                                       



                                                                      
        
                                                            


                                                             


                                                                                              
 

                                                          
 







                                                                                                                        

                                                                      
 
                                                  
 

                                                                        
                                                                     

                           




                                                                                                                                                                       
 


          
 
                                            
 
                           
 

                                                                      
 
                                                    

                                                                                                        
 
 
















                                            








                                                                  




                                                                    
 


                                               
                               


                                                 
                              
                                         
 
                              
                                     
 
                 

                                                    
                                                                  

                                                                 




                    
                                                    

                                                                                                            
                                         

















                                                                        
                           

                           
                           







                                                       
                           





















                                                                        








                                       
                                   

                                   

                                   
                                   
 
                                                             
 











                                            

                                   
                                   
 





                                                                



                            








                                                                     

                                             
                                            
 


                                  
                                      
                               









                                     


                               


                                     
                              
                                  

                                  
                           
                                
                                    

                                      
                                    
                                  





                                        
                                 





                                  
                                
                                      
                                     
                                          
                                     
                                      

                                   




                                       
                                 


                                   
                               
                                
















                                     
                                  




                                    

                                                  
                                                    
##
## GENERAL SETTINGS
##

#
# The strategy for the config file is as follows:
#
# Boolean values are the opposite of the default and need to simply be
# uncommented to alter the default.
#
# Text values *are* set to the default and in order to change them one must
# uncomment the option *and* change the value.
#

# NOTE: browser_mode and gui_mode MUST be the first entries in this
# file!

# Normal browser operation (default).
# browser_mode		= normal

# Prevent tracking operation.
# browser_mode		= whitelist

# Classic GUI (default).
# gui_mode		= classic

# Minimalistic GUI.
# gui_mode		= minimal

# home			= https://www.cyphertite.com
# download_dir		= ~/downloads
# download_mode		= start
# download_notifications = 1
# window_maximize	= 1
# window_width		= 1024
# window_height		= 768
# enable_spell_checking	= 1
# spell_check_languages	= en_US
# default_zoom_level	= 1.0
# encoding		= UTF-8
# ssl_ca_file		= /etc/ssl/cert.pem
# ssl_strict_certs	= 1
# enable_strict_transport = 0
# ctrl_click_focus	= 1
# append_next		= 0
# save_global_history	= 1
# color_visited_uris	= 0
# guess_search		= 1
# enable_autoscroll	= 1
# session_autosave	= 1
# history_autosave	= 1
# autofocus_onload	= 1
# single_instance	= 1
# enable_socket		= 1
# enable_js_autorun	= 0
# auto_load_images	= 0
# enable_localstorage	= 0
# userstyle		= /usr/local/share/xombrero/style.css
# userstyle_global	= 1
# enable_favicon_entry	= 0
# enable_favicon_tabs	= 1
# preload_strict_transport = 1
# referer		= always
# warn_cert_changes	= 1
# enable_cache		= 1
# js_auto_open_windows	= 0

# See http://www.xroxy.com/proxylist.php for a good list of open
# proxies.
#
# polipo
# http_proxy			= http://127.0.0.1:8123
#
# tsocks
# http_proxy			= http://127.0.0.1:1080
#
# If you only occasionally use a proxy
# http_proxy_starts_enabled	= 0

# Search engines; uncomment one of these lines for you favorite search
# engine.
#
# Google
# search_string		= https://www.google.com/search?q=%s
#
# Yahoo
# search_string		= http://search.yahoo.com/search?p=%s
#
# Start Page
# search_string		= https://startpage.com/do/search?language=english_us&cat=web&query=%s
#
# DuckDuckGo
# search_string		= https://www.duckduckgo.com/?q=%s

# External editor.
# NOTE: The editor specified here must not fork into the background.
#
# Examples of editors:
# external_editor	= gvim -f <file>
# external_editor	= xterm -geometry 177x58+0+0 -font -*-fixed-medium-r-*-*-15-*-*-*-*-*-iso8859-* -e vim -f <file>
# external_editor	= emacsclient -c <file>

# "default_script" points to a script executed by the run_script
# command. The only argument passed to this script is the current URI.
#
# default_script	= ~/.xombrero/playflash.sh

# "user_agent" can be set to just about anything, for a comprehensive
# list see: http://www.useragentstring.com/pages/All/ . If more than one
# "user_agent" is given, then xombrero will use them in a round-robin
# fashion for each request.
#
#user_agent		= Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
#user_agent		= Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
#user_agent		= Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0
#user_agent		= Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7C144 Safari/528.16
#

##
## ALIASES
##

# Aliases are given in the following format:
#
#   alias = <alias>, <link>
#
# Where the link part might contain "%s", the "%s" will be substituted
# with the user's input when the alias is expanded.

# alias = s,	  https://www.google.com/search?q=%s
# alias = w,	  https://secure.wikimedia.org/wikipedia/en/w/index.php?title=Special%3ASearch&search=%s
# alias = ports,  http://openports.se/search.php?so=%s


##
## COOKIE, JAVASCRIPT AND PLUGIN WHITE LISTS
##

# Add the domains you trust.

# cookie_wl		= .conformal.com
# cookie_wl		= .peereboom.us

# js_wl			= .conformal.com
# js_wl			= .peereboom.us

# pl_wl			= .conformal.com
# pl_wl			= .peereboom.us


##
## FORCE HTTPS FOR SITES
##

# Add the domains of sites that should be only accesed over HTTPS.

# force_https		= .conformal.com


##
## MIME TYPES
##

# PDF, note that xpdf can't load a URI directly; use "@" in front of
# mime_type to indicate to download the file first.

# mime_type		= application/pdf,kpdf
# mime_type		= @application/pdf,xpdf

# Specific MIME type for video.
# mime_type		= video/x-ms-wmv,mplayer
# mime_type		= video/quicktime,mplayer

# Default MIME type for video.
# mime_type		= video/*,mplayer

# Default MIME type for audio.
# mime_type		= audio/*,vlc

# Word documents.
# mime_type		= application/msword,soffice

# Ignoring flash can be done by using the donothing pseudo-binary.
# mime_type		= application/x-shockwave-flash,donothing


##
## ADVANCED SETTINGS
##

# resource_dir		= /usr/local/share/xombrero/
# refresh_interval	= 10
# url_regex		= ^[[:blank:]]*[^[:blank:]]*([[:alnum:]-]+\.)+[[:alnum:]-][^[:blank:]]*[[:blank:]]*$
# gnutls_priority_string = NORMAL:%COMPAT

# NOTE: webkit 1.4.x overwrites these values!
# max_host_connections	= 5
# max_connections	= 25


##
## ADVANCED GUI SETTINGS
##

# The following low-level GUI settings are set by the high-level setting
# "gui_mode".

# The settings for "gui_mode = classic" are as follows:

# fancy_bar		= 1
# show_tabs		= 1
# tab_style		= normal
# userstyle_global	= 0
# show_url		= 1
# show_statusbar	= 0
# show_scrollbars	= 1

# The settings for "gui_mode = minimal" are as follows:

# fancy_bar		= 0
# show_tabs		= 1
# tab_style		= compact
# show_url		= 0
# show_statusbar	= 1
# show_scrollbars	= 0

# The following are settings shared between "classic" and "minimal"
# "gui_mode":

# statusbar_elems	= BP
# icon_size		= 2
# cmd_font		= monospace normal 9
# oops_font		= monospace normal 9
# statusbar_font	= monospace normal 9
# tabbar_font		= monospace normal 9


##
## ADVANCED COOKIE AND JAVASCRIPT SETTINGS
##

# The following low-level settings are set by the high-level setting
# "browser_mode", and shouldn't be tweaked manually unless you know what
# you are doing.

# The settings for "browser_mode = normal" are as follows:

# allow_volatile_cookies	= 0
# cookie_policy			= allow
# cookies_enabled		= 1
# enable_cookie_whitelist	= 0
# read_only_cookies		= 0
# save_rejected_cookies		= 0
# session_timeout		= 3600
# enable_scripts		= 1
# enable_js_whitelist		= 0
# enable_localstorage		= 1
# enable_plugins		= 1
# enable_plugin_whitelist	= 0
# allow_insecure_content	= 1
# allow_insecure_scripts	= 1
# do_not_track			= 0

# The settings for "browser_mode = whitelist" are as follows:

# allow_volatile_cookies	= 0
# cookie_policy			= no3rdparty
# cookies_enabled		= 1
# enable_cookie_whitelist	= 1
# read_only_cookies		= 0
# save_rejected_cookies		= 0
# session_timeout		= 3600
# enable_scripts		= 0
# enable_js_whitelist		= 1
# enable_localstorage		= 0
# enable_plugins		= 0
# enable_plugin_whitelist	= 1
# allow_insecure_content	= 0
# allow_insecure_scripts	= 0
# do_not_track			= 1


##
## KEY BINDINGS
##

# To delete all default keybindings use "keybinding = clearall".
#
# keybinding	= clearall
#
# Key names can be found at:
#
#   http://git.gnome.org/browse/gtk+/tree/gdk/gdkkeysyms-compat.h
#
# Just chop off the "GDK_" part and you have the keyname. Or look at:
#
#   http://git.gnome.org/browse/gtk+/tree/gdk/gdkkeysyms.h
#
# and chop off "GDK_KEY_".
#
# Be aware that the names are case sensitive!
#
# The default keybindings are the following:
#
# keybinding	= command,colon
# keybinding	= search,slash
# keybinding	= searchb,question
# keybinding	= command_mode,!Escape
# keybinding	= insert_mode,i
# keybinding	= cookiejar,!M1-j
# keybinding	= downloadmgr,!M1-d
# keybinding	= history,!M1-h
# keybinding	= print,!C-p
# keybinding	= quitall,!C-q
# keybinding	= restart,!M1-q
# keybinding	= run_script,!M1-r
# keybinding	= js toggle,!C-j
# keybinding	= cookie toggle,!M1-c
# keybinding	= togglesrc,!C-s
# keybinding	= yankuri,y
# keybinding	= pasteuricur,p
# keybinding	= pasteurinew,P
# keybinding	= toplevel toggle,!F4
# keybinding	= help,!F1
# keybinding	= proxy toggle,!F2
# keybinding	= searchnext,n
# keybinding	= searchprevious,N
# keybinding	= focusaddress,!F6
# keybinding	= focussearch,!F7
# keybinding	= hinting,f
# keybinding	= hinting,period
# keybinding	= hinting_newtab,S-F
# keybinding	= hinting_newtab,comma
# keybinding	= userstyle,s
# keybinding	= userstyle_global,S
# keybinding	= goback,BackSpace
# keybinding	= goback,!M1-Left
# keybinding	= goforward,!S-BackSpace
# keybinding	= goforward,!M1-Right
# keybinding	= reload,!F5
# keybinding	= reload,!C-r
# keybinding	= reload,!C-l
# keybinding	= favorites,!M1-f
# keybinding	= scrolldown,j
# keybinding	= scrolldown,Down
# keybinding	= scrollup,k
# keybinding	= scrollup,Up
# keybinding	= scrollbottom,G
# keybinding	= scrollbottom,End
# keybinding	= scrolltop,Home
# keybinding	= scrollpagedown,space
# keybinding	= scrollpagedown,!C-f
# keybinding	= scrollpagedown,Page_Down
# keybinding	= scrollhalfdown,!C-d
# keybinding	= scrollpageup,Page_Up
# keybinding	= scrollpageup,!C-b
# keybinding	= scrollhalfup,!C-u
# keybinding	= scrollright,l
# keybinding	= scrollright,Right
# keybinding	= scrollfarright,dollar
# keybinding	= scrollleft,h
# keybinding	= scrollleft,Left
# keybinding	= scrollfarleft,0
# keybinding	= statustoggle,!C-n
# keybinding	= stop,!S-F5
# keybinding	= tabnew,!C-t
# keybinding	= tabclose,!C-w
# keybinding	= tabundoclose,U
# keybinding	= tabnext 1,!C-1
# keybinding	= tabnext 2,!C-2
# keybinding	= tabnext 3,!C-3
# keybinding	= tabnext 4,!C-4
# keybinding	= tabnext 5,!C-5
# keybinding	= tabnext 6,!C-6
# keybinding	= tabnext 7,!C-7
# keybinding	= tabnext 8,!C-8
# keybinding	= tabnext 9,!C-9
# keybinding	= tabfirst,!C-less
# keybinding	= tablast,!C-greater
# keybinding	= tabprevious,!C-Left
# keybinding	= tabnext,!C-Right
# keybinding	= focusout,!C-minus
# keybinding	= focusin,!C-equal
# keybinding	= focusin,!C-plus
# keybinding	= focusreset,!C-0
# keybinding	= editelement,!C-i
# keybinding	= passthrough,!C-z
# keybinding	= :open ,!F9
# keybinding	= :open <uri>,!F10
# keybinding	= :tabnew ,!F11
# keybinding	= :tabnew <uri>,!F12

# parse the contents of another configuration file
# include_config	= ~/.xombrero_alternate.conf