C Collections

chttpclient · Section 3

chttpcli_declare_scoped

chttpcli_declare_scoped - declare a scoped chttpcli handle variable

C Collections (libccollections, -lccollections)

#include <ccollections/chttpclient.h>
 
chttpcli_declare_scoped(name)

This macro declares a chttpcli variable called name with the GCC
cleanup attribute, so the handle is destroyed automatically when name
goes out of scope, whichever path leaves the scope. The cleanup
destroys it the same way chttpcli_destroy does.
 
The variable starts as CHTTPCLI_NULL. To skip the cleanup call, set
it back to CHTTPCLI_NULL before the scope ends.

chttpcli_construct_scoped(3), chttpcli_declare(3)