High-Level Data Reduction Library: Download from the Internet.

High-Level Data Reduction Library 1.6.0 High-Level data reduction routines for ESO pipelines

Loading...
Searching...
No Matches
Data Structures | Functions
Download from the Internet.

This module contains functions to download information from the internet. It is based on libcurl (the multiprotocol file transfer library), a free and easy-to-use client-side URL transfer library. For detailed informations see https://curl.se/libcurl. More...

## Data Structures
struct | MemoryStruct

## Functions
char * | hdrl_download_url_to_buffer (const char *url, size_t *data_length)
| Downloads a url into a c data buffer.
cpl_error_code | hdrl_download_url_to_file (const char *url, const char *filename)
| Downloads a url into a file on disc.

## Detailed Description

This module contains functions to download information from the internet. It is based on libcurl (the multiprotocol file transfer library), a free and easy-to-use client-side URL transfer library. For detailed informations see https://curl.se/libcurl.

     ***************************************************************************
     *                                  _   _ ____  _
     *  Project                     ___| | | |  _ \| |
     *                             / __| | | | |_) | |
     *                            | (__| |_| |  _ <| |___
     *                             \___|\___/|_| \_\_____|
     *
     * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
     *
     * This software is licensed as described in the file COPYING, which
     * you should have received as part of this distribution. The terms
     * are also available at https://curl.se/docs/copyright.html.
     *
     * You may opt to use, copy, modify, merge, publish, distribute and/or sell
     * copies of the Software, and permit persons to whom the Software is
     * furnished to do so, under the terms of the COPYING file.
     *
     * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
     * KIND, either express or implied.
     *
     ***************************************************************************

## Function Documentation

## ◆ hdrl_download_url_to_buffer()

char * hdrl_download_url_to_buffer | ( | const char * | url,
|  | size_t * | data_length
| ) |  |

Downloads a url into a c data buffer.

Parameters

  url | The url to download from
  data_length | The length of the downloaded data buffer

Returns
  The downloaded data buffer or NULL in case of error.

For the supported protocols please see the https://curl.se/libcurl

Warning
  This function is not threadsafe, to the extent that it may only be called from the main thread, with no other threads running. So as long as esorex or alike is not using threads it still may be called from within a recipe before the the recipe itself, or hdrl launches any additional threads.

## ◆ hdrl_download_url_to_file()

cpl_error_code hdrl_download_url_to_file | ( | const char * | url,
|  | const char * | filename
| ) |  |

Downloads a url into a file on disc.

Parameters

  url | The url to download from
  filename | The name of the file where the url is downloaded

Returns
  CPL_ERROR_NONE if everything is ok, an error code otherwise

For the supported protocols please see the https://curl.se/libcurl

Warning
  This function is not threadsafe, to the extent that it may only be called from the main thread, with no other threads running. So as long as esorex or alike is not using threads it still may be called from within a recipe before the the recipe itself, or hdrl launches any additional threads.