Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Man program for handle man protocol */
- #include <stdio.h>
- #include <stdlib.h>
- #include "protocol.h"
- #include "platform-specific.h"
- int main(int argc, char ** argv)
- {
- int result = 0;
- char protocol;
- char url[256];
- // Get next argument:
- argv++;
- argc--;
- // Loop through all the arguments
- for (; argc > 0; argc--,argv++)
- {
- protocol = getProtocolFromUrl(*argv);
- if (protocol == MAN_PROTOCOL)
- {
- memset(url,NULL,sizeof(url));
- // Push pointer to the url without protocol:
- *argv = *argv+6;
- sprintf(url,"\"http://www.google.com/search?hl=es&source=hp&q=manpage+%s&btnI=Voy+a+tener+suerte&meta=&aq=f&oq=\"",*argv);
- result = execute(command,url);
- if (result)
- return result;
- }
- /*if (protocol == MANOFFLINE_PROTOCOL)
- {
- // Push pointer to the url without protocol:
- *argv = *argv+6;
- sprintf(url,)
- }*/
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement