first.c 545 B

1234567891011121314151617181920212223242526272829303132
  1. #include "test.h"
  2. #ifdef CURLDEBUG
  3. /* provide a proto for this debug function */
  4. extern void curl_memdebug(const char *);
  5. #endif
  6. /* test is provided in the test code file */
  7. int test(char *url);
  8. char *arg2=NULL;
  9. int main(int argc, char **argv)
  10. {
  11. char *URL;
  12. if(argc< 2 ) {
  13. fprintf(stderr, "Pass URL as argument please\n");
  14. return 1;
  15. }
  16. if(argc>2)
  17. arg2=argv[2];
  18. URL = argv[1]; /* provide this to the rest */
  19. fprintf(stderr, "URL: %s\n", URL);
  20. #ifdef CURLDEBUG
  21. curl_memdebug("memdump");
  22. #endif
  23. return test(URL);
  24. }