src/siri/db/series.c
/*
 * Write dropped series to file and decrement series reference counter.
 * Function 'siridb_series_drop_prepare' should be called before this function.
 *
 * In case we cannot write the series_id to the drop file we log critical and
 * return -1 but no signal is raised.
 *
 * Warning: do not forget to call 'siridb_series_flush_dropped()'
 *
 * Return 0 if successful.
 */
Write dropped series to file and decrement series reference counter.
Function 'siridb_series_drop_prepare' should be called before this function.

In case we cannot write the series_id to the drop file we log critical and
return -1 but no signal is raised.

do not forget to call 'siridb_series_flush_dropped()'

Return 0 if successful.
Write dropped series to file and decrement series reference counter . Function ' siridb_series_drop_prepare ' should be called before this function . In case we cannot write the series_id to the drop file we log critical and return - 1 but no signal is raised . do not forget to call ' siridb_series_flush_dropped () ' Return 0 if successful .
int siridb_series_drop_commit(siridb_t * siridb, siridb_series_t * series)
{
#ifdef DEBUG
    assert (series->flags & SIRIDB_SERIES_IS_DROPPED);
#endif
    int rc = 0;
    if (siridb->dropped_fp == NULL && SERIES_open_dropped_file(siridb))
    {
        rc = -1;
    }
    else if (fwrite(&series->id, sizeof(uint32_t), 1, siridb->dropped_fp) != 1)
    {
        log_critical("Cannot write %d to dropped cache file.", series->id);
        rc = -1;
    };
    siridb_series_decref(series);
    return rc;
}
int siridb_series_drop_commit ( siridb_t * siridb , siridb_series_t * series ) { #ifdef DEBUG assert ( series -> flags & SIRIDB_SERIES_IS_DROPPED ) ; #endif int rc = 0 ; if ( siridb -> dropped_fp == NULL && SERIES_open_dropped_file ( siridb ) ) { rc = -1 ; } else if ( fwrite ( & series -> id , sizeof ( uint32_t ) , 1 , siridb -> dropped_fp ) != 1 ) { log_critical ( " " , series -> id ) ; rc = -1 ; } ; siridb_series_decref ( series ) ; return rc ; }
Write dropped series to file and decrement series reference counter.
Write dropped series to file and decrement series reference counter .
/* we are sure the pointer is at the end of the file */ /* decrement reference to series */