summaryrefslogtreecommitdiffstats
path: root/lasso/utils.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix license boilerplatesSimo Sorce2013-12-031-2/+1
| | | | | | | Instad of referring to an old FSF address, point the reader to the FSF website where the latest licenses and addresses are published. Signed-off-by: Simo Sorce <simo@redhat.com>
* utils: add a lasso_release_slist macroBenjamin Dauvergne2013-01-251-1/+1
|
* add a lasso_release_slistBenjamin Dauvergne2013-01-251-0/+3
|
* Simplify useless complexity in include pathsBenjamin Dauvergne2011-12-161-4/+4
|
* [utils] add lasso_crypto_memequal functionBenjamin Dauvergne2011-12-051-0/+20
| | | | This method compare byte strings in constant time.
* [utils] add lasso_transfer_xml_node macrosBenjamin Dauvergne2011-12-051-0/+3
|
* [utils] add macros to append to and release a list of xmlSecKey*Benjamin Dauvergne2011-05-191-0/+9
| | | | [core] make lasso_provider_verify_query_signature use lasso_provider_verify_signature
* [utils] fix typo in lasso_assign_sec_keyBenjamin Dauvergne2010-12-141-1/+2
|
* [Core] replace all use of g_strcmp0 by lasso_strisequal and lasso_strisnotequalBenjamin Dauvergne2010-10-011-1/+1
| | | | | Too much human errors with strcmp kind of functions. Also change name os lasso_is_empty_string to lasso_strisempty.
* [Core] add helper API for string comparaisonBenjamin Dauvergne2010-10-011-5/+18
| | | | It should remove most errors when comparing strings.
* [Core] add macro to release an xmlNodeList objectBenjamin Dauvergne2010-06-291-0/+3
|
* [Core] add macro to release GList of xmlNodeListBenjamin Dauvergne2010-06-291-0/+3
|
* [Core] add macros to manipulate xmlNodeList and GList of xmlNodeListBenjamin Dauvergne2010-06-291-0/+21
| | | | | The method to copy them is xmlCopyNodeList and not xmlCopyNode, so we need another set of macros.
* Core: move logging function and macros to their own module, adapt perl bindingBenjamin Dauvergne2010-06-121-0/+1
|
* Import tools in utils.hBenjamin Dauvergne2010-06-101-0/+2
|
* Change all logging to use message()Benjamin Dauvergne2010-06-091-5/+5
|
* Utils: add function to extract/create node in listsBenjamin Dauvergne2010-06-091-0/+4
| | | | | * lasso_extract_gtype_from_list_or_new will help for method with create or extend nodes in lists.
* Improve safety by replacing all g_hash_table_destroy use by ↵Benjamin Dauvergne2010-04-221-1/+1
| | | | lasso_release_ghashtable
* Utils: add lasso_assign_listBenjamin Dauvergne2010-04-221-0/+8
|
* Add lasso_release_gstringBenjamin Dauvergne2010-04-221-0/+9
|
* Utils: add lasso_release_ghashtableBenjamin Dauvergne2010-04-221-0/+3
|
* Core: add macro to remove gobject from listsBenjamin Dauvergne2010-03-021-0/+6
|
* Core: add do/while(0) around block of goto_cleanup_with_rcBenjamin Dauvergne2010-03-021-2/+2
|
* Fix lasso_extract_gobject_from_listBenjamin Dauvergne2010-02-221-2/+2
|
* Core: in utils.h, use a temporary to store reference to freed listBenjamin Dauvergne2010-02-171-3/+4
|
* Core: add more memory tracing, add a tracing macroBenjamin Dauvergne2010-02-041-0/+7
| | | | | * lasso/utils.h: add lasso_trace, which as a printf signature. * xml/xml.c: add more trace to node initialization code.
* Core: in utils.h, add macros to replace verbose g_return_val_if_failBenjamin Dauvergne2010-02-011-0/+12
|
* Utils: lasso_unref, a safe g_object_unref, and add some document about ↵Benjamin Dauvergne2010-02-011-8/+60
| | | | existing family of macros
* Core: add new macros to lasso/utils.h, fix lasso_assign_new_list_of_gobjectsBenjamin Dauvergne2010-01-281-1/+24
| | | | | | | | | * lasso/utils.h: add: - lasso_assign_new_xml_node - lasso_assign_new_list_of_strings - lasso_assign_new_list_of_xml_node fix lasso_assign_new_list_of_gobjects, bad naming of release macro.
* Add new macro lasso_list_add_new_xml_nodeBenjamin Dauvergne2010-01-251-0/+6
| | | | | | | | | | * 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.
* Documentation: distribute stylesheet, fix documentation comments, compelte ↵Benjamin Dauvergne2010-01-181-1/+1
| | | | lasso-sections.txt
* Core: in utils.h, add a macros, fix existingBenjamin Dauvergne2010-01-041-3/+54
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Core: in utils.h, change __STRING(x) for #xBenjamin Dauvergne2009-12-161-1/+2
| | | | | | * lasso/utils.h: __STRING(x) does not seem more portable than #x so change, problem with AIX.
* Core: add new macros to traverse listsBenjamin Dauvergne2009-09-111-0/+20
| | | | | | | * 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&Core: Seal public field of LassoSessionBenjamin Dauvergne2009-08-261-0/+2
| | | | | | | | | | | | | | | | | | * 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.
* Core: fix bad name of lasso_unlink_and_release_nodeBenjamin Dauvergne2009-08-261-1/+4
| | | | | | | * lasso/utils.h: - rename lasso_unlink_and_release_node to lasso_release_list_of_xml_node. - add a GList iteration macro: lasso_foreach.
* Fix debug echo on stdoutBenjamin Dauvergne2009-04-301-1/+1
| | | | | * lasso/utils.h: make lasso_mem_debug output on stderr and not stdout
* fix: handle non-LHS argument for lasso_extract_node_or_fail()Benjamin Dauvergne2009-04-271-5/+8
| | | | | | * lasso/utils.h: create a temporary varaible to store result of second argument evaluation to prevent spurious side effects.
* Rework cleanup handlingBenjamin Dauvergne2009-04-221-7/+53
| | | | | | | | | | | | | | | | | | | | | | * 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'.
* Core: add an header file for backward compatibilityBenjamin Dauvergne2009-04-141-7/+0
| | | | | | | | | | | * 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
* Tests&Core: add g_strcmp0 if glib is oldBenjamin Dauvergne2009-04-021-0/+7
| | | | | | | | * 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
* Core: Macros to print deallocation messagesBenjamin Dauvergne2009-03-271-0/+7
| | | | | | * lasso/utils.h: lasso_mem_debug print deallocation message with respect to class and field.
* Core: remove type check equality on gobject macrosBenjamin Dauvergne2009-03-271-2/+0
| | | | | | * lasso/utils.h: assignment to the temporary variable allow to check for the typing, do not use lasso_check_type_equality.
* Core: add macros to handle xmlSecKeyBenjamin Dauvergne2009-03-271-0/+20
| | | | | * lasso/utils.h: macros to assign and release xmlSecKey(s).
* Core: rename lasso_release_xmlchar to lasso_release_xml_stringBenjamin Dauvergne2009-03-271-1/+1
| | | | | * lasso/id-wsf/wsf_profile.c, lasso/utils.h, lasso/xml/xml.c: rename lasso_release_xmlchar to lasso_release_xml_string.
* Core: Fix double instantiation of macro parametersBenjamin Dauvergne2009-03-271-11/+14
| | | | | | | | * 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.
* Core: Fix corner case in deallocation macrosBenjamin Dauvergne2009-03-271-2/+3
| | | | | | * 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.
* Core: add new internal macro lasso_extract_node_or_failBenjamin Dauvergne2009-03-271-0/+9
| | | | | | | | | * 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').
* Core: if OFTYPE is already defined, skipBenjamin Dauvergne2009-01-241-0/+2
|
* Core: add macros to assign list of things, rename xmlNode related macrosBenjamin Dauvergne2009-01-241-86/+146
| | | | | | | | | | | | | | * 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.