Defines utility functions. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <time.h>
#include <unistd.h>
Go to the source code of this file.
Data Structures | |
struct | CMimeInfo_T |
Struct with mime informations. More... | |
Functions | |
char * | cmime_util_get_mimetype (const char *filename) |
Get mimetype of file use the 'file' tool. More... | |
CMimeInfo_T * | cmime_util_info_new (void) |
Creates a new CMimeInfo_T object. More... | |
void | cmime_util_info_free (CMimeInfo_T *mi) |
free a CMimeInfo_T object More... | |
CMimeInfo_T * | cmime_util_info_get_from_string (const char *s) |
Get mime type and encoding from given string. More... | |
CMimeInfo_T * | cmime_util_info_get_from_file (const char *filename) |
Get mime type and encoding from file. More... | |
int | cmime_util_rand () |
Generate a random number from 0 to RAND_MAX. More... | |
Defines utility functions.
char* cmime_util_get_mimetype | ( | const char * | filename | ) |
Get mimetype of file use the 'file' tool.
filename | path to file |
void cmime_util_info_free | ( | CMimeInfo_T * | mi | ) |
free a CMimeInfo_T object
mi | a CMimeInfo_T object |
CMimeInfo_T* cmime_util_info_get_from_file | ( | const char * | filename | ) |
Get mime type and encoding from file.
filename | file to check |
CMimeInfo_T* cmime_util_info_get_from_string | ( | const char * | s | ) |
Get mime type and encoding from given string.
s | a string to check |
CMimeInfo_T* cmime_util_info_new | ( | void | ) |
Creates a new CMimeInfo_T object.
int cmime_util_rand | ( | ) |
Generate a random number from 0 to RAND_MAX.