Function

Giocontent_type_guess

Declaration [src]

gchar*
g_content_type_guess (
  const gchar* filename,
  const guchar* data,
  gsize data_size,
  gboolean* result_uncertain
)

Description [src]

Guesses the content type based on example data. If the function is uncertain, result_uncertain will be set to TRUE. Either filename or data may be NULL, in which case the guess will be based solely on the other argument.

Parameters

filename const gchar*
 

A string, or NULL.

 The argument can be NULL.
 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
data An array of guchar
 

A stream of data, or NULL.

 The argument can be NULL.
 The length of the array is specified in the data_size argument.
 The data is owned by the caller of the function.
data_size gsize
 

The size of data.

result_uncertain gboolean*
 

Return location for the certainty of the result, or NULL.

 The argument will be set by the function.
 The argument can be NULL.
 The called function takes ownership of the data, and is responsible for freeing it.

Return value

Returns: gchar*
 

A string indicating a guessed content type for the given data. Free with g_free()

 The caller of the function takes ownership of the data, and is responsible for freeing it.
 The string is a NUL terminated UTF-8 string.