Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/ruby17 -w
- begin
- require 'rubygems'
- rescue LoadError
- $: << 'lib'
- end
- require 'inline'
- class Parse_GET
- inline do |builder|
- builder.add_compile_flags %q(-O3)
- # builder.add_link_flags %q(-lstdc++)
- builder.include "<stdio.h>"
- builder.include "<stdlib.h>"
- builder.include "<string.h>"
- builder.c "
- static
- void
- parseGet(char *url)
- {
- char *q = memchr(url, '?', strlen(url));
- if(q != NULL)
- {
- strdup(q+1);
- if(q!=NULL)
- {
- puts(q);
- free(q);
- }
- }
- }
- "
- end
- end
- t = Parse_GET.new()
- t.parseGet("http://teste.com.br/index.php?var=2&ball=7&search=lol");
Advertisement
Add Comment
Please, Sign In to add comment