* lasso/utils.h:
fix lasso_list_add_xml_node, it must copy the node before assigning
it.
add lasso_list_add_new_xml_node for keeping the old behaviour.
* lasso/xml/xml.c:
fix use of lasso_list_add_xml_node, because copying the node before
assigning it is a leak now.
* lasso/utils.h:
- add macro lasso_ref(object), if object is not null, call
g_object_ref on it, and return the value, otherwise do nothing and
return NULL.
- make a better reporting of bad object release
- change format type for __LINE__ and dest arguments in
lasso_release_gobject warning display.
- add a lasso_check_non_empty_string macro
- add new macro to extract a specific node type from a list of
GObject objects.
- use xmlStrdup not g_strdup for lasso_assign_xml_string
- add lasso_list_add_gstrv and lasso_check_good_rc
- add macro lasso_list_get_first_child
- add inline function to test empty string
- change macro lasso_check_non_empty_string to use the new inline
function and go to cleanup
- fix lasso_check_non_empty_string macro
* lasso/utils.c:
- add lasso_gobject_is_of_type returns 0 if first parameters is a
gobject whose GType is equal to the second parameter, and 1
otherwise.
* lasso/utils.h:
lasso_foreach_full_begin(_type, _data, _iter, _list)
traverse GList* _list, using _iter as iteration variable
extract data field to variable _data of type _type.
* id-ff/session.h: seal public fields.
* id-ff/session.c, id-ff/sessionprivate.h: add accessors for reading
the is_dirty flag and counting store assertions.
* id-ff/logout.c, id-ff/login.c, saml-2.0/login.c, saml-2.0/logout.c,
saml-2.0/profile.c: use the new accessors.
* id-ff/profile.c: include the private header file, use the new
accessors, and remove unnecessary setting of is_dirty to FALSE (it
should be false at instanciation).
* utils.h: add a macro to access private content, prepare for using
G_TYPE_INSTANCE_GET_PRIVATE and the GObject infrastructure for
private structures eventually.
* lasso/utils.h:
change 'goto exit' for 'goto cleanup'. rename all goto_exit macros to
goto_cleanup_. rename goto_cleanup_if_fail to
goto_cleanup_if_fail_with_rc and add a
goto_cleanup_if_fail for function which do not return an integer
value. add documentation for goto_cleanup macro family.
* lasso/id-ff/login.c:
* lasso/id-ff/provider.c:
* lasso/id-ff/server.c:
* lasso/id-ff/session.c:
* lasso/id-wsf/discovery.c:
* lasso/id-wsf/wsf_profile.c:
* lasso/saml-2.0/profile.c:
* lasso/utils.h:
* lasso/xml/lib_logout_request.c:
* lasso/xml/tools.c:
* lasso/xml/xml.c:
update name of goto_exit_if_fail macros. rename 'exit' labels to
'cleanup'.
* lasso/backward_comp.h:
this header will contain substitue function, defines or types for
compatibility with older versions of dependencies.
* lasso/utils.h:
remove declaration of g_strcmp0
* lasso.c:
* tests/login_tests.c:
use backward_comp.h
* lasso/utils.h:
if glib is older than 2.16, export g_strcmp0 as part of internal
headers, in order to use it in login_tests.c
* tests/login_tests.c:
include utils.h
* lasso/utils.h:
- (lasso_assign_new_string,lasso_assign_gobject) if source parameter
is a function call it could be called two times and have unexpected
side effects. Copy the returned value to a temp variable and use it
instead.
* lasso/utils.h: When setting strings using lasso_assing_string or
lasso_assign_new_string, verify that new string is different than the
target value string before deallocating the target.
* lasso/utils.h:
this new macro try to extract a field from a structre (or any
left-hand-side value), try to typecheck it using 'LASSO_IS_XXX',
if succesfull, the value is assigned to the variable given as first
argument or we jump to the 'cleanup' goto label, setting the 4th
argument as the current error code (value of variable 'rc').
* lasso/utils.h: added new macros, renamed others:
- macros handling xmlNode are renamed from _node to _xml_node,
- new macros for assign GList* of specific objects:
- lasso_assign_list_of_gobjects,
- lasso_assign_list_of_strings,
- lasso_assign_new_list_of_gobjects,
- macros for assigning xmlChar string (we need a specific macros
because, we must use xmlFree to release the destination string),
- macros to add string without duping: lasso_list_add_xml_string,
- macros to add anything non-null (no type cast):
lasso_list_add_non_null.
* lasso/utils.h:
- add macro lasso_transfer_string and lasso_transfer_gobject,
to transfer ownership of such objects without copying or
their changing reference count. The old containing variable is
NULLed.
- lasso_list_add_gobject,lasso_list_add_new_gobject: test if the added
object is a GObject, if not do not add it and print a warning.
- lasso_check_type_equality: this macro use special builtin functions
only with GCC (typeof and __builtin_types_compatible_p) and do
metaprogramming using anonymous enumeration type to make compile
time assertions. It is used
- add macros to release XPathObject XPathContext, macro constructor to
make reference transfert macros (free dest, nullify dest, copy src
to dest without increasing refcount, nullify src), add a macro to
transfert xpath objects.
- lasso/utils.c, lasso/utils.h:
New internal api lasso_safe_prefix_string that can show any string
taking care of escaping newlines,tabs and non-graphical ou non-ASCII
characters.
- lasso/utils.h:
- add goto_exit_with_rc a standardized macro that suppose having an
'int rc' variable and an exit label in the current function.
- add lasso_release_output_buffer macro
* lasso/utils.h:
- (lasso_assign_node) This macro wrongly assumes that the destroy
function for xmlNode is xmlFreeNodeList but it's xmlFreeNode.
xmlFreeNodeList is for xmlNode list of children.