'What does this declaration means? struct Curl_easy *curl_easy_init(void)
struct Curl_easy *curl_easy_init(void)
{
CURLcode result;
struct Curl_easy *data;
/* Make sure we inited the global SSL stuff */
if(!initialized) {
result = curl_global_init(CURL_GLOBAL_DEFAULT);
if(result) {
/* something in the global init failed, return nothing */
DEBUGF(fprintf(stderr, "Error: curl_global_init failed\n"));
return NULL;
}
}
/* We use curl_open() with undefined URL so far */
result = Curl_open(&data);
if(result) {
DEBUGF(fprintf(stderr, "Error: Curl_open failed\n"));
return NULL;
}
return data;
}
struct Curl_easy *curl_easy_init(void){}
What does this declaration means? Is there any proper keyword can I google about this? I tried Function Pointer Struct, Struct pointer, etc....
Solution 1:[1]
This
struct Curl_easy * curl_easy_init(void)
is a declaration of a function with the name curl_easy_init that has the pointer return type struct Curl_easy * and no parameters.
In case of success the function returns the updated pointer
struct Curl_easy *data;
declared within the function. Otherwise the function returns NULL.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
