| 755 | | if(wi_log_level >= WI_LOG_DEBUG) { |
|---|
| 756 | | if(wi_hash_data_for_key(p7_spec->types_name, type->name)) { |
|---|
| 757 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 758 | | WI_STR("Type with name \"%@\" already exists"), |
|---|
| 759 | | type->name); |
|---|
| 760 | | |
|---|
| 761 | | return false; |
|---|
| 762 | | } |
|---|
| 763 | | |
|---|
| 764 | | if(wi_hash_data_for_key(p7_spec->types_id, (void *) type->id)) { |
|---|
| 765 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 766 | | WI_STR("Type with id %lu (name \"%@\") already exists"), |
|---|
| 767 | | type->name, type->id); |
|---|
| 768 | | |
|---|
| 769 | | return false; |
|---|
| 770 | | } |
|---|
| | 755 | if(wi_hash_data_for_key(p7_spec->types_name, type->name)) { |
|---|
| | 756 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 757 | WI_STR("Type with name \"%@\" already exists"), |
|---|
| | 758 | type->name); |
|---|
| | 759 | |
|---|
| | 760 | return false; |
|---|
| | 761 | } |
|---|
| | 762 | |
|---|
| | 763 | if(wi_hash_data_for_key(p7_spec->types_id, (void *) type->id)) { |
|---|
| | 764 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 765 | WI_STR("Type with id %lu (name \"%@\") already exists"), |
|---|
| | 766 | type->name, type->id); |
|---|
| | 767 | |
|---|
| | 768 | return false; |
|---|
| 794 | | if(wi_log_level >= WI_LOG_DEBUG) { |
|---|
| 795 | | if(wi_hash_data_for_key(p7_spec->fields_name, field->name)) { |
|---|
| 796 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 797 | | WI_STR("Field with name \"%@\" already exists"), |
|---|
| 798 | | field->name); |
|---|
| 799 | | |
|---|
| 800 | | return false; |
|---|
| 801 | | } |
|---|
| | 792 | if(wi_hash_data_for_key(p7_spec->fields_name, field->name)) { |
|---|
| | 793 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 794 | WI_STR("Field with name \"%@\" already exists"), |
|---|
| | 795 | field->name); |
|---|
| 803 | | if(wi_hash_data_for_key(p7_spec->fields_id, (void *) field->id)) { |
|---|
| 804 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 805 | | WI_STR("Field with id %lu (name \"%@\") already exists"), |
|---|
| 806 | | field->id, field->name); |
|---|
| 807 | | |
|---|
| 808 | | return false; |
|---|
| 809 | | } |
|---|
| | 797 | return false; |
|---|
| | 798 | } |
|---|
| | 799 | |
|---|
| | 800 | if(wi_hash_data_for_key(p7_spec->fields_id, (void *) field->id)) { |
|---|
| | 801 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 802 | WI_STR("Field with id %lu (name \"%@\") already exists"), |
|---|
| | 803 | field->id, field->name); |
|---|
| | 804 | |
|---|
| | 805 | return false; |
|---|
| 833 | | if(wi_log_level >= WI_LOG_DEBUG) { |
|---|
| 834 | | if(wi_hash_data_for_key(p7_spec->messages_name, message->name)) { |
|---|
| 835 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 836 | | WI_STR("Message with name \"%@\" already exists"), |
|---|
| 837 | | message->name); |
|---|
| 838 | | |
|---|
| 839 | | return false; |
|---|
| 840 | | } |
|---|
| | 829 | if(wi_hash_data_for_key(p7_spec->messages_name, message->name)) { |
|---|
| | 830 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 831 | WI_STR("Message with name \"%@\" already exists"), |
|---|
| | 832 | message->name); |
|---|
| 842 | | if(wi_hash_data_for_key(p7_spec->messages_id, (void *) message->id)) { |
|---|
| 843 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 844 | | WI_STR("Message with id %lu (name \"%@\") already exists"), |
|---|
| 845 | | message->id, message->name); |
|---|
| 846 | | |
|---|
| 847 | | return false; |
|---|
| 848 | | } |
|---|
| | 834 | return false; |
|---|
| | 835 | } |
|---|
| | 836 | |
|---|
| | 837 | if(wi_hash_data_for_key(p7_spec->messages_id, (void *) message->id)) { |
|---|
| | 838 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 839 | WI_STR("Message with id %lu (name \"%@\") already exists"), |
|---|
| | 840 | message->id, message->name); |
|---|
| | 841 | |
|---|
| | 842 | return false; |
|---|
| 872 | | if(wi_log_level >= WI_LOG_DEBUG) { |
|---|
| 873 | | if(wi_hash_data_for_key(p7_spec->transactions_name, transaction->message->name)) { |
|---|
| 874 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 875 | | WI_STR("Transaction with message \"%@\" already exists"), |
|---|
| 876 | | transaction->message->name); |
|---|
| 877 | | |
|---|
| 878 | | return false; |
|---|
| 879 | | } |
|---|
| | 866 | if(wi_hash_data_for_key(p7_spec->transactions_name, transaction->message->name)) { |
|---|
| | 867 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 868 | WI_STR("Transaction with message \"%@\" already exists"), |
|---|
| | 869 | transaction->message->name); |
|---|
| | 870 | |
|---|
| | 871 | return false; |
|---|
| 1682 | | if(wi_log_level >= WI_LOG_DEBUG) { |
|---|
| 1683 | | if(wi_hash_data_for_key(message->parameters_name, parameter->field->name)) { |
|---|
| 1684 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 1685 | | WI_STR("Message \"%@\" has a duplicate field \"%@\""), |
|---|
| 1686 | | message->name, parameter->field->name); |
|---|
| 1687 | | |
|---|
| 1688 | | return NULL; |
|---|
| 1689 | | } |
|---|
| | 1674 | if(wi_hash_data_for_key(message->parameters_name, parameter->field->name)) { |
|---|
| | 1675 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 1676 | WI_STR("Message \"%@\" has a duplicate field \"%@\""), |
|---|
| | 1677 | message->name, parameter->field->name); |
|---|
| | 1678 | |
|---|
| | 1679 | return NULL; |
|---|
| 1761 | | if(wi_log_level >= WI_LOG_DEBUG) { |
|---|
| 1762 | | if(wi_string_case_insensitive_compare(use, WI_STR("required")) != 0 && |
|---|
| 1763 | | wi_string_case_insensitive_compare(use, WI_STR("optional")) != 0) { |
|---|
| 1764 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 1765 | | WI_STR("Parameter \"%@\" in message \"%@\" has an invalid \"use\" (\"%@\")"), |
|---|
| 1766 | | parameter->field->name, message->name, use); |
|---|
| 1767 | | |
|---|
| 1768 | | return NULL; |
|---|
| 1769 | | } |
|---|
| | 1751 | if(wi_string_case_insensitive_compare(use, WI_STR("required")) != 0 && |
|---|
| | 1752 | wi_string_case_insensitive_compare(use, WI_STR("optional")) != 0) { |
|---|
| | 1753 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 1754 | WI_STR("Parameter \"%@\" in message \"%@\" has an invalid \"use\" (\"%@\")"), |
|---|
| | 1755 | parameter->field->name, message->name, use); |
|---|
| | 1756 | |
|---|
| | 1757 | return NULL; |
|---|
| 1839 | | if(wi_log_level >= WI_LOG_DEBUG) { |
|---|
| 1840 | | if(wi_string_case_insensitive_compare(originator, WI_STR("client")) != 0 && |
|---|
| 1841 | | wi_string_case_insensitive_compare(originator, WI_STR("server")) != 0 && |
|---|
| 1842 | | wi_string_case_insensitive_compare(originator, WI_STR("both")) != 0) { |
|---|
| 1843 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 1844 | | WI_STR("Transaction \"%@\" has an invalid \"originator\" (\"%@\")"), |
|---|
| 1845 | | transaction->message->name, originator); |
|---|
| 1846 | | |
|---|
| 1847 | | return NULL; |
|---|
| 1848 | | } |
|---|
| | 1827 | if(wi_string_case_insensitive_compare(originator, WI_STR("client")) != 0 && |
|---|
| | 1828 | wi_string_case_insensitive_compare(originator, WI_STR("server")) != 0 && |
|---|
| | 1829 | wi_string_case_insensitive_compare(originator, WI_STR("both")) != 0) { |
|---|
| | 1830 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 1831 | WI_STR("Transaction \"%@\" has an invalid \"originator\" (\"%@\")"), |
|---|
| | 1832 | transaction->message->name, originator); |
|---|
| | 1833 | |
|---|
| | 1834 | return NULL; |
|---|
| 1861 | | if(wi_log_level >= WI_LOG_DEBUG) { |
|---|
| 1862 | | if(wi_string_case_insensitive_compare(use, WI_STR("required")) != 0 && |
|---|
| 1863 | | wi_string_case_insensitive_compare(use, WI_STR("optional"))) { |
|---|
| 1864 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 1865 | | WI_STR("Transaction \"%@\" has an invalid \"use\" (\"%@\")"), |
|---|
| 1866 | | transaction->message->name, use); |
|---|
| 1867 | | |
|---|
| 1868 | | return NULL; |
|---|
| 1869 | | } |
|---|
| | 1847 | if(wi_string_case_insensitive_compare(use, WI_STR("required")) != 0 && |
|---|
| | 1848 | wi_string_case_insensitive_compare(use, WI_STR("optional"))) { |
|---|
| | 1849 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 1850 | WI_STR("Transaction \"%@\" has an invalid \"use\" (\"%@\")"), |
|---|
| | 1851 | transaction->message->name, use); |
|---|
| | 1852 | |
|---|
| | 1853 | return NULL; |
|---|
| 1928 | | if(wi_log_level >= WI_LOG_DEBUG) { |
|---|
| 1929 | | if(wi_hash_data_for_key(andor->replies_hash, reply->message->name)) { |
|---|
| 1930 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 1931 | | WI_STR("Transaction \"%@\" has a duplicate reply \"%@\""), |
|---|
| 1932 | | transaction->message->name, reply->message->name); |
|---|
| 1933 | | |
|---|
| 1934 | | return NULL; |
|---|
| 1935 | | } |
|---|
| | 1912 | if(wi_hash_data_for_key(andor->replies_hash, reply->message->name)) { |
|---|
| | 1913 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 1914 | WI_STR("Transaction \"%@\" has a duplicate reply \"%@\""), |
|---|
| | 1915 | transaction->message->name, reply->message->name); |
|---|
| | 1916 | |
|---|
| | 1917 | return NULL; |
|---|
| 2015 | | if(wi_log_level >= WI_LOG_DEBUG) { |
|---|
| 2016 | | if(wi_string_case_insensitive_compare(use, WI_STR("required")) != 0 && |
|---|
| 2017 | | wi_string_case_insensitive_compare(use, WI_STR("optional"))) { |
|---|
| 2018 | | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| 2019 | | WI_STR("Reply \"%@\" in transaction \"%@\" has an invalid \"use\" (\"%@\")"), |
|---|
| 2020 | | reply->message->name, transaction->message->name, use); |
|---|
| 2021 | | |
|---|
| 2022 | | return NULL; |
|---|
| 2023 | | } |
|---|
| | 1997 | if(wi_string_case_insensitive_compare(use, WI_STR("required")) != 0 && |
|---|
| | 1998 | wi_string_case_insensitive_compare(use, WI_STR("optional"))) { |
|---|
| | 1999 | wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, |
|---|
| | 2000 | WI_STR("Reply \"%@\" in transaction \"%@\" has an invalid \"use\" (\"%@\")"), |
|---|
| | 2001 | reply->message->name, transaction->message->name, use); |
|---|
| | 2002 | |
|---|
| | 2003 | return NULL; |
|---|