Skip to content
tool_operate.c 70 KiB
Newer Older
      if(config->libcurl) {
        /* Initialise the libcurl source output */
        result = easysrc_init();
      /* Perform the main operations */
      if(!result) {
        size_t count = 0;
        struct OperationConfig *operation = config->first;
        /* Get the required aguments for each operation */
        while(!result && operation) {
          result = get_args(operation, count++);

          operation = operation->next;
        }

        /* Set the current operation pointer */
        config->current = config->first;
        /* Perform each operation */
        while(!result && config->current) {
          result = operate_do(config, config->current);
          config->current = config->current->next;

          if(config->current && config->current->easy)
            curl_easy_reset(config->current->easy);
#ifndef CURL_DISABLE_LIBCURL_OPTION
        if(config->libcurl) {
          /* Cleanup the libcurl source output */
          easysrc_cleanup();
          /* Dump the libcurl code if previously enabled */
          dumpeasysrc(config);
        }
      else
        helpf(config->errors, "out of memory\n");