Function

Purplemarkup_find_tag

Declaration [src]

gboolean
purple_markup_find_tag (
  const char* needle,
  const char* haystack,
  const char** start,
  const char** end,
  GData** attributes
)

Description [src]

Finds an HTML tag matching the given name.

This locates an HTML tag’s start and end, and stores its attributes in a GData hash table. The names of the attributes are lower-cased in the hash table, and the name of the tag is case insensitive.

Parameters

needle const char*
 

The name of the tag.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
haystack const char*
 

The null-delimited string to search in.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
start const char**
 

A pointer to the start of the tag if found.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
end const char**
 

A pointer to the end of the tag if found.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
attributes GData
 

The attributes, if the tag was found. This should be freed with g_datalist_clear().

 The data is owned by the caller of the function.

Return value

Returns: gboolean
 

TRUE if the tag was found.