text stringlengths 0 357 |
|---|
loginparam->send_user? loginparam->send_user : unset, |
loginparam->send_pw? pw : unset, |
loginparam->send_server? loginparam->send_server : unset, |
loginparam->send_port, |
flags_readable); |
free(flags_readable); |
return ret; |
} |
``` |
Filename: dc_lot.c |
```c |
#include "dc_context.h" |
#define DC_LOT_MAGIC 0x00107107 |
dc_lot_t* dc_lot_new() |
{ |
dc_lot_t* lot = NULL; |
if ((lot=calloc(1, sizeof(dc_lot_t)))==NULL) { |
exit(27); /* cannot allocate little memory, unrecoverable error */ |
} |
lot->magic = DC_LOT_MAGIC; |
lot->text1_meaning = 0; |
return lot; |
} |
/** |
* Frees an object containing a set of parameters. |
* If the set object contains strings, the strings are also freed with this function. |
* Set objects are created eg. by dc_chatlist_get_summary() or dc_msg_get_summary(). |
* |
* @memberof dc_lot_t |
* @param set The object to free. |
* If NULL is given, nothing is done. |
* @return None. |
*/ |
void dc_lot_unref(dc_lot_t* set) |
{ |
if (set==NULL || set->magic!=DC_LOT_MAGIC) { |
return; |
} |
dc_lot_empty(set); |
set->magic = 0; |
free(set); |
} |
void dc_lot_empty(dc_lot_t* lot) |
{ |
if (lot==NULL || lot->magic!=DC_LOT_MAGIC) { |
return; |
} |
free(lot->text1); |
lot->text1 = NULL; |
lot->text1_meaning = 0; |
free(lot->text2); |
lot->text2 = NULL; |
free(lot->fingerprint); |
lot->fingerprint = NULL; |
free(lot->invitenumber); |
lot->invitenumber = NULL; |
free(lot->auth); |
lot->auth = NULL; |
lot->timestamp = 0; |
lot->state = 0; |
lot->id = 0; |
} |
/** |
* Get first string. The meaning of the string is defined by the creator of the object and may be roughly described by dc_lot_get_text1_meaning(). |
* |
* @memberof dc_lot_t |
* @param lot The lot object. |
* @return A string, the string may be empty and the returned value must be free()'d. NULL if there is no such string. |
*/ |
char* dc_lot_get_text1(const dc_lot_t* lot) |
{ |
if (lot==NULL || lot->magic!=DC_LOT_MAGIC) { |
return NULL; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.