|
createrepo_c library
0.17.7
C library for metadata manipulation
|
Data Structures | |
| struct | cr_ContentStat |
| struct | CR_FILE |
Macros | |
| #define | CR_CW_ERR -1 |
| #define | cr_open(FILENAME, MODE, COMTYPE, ERR) cr_sopen(FILENAME, MODE, COMTYPE, NULL, ERR) |
Functions | |
| cr_ContentStat * | cr_contentstat_new (cr_ChecksumType type, GError **err) |
| void | cr_contentstat_free (cr_ContentStat *cstat, GError **err) |
| const char * | cr_compression_suffix (cr_CompressionType comtype) |
| cr_CompressionType | cr_detect_compression (const char *filename, GError **err) |
| cr_CompressionType | cr_compression_type (const char *name) |
| CR_FILE * | cr_sopen (const char *filename, cr_OpenMode mode, cr_CompressionType comtype, cr_ContentStat *stat, GError **err) |
| int | cr_set_dict (CR_FILE *cr_file, const void *dict, unsigned int len, GError **err) |
| int | cr_read (CR_FILE *cr_file, void *buffer, unsigned int len, GError **err) |
| int | cr_write (CR_FILE *cr_file, const void *buffer, unsigned int len, GError **err) |
| int | cr_puts (CR_FILE *cr_file, const char *str, GError **err) |
| int | cr_end_chunk (CR_FILE *cr_file, GError **err) |
| int | cr_set_autochunk (CR_FILE *cr_file, gboolean auto_chunk, GError **err) |
| ssize_t | cr_get_zchunk_with_index (CR_FILE *f, ssize_t zchunk_index, char **copy_buf, GError **err) |
| int | cr_printf (GError **err, CR_FILE *cr_file, const char *format,...) |
| int | cr_close (CR_FILE *cr_file, GError **err) |
| #define CR_CW_ERR -1 |
Return value - Error
Definition at line 92 of file compression_wrapper.h.
| #define cr_open | ( | FILENAME, | |
| MODE, | |||
| COMTYPE, | |||
| ERR | |||
| ) | cr_sopen(FILENAME, MODE, COMTYPE, NULL, ERR) |
Open/Create the specified file.
| FILENAME | filename |
| MODE | open mode |
| COMTYPE | type of compression |
| ERR | GError ** |
Definition at line 120 of file compression_wrapper.h.
| enum cr_CompressionType |
Compression type.
Definition at line 37 of file compression_wrapper.h.
| enum cr_OpenMode |
Open modes.
| Enumerator | |
|---|---|
| CR_CW_MODE_READ | Read mode |
| CR_CW_MODE_WRITE | Write mode |
| CR_CW_MODE_SENTINEL | Sentinel of the list |
Definition at line 50 of file compression_wrapper.h.
| int cr_close | ( | CR_FILE * | cr_file, |
| GError ** | err | ||
| ) |
| const char* cr_compression_suffix | ( | cr_CompressionType | comtype | ) |
Returns a common suffix for the specified cr_CompressionType.
| comtype | compression type |
| cr_CompressionType cr_compression_type | ( | const char * | name | ) |
Return compression type.
| name | compression name |
| void cr_contentstat_free | ( | cr_ContentStat * | cstat, |
| GError ** | err | ||
| ) |
Frees cr_ContentStat object.
| cstat | cr_ContentStat object |
| err | GError ** |
| cr_ContentStat* cr_contentstat_new | ( | cr_ChecksumType | type, |
| GError ** | err | ||
| ) |
Creates new cr_ContentStat object
| type | Type of checksum. (if CR_CHECKSUM_UNKNOWN is used, no checksum calculation will be done) |
| err | GError ** |
| cr_CompressionType cr_detect_compression | ( | const char * | filename, |
| GError ** | err | ||
| ) |
Detect a compression type of the specified file.
| filename | filename |
| err | GError ** |
| int cr_end_chunk | ( | CR_FILE * | cr_file, |
| GError ** | err | ||
| ) |
If compression format allows ending of chunks, tell it to end chunk
| cr_file | CR_FILE pointer |
| err | GError ** |
| ssize_t cr_get_zchunk_with_index | ( | CR_FILE * | f, |
| ssize_t | zchunk_index, | ||
| char ** | copy_buf, | ||
| GError ** | err | ||
| ) |
Get specific zchunks data indentified by index
| cr_file | CR_FILE pointer |
| zchunk_index | Index of wanted zchunk |
| copy_buf | Output pointer, upon return contains wanted zchunk data |
| err | GError ** |
| int cr_printf | ( | GError ** | err, |
| CR_FILE * | cr_file, | ||
| const char * | format, | ||
| ... | |||
| ) |
Writes a formatted string into the cr_file.
| err | GError ** |
| cr_file | CR_FILE pointer |
| format | format string |
| ... | list of additional arguments as specified in format |
| int cr_puts | ( | CR_FILE * | cr_file, |
| const char * | str, | ||
| GError ** | err | ||
| ) |
Writes the string pointed by str into the cr_file.
| cr_file | CR_FILE pointer |
| str | null terminated ('\0') string |
| err | GError ** |
| int cr_read | ( | CR_FILE * | cr_file, |
| void * | buffer, | ||
| unsigned int | len, | ||
| GError ** | err | ||
| ) |
| int cr_set_autochunk | ( | CR_FILE * | cr_file, |
| gboolean | auto_chunk, | ||
| GError ** | err | ||
| ) |
Set zchunk auto-chunk algorithm. Must be done before first byte is written
| cr_file | CR_FILE pointer |
| auto_chunk | Whether auto-chunking should be enabled |
| err | GError ** |
| int cr_set_dict | ( | CR_FILE * | cr_file, |
| const void * | dict, | ||
| unsigned int | len, | ||
| GError ** | err | ||
| ) |
Sets the compression dictionary for a file
| cr_file | CR_FILE pointer |
| dict | dictionary |
| len | length of dictionary |
| err | GError ** |
| CR_FILE* cr_sopen | ( | const char * | filename, |
| cr_OpenMode | mode, | ||
| cr_CompressionType | comtype, | ||
| cr_ContentStat * | stat, | ||
| GError ** | err | ||
| ) |
Open/Create the specified file. If opened for writting, you can pass a cr_ContentStat object and after cr_close() get stats of an open content (stats of uncompressed content).
| filename | filename |
| mode | open mode |
| comtype | type of compression |
| stat | pointer to cr_ContentStat or NULL |
| err | GError ** |
| int cr_write | ( | CR_FILE * | cr_file, |
| const void * | buffer, | ||
| unsigned int | len, | ||
| GError ** | err | ||
| ) |
Writes the array of len bytes from buffer to the cr_file.
| cr_file | CR_FILE pointer |
| buffer | source buffer |
| len | number of bytes to read |
| err | GError ** |