diff options
author | Aleksander Morgado <aleksandermj@chromium.org> | 2023-04-27 10:43:15 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksandermj@chromium.org> | 2023-04-27 10:43:15 +0000 |
commit | 1eba37dcd93c84fff9d63d975706a8b7f283eca4 (patch) | |
tree | 6a39d3bbb6977e548318066f2089db1f52287961 | |
parent | 4e5e10a1b78cc2a18529738f6a70ea95b447a253 (diff) | |
download | libqmi-1eba37dcd93c84fff9d63d975706a8b7f283eca4.tar.gz |
libqmi-glib: separate files for flags and enums types
This allows us to skip needing to include the non-existent
build_string_from_mask() or get_string() counterparts in the
documentation index.
21 files changed, 241 insertions, 353 deletions
diff --git a/build-aux/qmi-codegen/utils.py b/build-aux/qmi-codegen/utils.py index 7dcfaaa7..0de344c6 100644 --- a/build-aux/qmi-codegen/utils.py +++ b/build-aux/qmi-codegen/utils.py @@ -115,7 +115,9 @@ def add_source_start(f, output_name): "\n" "#include \"${name}.h\"\n" "#include \"qmi-enum-types.h\"\n" + "#include \"qmi-flag-types.h\"\n" "#include \"qmi-enum-types-private.h\"\n" + "#include \"qmi-flag-types-private.h\"\n" "#include \"qmi-flags64-types.h\"\n" "#include \"qmi-error-types.h\"\n" "#include \"qmi-device.h\"\n" diff --git a/build-aux/templates/qmi-enum-types-nodoc.h.template b/build-aux/templates/qmi-enum-types-nodoc.h.template index 31e0732b..69fa558e 100644 --- a/build-aux/templates/qmi-enum-types-nodoc.h.template +++ b/build-aux/templates/qmi-enum-types-nodoc.h.template @@ -17,13 +17,7 @@ GType @enum_name@_get_type (void) G_GNUC_CONST; /* Define type-specific symbols */ #define __@ENUMNAME@_IS_@TYPE@__ -#if defined __@ENUMNAME@_IS_ENUM__ const gchar *@enum_name@_get_string (@EnumName@ val); -#endif - -#if defined __@ENUMNAME@_IS_FLAGS__ -gchar *@enum_name@_build_string_from_mask (@EnumName@ mask); -#endif /*** END value-header ***/ diff --git a/build-aux/templates/qmi-enum-types.c.template b/build-aux/templates/qmi-enum-types.c.template index d2670110..011793ec 100644 --- a/build-aux/templates/qmi-enum-types.c.template +++ b/build-aux/templates/qmi-enum-types.c.template @@ -36,7 +36,6 @@ GType /* Enum-specific method to get the value as a string. * We get the nick of the GEnumValue. Note that this will be * valid even if the GEnumClass is not referenced anywhere. */ -#if defined __@ENUMNAME@_IS_ENUM__ const gchar * @enum_name@_get_string (@EnumName@ val) { @@ -49,51 +48,6 @@ const gchar * return NULL; } -#endif /* __@ENUMNAME@_IS_ENUM__ */ - -/* Flags-specific method to build a string with the given mask. - * We get a comma separated list of the nicks of the GFlagsValues. - * Note that this will be valid even if the GFlagsClass is not referenced - * anywhere. */ -#if defined __@ENUMNAME@_IS_FLAGS__ -gchar * -@enum_name@_build_string_from_mask (@EnumName@ mask) -{ - guint i; - gboolean first = TRUE; - GString *str = NULL; - - for (i = 0; @enum_name@_values[i].value_nick; i++) { - /* We also look for exact matches */ - if ((guint)mask == @enum_name@_values[i].value) { - if (str) - g_string_free (str, TRUE); - return g_strdup (@enum_name@_values[i].value_nick); - } - - /* Build list with single-bit masks */ - if (mask & @enum_name@_values[i].value) { - guint c; - gulong number = @enum_name@_values[i].value; - - for (c = 0; number; c++) - number &= number - 1; - - if (c == 1) { - if (!str) - str = g_string_new (""); - g_string_append_printf (str, "%s%s", - first ? "" : ", ", - @enum_name@_values[i].value_nick); - if (first) - first = FALSE; - } - } - } - - return (str ? g_string_free (str, FALSE) : NULL); -} -#endif /* __@ENUMNAME@_IS_FLAGS__ */ /*** END value-tail ***/ diff --git a/build-aux/templates/qmi-enum-types.h.template b/build-aux/templates/qmi-enum-types.h.template index 5500038e..58af6867 100644 --- a/build-aux/templates/qmi-enum-types.h.template +++ b/build-aux/templates/qmi-enum-types.h.template @@ -17,7 +17,6 @@ GType @enum_name@_get_type (void) G_GNUC_CONST; /* Define type-specific symbols */ #define __@ENUMNAME@_IS_@TYPE@__ -#if defined __@ENUMNAME@_IS_ENUM__ /** * @enum_name@_get_string: * @val: a @EnumName@. @@ -28,21 +27,6 @@ GType @enum_name@_get_type (void) G_GNUC_CONST; * Since: @enumsince@ */ const gchar *@enum_name@_get_string (@EnumName@ val); -#endif - -#if defined __@ENUMNAME@_IS_FLAGS__ -/** - * @enum_name@_build_string_from_mask: - * @mask: bitmask of @EnumName@ values. - * - * Builds a string containing a comma-separated list of nicknames for - * each #@EnumName@ in @mask. - * - * Returns: (transfer full): a string with the list of nicknames, or %NULL if none given. The returned value should be freed with g_free(). - * Since: @enumsince@ - */ -gchar *@enum_name@_build_string_from_mask (@EnumName@ mask); -#endif /*** END value-header ***/ diff --git a/build-aux/templates/qmi-flag-types-nodoc.h.template b/build-aux/templates/qmi-flag-types-nodoc.h.template new file mode 100644 index 00000000..46319f3a --- /dev/null +++ b/build-aux/templates/qmi-flag-types-nodoc.h.template @@ -0,0 +1,27 @@ +/*** BEGIN file-header ***/ + +#include <glib-object.h> + +G_BEGIN_DECLS +/*** END file-header ***/ + +/*** BEGIN file-production ***/ + +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GType @enum_name@_get_type (void) G_GNUC_CONST; +#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) + +/* Define type-specific symbols */ +#define __@ENUMNAME@_IS_@TYPE@__ + +gchar *@enum_name@_build_string_from_mask (@EnumName@ mask); + +/*** END value-header ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +/*** END file-tail ***/ diff --git a/build-aux/templates/qmi-flag-types-private.c.template b/build-aux/templates/qmi-flag-types-private.c.template new file mode 120000 index 00000000..aae32e40 --- /dev/null +++ b/build-aux/templates/qmi-flag-types-private.c.template @@ -0,0 +1 @@ +qmi-flag-types.c.template
\ No newline at end of file diff --git a/build-aux/templates/qmi-flag-types-private.h.template b/build-aux/templates/qmi-flag-types-private.h.template new file mode 120000 index 00000000..0ee7e8bf --- /dev/null +++ b/build-aux/templates/qmi-flag-types-private.h.template @@ -0,0 +1 @@ +qmi-flag-types-nodoc.h.template
\ No newline at end of file diff --git a/build-aux/templates/qmi-flag-types.c.template b/build-aux/templates/qmi-flag-types.c.template new file mode 100644 index 00000000..9ae0a7c8 --- /dev/null +++ b/build-aux/templates/qmi-flag-types.c.template @@ -0,0 +1,81 @@ +/*** BEGIN file-header ***/ + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +static const G@Type@Value @enum_name@_values[] = { +/*** END value-header ***/ +/*** BEGIN value-production ***/ + { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, +/*** END value-production ***/ +/*** BEGIN value-tail ***/ + { 0, NULL, NULL } +}; + +/* Define type-specific symbols */ + +GType +@enum_name@_get_type (void) +{ + static gsize g_define_type_id_initialized = 0; + + if (g_once_init_enter (&g_define_type_id_initialized)) { + GType g_define_type_id = + g_@type@_register_static (g_intern_static_string ("@EnumName@"), + @enum_name@_values); + g_once_init_leave (&g_define_type_id_initialized, g_define_type_id); + } + + return g_define_type_id_initialized; +} + +/* Flags-specific method to build a string with the given mask. + * We get a comma separated list of the nicks of the GFlagsValues. + * Note that this will be valid even if the GFlagsClass is not referenced + * anywhere. */ +gchar * +@enum_name@_build_string_from_mask (@EnumName@ mask) +{ + guint i; + gboolean first = TRUE; + GString *str = NULL; + + for (i = 0; @enum_name@_values[i].value_nick; i++) { + /* We also look for exact matches */ + if ((guint)mask == @enum_name@_values[i].value) { + if (str) + g_string_free (str, TRUE); + return g_strdup (@enum_name@_values[i].value_nick); + } + + /* Build list with single-bit masks */ + if (mask & @enum_name@_values[i].value) { + guint c; + gulong number = @enum_name@_values[i].value; + + for (c = 0; number; c++) + number &= number - 1; + + if (c == 1) { + if (!str) + str = g_string_new (""); + g_string_append_printf (str, "%s%s", + first ? "" : ", ", + @enum_name@_values[i].value_nick); + if (first) + first = FALSE; + } + } + } + + return (str ? g_string_free (str, FALSE) : NULL); +} + +/*** END value-tail ***/ + +/*** BEGIN file-tail ***/ +/*** END file-tail ***/ diff --git a/build-aux/templates/qmi-flag-types.h.template b/build-aux/templates/qmi-flag-types.h.template new file mode 100644 index 00000000..74d3b14a --- /dev/null +++ b/build-aux/templates/qmi-flag-types.h.template @@ -0,0 +1,37 @@ +/*** BEGIN file-header ***/ + +#include <glib-object.h> + +G_BEGIN_DECLS +/*** END file-header ***/ + +/*** BEGIN file-production ***/ + +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GType @enum_name@_get_type (void) G_GNUC_CONST; +#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) + +/* Define type-specific symbols */ +#define __@ENUMNAME@_IS_@TYPE@__ + +/** + * @enum_name@_build_string_from_mask: + * @mask: bitmask of @EnumName@ values. + * + * Builds a string containing a comma-separated list of nicknames for + * each #@EnumName@ in @mask. + * + * Returns: (transfer full): a string with the list of nicknames, or %NULL if none given. The returned value should be freed with g_free(). + * Since: @enumsince@ + */ +gchar *@enum_name@_build_string_from_mask (@EnumName@ mask); + +/*** END value-header ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +/*** END file-tail ***/ diff --git a/docs/reference/libqmi-glib/libqmi-glib-common.sections b/docs/reference/libqmi-glib/libqmi-glib-common.sections index 396579af..17de527c 100644 --- a/docs/reference/libqmi-glib/libqmi-glib-common.sections +++ b/docs/reference/libqmi-glib/libqmi-glib-common.sections @@ -157,11 +157,6 @@ qmi_device_open_flags_get_type qmi_device_release_client_flags_get_type qmi_device_expected_data_format_get_type qmi_device_add_link_flags_get_type -<SUBSECTION Private> -qmi_device_open_flags_get_string -qmi_device_release_client_flags_get_string -qmi_device_expected_data_format_build_string_from_mask -qmi_device_add_link_flags_get_string </SECTION> <SECTION> @@ -196,11 +191,6 @@ qmi_service_get_string qmi_endian_get_string qmi_data_endpoint_type_get_string qmi_sio_port_get_string -<SUBSECTION Private> -qmi_service_build_string_from_mask -qmi_endian_build_string_from_mask -qmi_data_endpoint_type_build_string_from_mask -qmi_sio_port_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_SERVICE QMI_TYPE_ENDIAN @@ -263,28 +253,6 @@ qmi_dms_swi_usb_composition_get_string qmi_dms_swi_usb_composition_get_description qmi_dms_foxconn_device_mode_get_string qmi_dms_foxconn_firmware_version_type_get_string -<SUBSECTION Private> -qmi_dms_data_service_capability_build_string_from_mask -qmi_dms_sim_capability_build_string_from_mask -qmi_dms_radio_interface_build_string_from_mask -qmi_dms_power_state_get_string -qmi_dms_uim_pin_id_build_string_from_mask -qmi_dms_uim_pin_status_build_string_from_mask -qmi_dms_operating_mode_build_string_from_mask -qmi_dms_offline_reason_get_string -qmi_dms_time_source_build_string_from_mask -qmi_dms_activation_state_build_string_from_mask -qmi_dms_uim_facility_build_string_from_mask -qmi_dms_uim_facility_state_build_string_from_mask -qmi_dms_uim_state_build_string_from_mask -qmi_dms_time_reference_type_build_string_from_mask -qmi_dms_firmware_image_type_build_string_from_mask -qmi_dms_boot_image_download_mode_build_string_from_mask -qmi_dms_mac_type_build_string_from_mask -qmi_dms_hp_device_mode_build_string_from_mask -qmi_dms_swi_usb_composition_build_string_from_mask -qmi_dms_foxconn_device_mode_build_string_from_mask -qmi_dms_foxconn_firmware_version_type_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_DMS_ACTIVATION_STATE QMI_TYPE_DMS_BOOT_IMAGE_DOWNLOAD_MODE @@ -466,70 +434,6 @@ qmi_nas_boolean_get_string qmi_nas_plmn_language_id_get_string qmi_nas_lte_voice_domain_get_string qmi_nas_reject_cause_get_string -<SUBSECTION Private> -qmi_nas_radio_interface_build_string_from_mask -qmi_nas_active_band_build_string_from_mask -qmi_nas_network_service_domain_build_string_from_mask -qmi_nas_evdo_sinr_level_build_string_from_mask -qmi_nas_signal_strength_request_get_string -qmi_nas_network_scan_type_get_string -qmi_nas_network_status_get_string -qmi_nas_network_register_type_build_string_from_mask -qmi_nas_registration_state_build_string_from_mask -qmi_nas_attach_state_build_string_from_mask -qmi_nas_network_type_build_string_from_mask -qmi_nas_roaming_indicator_status_build_string_from_mask -qmi_nas_data_capability_build_string_from_mask -qmi_nas_service_status_build_string_from_mask -qmi_nas_hdr_personality_build_string_from_mask -qmi_nas_call_barring_status_build_string_from_mask -qmi_nas_network_description_display_build_string_from_mask -qmi_nas_network_description_encoding_build_string_from_mask -qmi_nas_plmn_access_technology_identifier_get_string -qmi_nas_radio_technology_preference_get_string -qmi_nas_preference_duration_build_string_from_mask -qmi_nas_rat_mode_preference_get_string -qmi_nas_cdma_prl_preference_build_string_from_mask -qmi_nas_roaming_preference_build_string_from_mask -qmi_nas_network_selection_preference_build_string_from_mask -qmi_nas_change_duration_build_string_from_mask -qmi_nas_service_domain_preference_build_string_from_mask -qmi_nas_gsm_wcdma_acquisition_order_preference_build_string_from_mask -qmi_nas_td_scdma_band_preference_get_string -qmi_nas_roaming_status_build_string_from_mask -qmi_nas_hdr_protocol_revision_build_string_from_mask -qmi_nas_wcdma_hs_service_build_string_from_mask -qmi_nas_cell_broadcast_capability_build_string_from_mask -qmi_nas_sim_reject_state_build_string_from_mask -qmi_nas_cdma_pilot_type_build_string_from_mask -qmi_nas_day_of_week_build_string_from_mask -qmi_nas_daylight_savings_adjustment_build_string_from_mask -qmi_nas_wcdma_rrc_state_build_string_from_mask -qmi_nas_dl_bandwidth_build_string_from_mask -qmi_nas_scell_state_build_string_from_mask -qmi_nas_network_name_display_condition_get_string -qmi_nas_network_name_source_build_string_from_mask -qmi_nas_plmn_encoding_scheme_build_string_from_mask -qmi_nas_plmn_name_country_initials_build_string_from_mask -qmi_nas_plmn_name_spare_bits_build_string_from_mask -qmi_nas_ps_attach_action_build_string_from_mask -qmi_nas_usage_preference_build_string_from_mask -qmi_nas_lte_cell_access_status_build_string_from_mask -qmi_nas_network_selection_registration_restriction_build_string_from_mask -qmi_nas_lte_registration_domain_build_string_from_mask -qmi_nas_voice_domain_preference_build_string_from_mask -qmi_nas_network_scan_result_build_string_from_mask -qmi_nas_swi_emm_connection_state_build_string_from_mask -qmi_nas_swi_emm_state_build_string_from_mask -qmi_nas_swi_ims_reg_state_build_string_from_mask -qmi_nas_swi_modem_mode_build_string_from_mask -qmi_nas_swi_ps_state_build_string_from_mask -qmi_nas_swi_system_mode_build_string_from_mask -qmi_nas_drx_build_string_from_mask -qmi_nas_boolean_build_string_from_mask -qmi_nas_plmn_language_id_build_string_from_mask -qmi_nas_lte_voice_domain_build_string_from_mask -qmi_nas_reject_cause_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_NAS_ACTIVE_BAND QMI_TYPE_NAS_ATTACH_STATE @@ -761,73 +665,18 @@ qmi_wds_data_call_status_get_string qmi_wds_data_call_type_get_string qmi_wds_data_system_get_string qmi_wds_dormancy_status_get_string -qmi_wds_extended_data_bearer_technology_3gpp2_get_string -qmi_wds_extended_data_bearer_technology_3gpp_get_string +qmi_wds_extended_data_bearer_technology_3gpp2_build_string_from_mask +qmi_wds_extended_data_bearer_technology_3gpp_build_string_from_mask qmi_wds_radio_access_technology_get_string -qmi_wds_set_event_report_transfer_statistics_get_string -qmi_wds_so_evdo_rev0_get_string -qmi_wds_so_evdo_revb_get_string +qmi_wds_set_event_report_transfer_statistics_build_string_from_mask +qmi_wds_so_evdo_rev0_build_string_from_mask +qmi_wds_so_evdo_revb_build_string_from_mask qmi_wds_tethered_call_type_get_string qmi_wds_attach_pdn_list_action_get_string qmi_wds_client_type_get_string qmi_wds_ip_support_type_get_string qmi_wds_apn_type_mask_build_string_from_mask qmi_wds_profile_change_event_get_string -<SUBSECTION Private> -qmi_wds_ip_family_build_string_from_mask -qmi_wds_profile_family_build_string_from_mask -qmi_wds_technology_preference_get_string -qmi_wds_extended_technology_preference_build_string_from_mask -qmi_wds_call_type_build_string_from_mask -qmi_wds_call_end_reason_build_string_from_mask -qmi_wds_verbose_call_end_reason_type_build_string_from_mask -qmi_wds_verbose_call_end_reason_mip_build_string_from_mask -qmi_wds_verbose_call_end_reason_internal_build_string_from_mask -qmi_wds_verbose_call_end_reason_cm_build_string_from_mask -qmi_wds_verbose_call_end_reason_3gpp_build_string_from_mask -qmi_wds_verbose_call_end_reason_ppp_build_string_from_mask -qmi_wds_verbose_call_end_reason_ehrpd_build_string_from_mask -qmi_wds_verbose_call_end_reason_ipv6_build_string_from_mask -qmi_wds_connection_status_build_string_from_mask -qmi_wds_data_bearer_technology_build_string_from_mask -qmi_wds_network_type_build_string_from_mask -qmi_wds_data_system_network_type_build_string_from_mask -qmi_wds_rat_3gpp2_get_string -qmi_wds_rat_3gpp_get_string -qmi_wds_so_cdma1x_get_string -qmi_wds_so_evdo_reva_get_string -qmi_wds_requested_settings_get_string -qmi_wds_pdp_type_build_string_from_mask -qmi_wds_pdp_header_compression_type_build_string_from_mask -qmi_wds_pdp_data_compression_type_build_string_from_mask -qmi_wds_qos_class_identifier_build_string_from_mask -qmi_wds_traffic_class_build_string_from_mask -qmi_wds_delivery_order_build_string_from_mask -qmi_wds_sdu_error_ratio_build_string_from_mask -qmi_wds_sdu_residual_bit_error_ratio_build_string_from_mask -qmi_wds_sdu_erroneous_delivery_build_string_from_mask -qmi_wds_authentication_get_string -qmi_wds_profile_type_build_string_from_mask -qmi_wds_packet_statistics_mask_flag_get_string -qmi_wds_ds_profile_error_build_string_from_mask -qmi_wds_autoconnect_setting_build_string_from_mask -qmi_wds_autoconnect_setting_roaming_build_string_from_mask -qmi_wds_data_call_status_build_string_from_mask -qmi_wds_data_call_type_build_string_from_mask -qmi_wds_data_system_build_string_from_mask -qmi_wds_dormancy_status_build_string_from_mask -qmi_wds_extended_data_bearer_technology_3gpp2_build_string_from_mask -qmi_wds_extended_data_bearer_technology_3gpp_build_string_from_mask -qmi_wds_radio_access_technology_build_string_from_mask -qmi_wds_set_event_report_transfer_statistics_build_string_from_mask -qmi_wds_so_evdo_rev0_build_string_from_mask -qmi_wds_so_evdo_revb_build_string_from_mask -qmi_wds_tethered_call_type_build_string_from_mask -qmi_wds_attach_pdn_list_action_build_string_from_mask -qmi_wds_client_type_build_string_from_mask -qmi_wds_ip_support_type_build_string_from_mask -qmi_wds_apn_type_mask_get_string -qmi_wds_profile_change_event_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_WDS_AUTHENTICATION QMI_TYPE_WDS_AUTOCONNECT_SETTING @@ -979,25 +828,6 @@ qmi_wms_message_class_get_string qmi_wms_receipt_action_get_string qmi_wms_transfer_indication_get_string qmi_wms_ack_failure_cause_get_string -<SUBSECTION Private> -qmi_wms_storage_type_build_string_from_mask -qmi_wms_ack_indicator_build_string_from_mask -qmi_wms_message_format_build_string_from_mask -qmi_wms_message_mode_build_string_from_mask -qmi_wms_notification_type_build_string_from_mask -qmi_wms_cdma_service_option_build_string_from_mask -qmi_wms_cdma_cause_code_build_string_from_mask -qmi_wms_cdma_error_class_build_string_from_mask -qmi_wms_gsm_umts_rp_cause_build_string_from_mask -qmi_wms_gsm_umts_tp_cause_build_string_from_mask -qmi_wms_message_delivery_failure_type_build_string_from_mask -qmi_wms_message_tag_type_build_string_from_mask -qmi_wms_message_protocol_build_string_from_mask -qmi_wms_message_type_build_string_from_mask -qmi_wms_message_class_build_string_from_mask -qmi_wms_receipt_action_build_string_from_mask -qmi_wms_transfer_indication_build_string_from_mask -qmi_wms_ack_failure_cause_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_WMS_ACK_INDICATOR QMI_TYPE_WMS_CDMA_CAUSE_CODE @@ -1045,9 +875,6 @@ QmiPdcRefreshEventType <SUBSECTION Methods> qmi_pdc_configuration_type_get_string qmi_pdc_refresh_event_type_get_string -<SUBSECTION Private> -qmi_pdc_configuration_type_build_string_from_mask -qmi_pdc_refresh_event_type_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_PDC_CONFIGURATION_TYPE QMI_TYPE_PDC_REFRESH_EVENT_TYPE @@ -1071,13 +898,6 @@ qmi_pds_data_valid_build_string_from_mask qmi_pds_tracking_session_state_get_string qmi_pds_operating_mode_get_string qmi_pds_network_mode_get_string -<SUBSECTION Private> -qmi_pds_operation_mode_build_string_from_mask -qmi_pds_position_session_status_build_string_from_mask -qmi_pds_data_valid_get_string -qmi_pds_tracking_session_state_build_string_from_mask -qmi_pds_operating_mode_build_string_from_mask -qmi_pds_network_mode_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_PDS_DATA_VALID QMI_TYPE_PDS_OPERATION_MODE @@ -1103,10 +923,6 @@ QmiPbmSessionType qmi_pbm_event_registration_flag_build_string_from_mask qmi_pbm_phonebook_type_build_string_from_mask qmi_pbm_session_type_get_string -<SUBSECTION Private> -qmi_pbm_event_registration_flag_get_string -qmi_pbm_phonebook_type_get_string -qmi_pbm_session_type_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_PBM_EVENT_REGISTRATION_FLAG QMI_TYPE_PBM_PHONEBOOK_TYPE @@ -1141,7 +957,7 @@ QmiUimRefreshStage QmiUimConfiguration QmiUimDepersonalizationOperation <SUBSECTION Methods> -qmi_uim_event_registration_flag_get_string +qmi_uim_event_registration_flag_build_string_from_mask qmi_uim_session_type_get_string qmi_uim_file_type_get_string qmi_uim_security_attribute_logic_get_string @@ -1162,28 +978,6 @@ qmi_uim_refresh_mode_get_string qmi_uim_refresh_stage_get_string qmi_uim_configuration_build_string_from_mask qmi_uim_depersonalization_operation_get_string -<SUBSECTION Private> -qmi_uim_event_registration_flag_build_string_from_mask -qmi_uim_session_type_build_string_from_mask -qmi_uim_file_type_build_string_from_mask -qmi_uim_security_attribute_logic_build_string_from_mask -qmi_uim_security_attribute_get_string -qmi_uim_card_application_personalization_feature_status_build_string_from_mask -qmi_uim_card_application_personalization_feature_build_string_from_mask -qmi_uim_card_application_personalization_state_build_string_from_mask -qmi_uim_card_application_state_build_string_from_mask -qmi_uim_card_application_type_build_string_from_mask -qmi_uim_card_error_build_string_from_mask -qmi_uim_card_state_build_string_from_mask -qmi_uim_pin_state_build_string_from_mask -qmi_uim_pin_id_build_string_from_mask -qmi_uim_card_protocol_build_string_from_mask -qmi_uim_physical_card_state_build_string_from_mask -qmi_uim_slot_state_build_string_from_mask -qmi_uim_refresh_mode_build_string_from_mask -qmi_uim_refresh_stage_build_string_from_mask -qmi_uim_configuration_get_string -qmi_uim_depersonalization_operation_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_UIM_EVENT_REGISTRATION_FLAG QMI_TYPE_UIM_SESSION_TYPE @@ -1241,11 +1035,6 @@ qmi_oma_session_type_get_string qmi_oma_session_state_get_string qmi_oma_session_failed_reason_get_string qmi_oma_hfa_feature_done_state_get_string -<SUBSECTION Private> -qmi_oma_session_type_build_string_from_mask -qmi_oma_session_state_build_string_from_mask -qmi_oma_session_failed_reason_build_string_from_mask -qmi_oma_hfa_feature_done_state_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_OMA_SESSION_TYPE QMI_TYPE_OMA_SESSION_STATE @@ -1265,9 +1054,6 @@ QmiWdaDataAggregationProtocol <SUBSECTION Methods> qmi_wda_link_layer_protocol_get_string qmi_wda_data_aggregation_protocol_get_string -<SUBSECTION Private> -qmi_wda_link_layer_protocol_build_string_from_mask -qmi_wda_data_aggregation_protocol_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_WDA_LINK_LAYER_PROTOCOL QMI_TYPE_WDA_DATA_AGGREGATION_PROTOCOL @@ -1321,28 +1107,6 @@ qmi_voice_supplementary_service_type_get_string qmi_voice_supplementary_service_notification_type_get_string qmi_voice_supplementary_service_action_get_string qmi_voice_supplementary_service_reason_get_string -<SUBSECTION Private> -qmi_voice_call_state_build_string_from_mask -qmi_voice_call_type_build_string_from_mask -qmi_voice_call_direction_build_string_from_mask -qmi_voice_call_mode_build_string_from_mask -qmi_voice_als_build_string_from_mask -qmi_voice_presentation_build_string_from_mask -qmi_voice_domain_build_string_from_mask -qmi_voice_privacy_build_string_from_mask -qmi_voice_service_option_build_string_from_mask -qmi_voice_tty_mode_build_string_from_mask -qmi_voice_wcdma_amr_status_get_string -qmi_voice_user_action_build_string_from_mask -qmi_voice_uss_data_coding_scheme_build_string_from_mask -qmi_voice_alpha_data_coding_scheme_build_string_from_mask -qmi_voice_call_end_reason_build_string_from_mask -qmi_voice_call_control_result_type_build_string_from_mask -qmi_voice_call_control_supplementary_service_type_build_string_from_mask -qmi_voice_supplementary_service_type_build_string_from_mask -qmi_voice_supplementary_service_notification_type_build_string_from_mask -qmi_voice_supplementary_service_action_build_string_from_mask -qmi_voice_supplementary_service_reason_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_VOICE_CALL_STATE QMI_TYPE_VOICE_CALL_TYPE @@ -1418,11 +1182,13 @@ QmiLocDeleteSvInfo QmiLocLockType <SUBSECTION Methods> qmi_loc_intermediate_report_state_get_string +qmi_loc_event_registration_flag_build_string_from_mask qmi_loc_fix_recurrence_type_get_string qmi_loc_operation_mode_get_string qmi_loc_engine_state_get_string qmi_loc_health_status_get_string qmi_loc_indication_status_get_string +qmi_loc_sensor_data_usage_build_string_from_mask qmi_loc_navigation_data_get_string qmi_loc_reliability_get_string qmi_loc_satellite_status_get_string @@ -1440,31 +1206,6 @@ qmi_loc_delete_gnss_data_build_string_from_mask qmi_loc_delete_sv_info_build_string_from_mask qmi_loc_nmea_type_build_string_from_mask qmi_loc_lock_type_get_string -<SUBSECTION Private> -qmi_loc_intermediate_report_state_build_string_from_mask -qmi_loc_operation_mode_build_string_from_mask -qmi_loc_fix_recurrence_type_build_string_from_mask -qmi_loc_event_registration_flag_build_string_from_mask -qmi_loc_engine_state_build_string_from_mask -qmi_loc_health_status_build_string_from_mask -qmi_loc_indication_status_build_string_from_mask -qmi_loc_navigation_data_build_string_from_mask -qmi_loc_reliability_build_string_from_mask -qmi_loc_satellite_status_build_string_from_mask -qmi_loc_satellite_valid_information_get_string -qmi_loc_sensor_data_usage_build_string_from_mask -qmi_loc_session_status_build_string_from_mask -qmi_loc_system_build_string_from_mask -qmi_loc_technology_used_get_string -qmi_loc_time_source_build_string_from_mask -qmi_loc_server_type_build_string_from_mask -qmi_loc_server_address_type_get_string -qmi_loc_predicted_orbits_data_format_build_string_from_mask -qmi_loc_delete_cell_database_get_string -qmi_loc_delete_clock_info_get_string -qmi_loc_delete_sv_info_get_string -qmi_loc_nmea_type_get_string -qmi_loc_lock_type_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_LOC_INTERMEDIATE_REPORT_STATE QMI_TYPE_LOC_FIX_RECURRENCE_TYPE @@ -1520,9 +1261,6 @@ QmiQosEvent <SUBSECTION Methods> qmi_qos_status_get_string qmi_qos_event_get_string -<SUBSECTION Private> -qmi_qos_status_build_string_from_mask -qmi_qos_event_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_QOS_STATUS QMI_TYPE_QOS_EVENT @@ -1538,9 +1276,6 @@ QmiGasUsbCompositionEndpointType <SUBSECTION Methods> qmi_gas_firmware_listing_mode_get_string qmi_gas_usb_composition_endpoint_type_get_string -<SUBSECTION Private> -qmi_gas_firmware_listing_mode_build_string_from_mask -qmi_gas_usb_composition_endpoint_type_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_GAS_FIRMWARE_LISTING_MODE QMI_TYPE_GAS_USB_COMPOSITION_ENDPOINT_TYPE @@ -1562,12 +1297,6 @@ qmi_dsd_apn_type_preference_build_string_from_mask qmi_dsd_data_system_network_type_get_string qmi_dsd_radio_access_technology_get_string qmi_dsd_so_mask_build_string_from_mask -<SUBSECTION Private> -qmi_dsd_apn_type_build_string_from_mask -qmi_dsd_apn_type_preference_get_string -qmi_dsd_data_system_network_type_build_string_from_mask -qmi_dsd_radio_access_technology_build_string_from_mask -qmi_dsd_so_mask_get_string <SUBSECTION Standard> QMI_TYPE_DSD_APN_TYPE QMI_TYPE_DSD_APN_TYPE_PREFERENCE @@ -1587,8 +1316,6 @@ qmi_dsd_so_mask_get_type QmiSarRfState <SUBSECTION Methods> qmi_sar_rf_state_get_string -<SUBSECTION Private> -qmi_sar_rf_state_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_SAR_RF_STATE qmi_sar_rf_state_get_type @@ -1600,8 +1327,6 @@ qmi_sar_rf_state_get_type QmiFoxFirmwareVersionType <SUBSECTION Methods> qmi_fox_firmware_version_type_get_string -<SUBSECTION Private> -qmi_fox_firmware_version_type_build_string_from_mask <SUBSECTION Standard> QMI_TYPE_FOX_FIRMWARE_VERSION_TYPE qmi_fox_firmware_version_type_get_type diff --git a/docs/reference/libqmi-glib/meson.build b/docs/reference/libqmi-glib/meson.build index c07454a4..2f5cfc37 100644 --- a/docs/reference/libqmi-glib/meson.build +++ b/docs/reference/libqmi-glib/meson.build @@ -19,6 +19,7 @@ private_headers = [ 'qmi-enums-private.h', 'qmi-enum-types-private.h', 'qmi-file.h', + 'qmi-flag-types-private.h', 'qmi-helpers.h', 'qmi-net-port-manager.h', 'qmi-net-port-manager-rmnet.h', diff --git a/src/libqmi-glib/generated/meson.build b/src/libqmi-glib/generated/meson.build index a41acc0e..87cf8f3c 100644 --- a/src/libqmi-glib/generated/meson.build +++ b/src/libqmi-glib/generated/meson.build @@ -57,7 +57,7 @@ gen_sources += custom_target( capture: true, ) -# Enum/Flag types +# Enum types enum_types = 'qmi-enum-types' gen_headers += custom_target( @@ -67,6 +67,7 @@ gen_headers += custom_target( command: [ python, qmi_mkenums, + '--enums-only', '--fhead', '#ifndef __LIBQMI_GLIB_ENUM_TYPES_H__\n#define __LIBQMI_GLIB_ENUM_TYPES_H__\n#include "qmi-enums.h"\n#include "qmi-enums-wds.h"\n#include "qmi-enums-dms.h"\n#include "qmi-enums-nas.h"\n#include "qmi-enums-wms.h"\n#include "qmi-enums-pds.h"\n#include "qmi-enums-pdc.h"\n#include "qmi-enums-pbm.h"\n#include "qmi-enums-uim.h"\n#include "qmi-enums-sar.h"\n#include "qmi-enums-oma.h"\n#include "qmi-enums-wda.h"\n#include "qmi-enums-voice.h"\n#include "qmi-enums-loc.h"\n#include "qmi-enums-qos.h"\n#include "qmi-enums-gas.h"\n#include "qmi-enums-dsd.h"\n#include "qmi-enums-fox.h"\n#include "qmi-device.h"\n', '--template', files(templates_dir / enum_types + '.h.template'), '--ftail', '#endif /* __LIBQMI_GLIB_ENUM_TYPES_H__ */\n', @@ -83,13 +84,48 @@ gen_sources += custom_target( command: [ python, qmi_mkenums, + '--enums-only', '--fhead', '#include "qmi-enum-types.h"\n', '--template', files(templates_dir / enum_types + '.c.template'), '@INPUT@'], capture: true, ) -# Private Enum/Flag types +# Flag types +enum_types = 'qmi-flag-types' + +gen_headers += custom_target( + enum_types + '.h', + input: qmi_enums_headers, + output: enum_types + '.h', + command: [ + python, + qmi_mkenums, + '--flags-only', + '--fhead', '#ifndef __LIBQMI_GLIB_FLAG_TYPES_H__\n#define __LIBQMI_GLIB_FLAG_TYPES_H__\n#include "qmi-enums.h"\n#include "qmi-enums-wds.h"\n#include "qmi-enums-dms.h"\n#include "qmi-enums-nas.h"\n#include "qmi-enums-wms.h"\n#include "qmi-enums-pds.h"\n#include "qmi-enums-pdc.h"\n#include "qmi-enums-pbm.h"\n#include "qmi-enums-uim.h"\n#include "qmi-enums-sar.h"\n#include "qmi-enums-oma.h"\n#include "qmi-enums-wda.h"\n#include "qmi-enums-voice.h"\n#include "qmi-enums-loc.h"\n#include "qmi-enums-qos.h"\n#include "qmi-enums-gas.h"\n#include "qmi-enums-dsd.h"\n#include "qmi-enums-fox.h"\n#include "qmi-device.h"\n', + '--template', files(templates_dir / enum_types + '.h.template'), + '--ftail', '#endif /* __LIBQMI_GLIB_FLAG_TYPES_H__ */\n', + '@INPUT@'], + capture: true, + install: true, + install_dir: qmi_glib_pkgincludedir, +) + +gen_sources += custom_target( + enum_types + '.c', + input: qmi_enums_headers, + output: enum_types + '.c', + command: [ + python, + qmi_mkenums, + '--flags-only', + '--fhead', '#include "qmi-flag-types.h"\n', + '--template', files(templates_dir / enum_types + '.c.template'), + '@INPUT@'], + capture: true, +) + +# Private Enum types enum_types = 'qmi-enum-types-private' private_gen_headers += custom_target( @@ -99,6 +135,7 @@ private_gen_headers += custom_target( command: [ python, qmi_mkenums, + '--enums-only', '--fhead', '#ifndef __LIBQMI_GLIB_ENUM_TYPES_PRIVATE_H__\n#define __LIBQMI_GLIB_ENUM_TYPES_PRIVATE_H__\n#include "qmi-enums-private.h"\n', '--template', files(templates_dir / enum_types + '.h.template'), '--ftail', '#endif /* __LIBQMI_GLIB_ENUM_TYPES_PRIVATE_H__ */\n', @@ -113,12 +150,45 @@ private_gen_sources += custom_target( command: [ python, qmi_mkenums, + '--enums-only', '--fhead', '#include "qmi-enum-types-private.h"\n', '--template', files(templates_dir / enum_types + '.c.template'), '@INPUT@'], capture: true, ) +# Private Flag types +enum_types = 'qmi-flag-types-private' + +private_gen_headers += custom_target( + enum_types + '.h', + input: qmi_enums_private_header, + output: enum_types + '.h', + command: [ + python, + qmi_mkenums, + '--flags-only', + '--fhead', '#ifndef __LIBQMI_GLIB_FLAG_TYPES_PRIVATE_H__\n#define __LIBQMI_GLIB_FLAG_TYPES_PRIVATE_H__\n#include "qmi-enums-private.h"\n', + '--template', files(templates_dir / enum_types + '.h.template'), + '--ftail', '#endif /* __LIBQMI_GLIB_FLAG_TYPES_PRIVATE_H__ */\n', + '@INPUT@'], + capture: true, +) + +private_gen_sources += custom_target( + enum_types + '.c', + input: qmi_enums_private_header, + output: enum_types + '.c', + command: [ + python, + qmi_mkenums, + '--flags-only', + '--fhead', '#include "qmi-flag-types-private.h"\n', + '--template', files(templates_dir / enum_types + '.c.template'), + '@INPUT@'], + capture: true, +) + # 64bit flag types enum_types = 'qmi-flags64-types' diff --git a/src/libqmi-glib/libqmi-glib.h b/src/libqmi-glib/libqmi-glib.h index 867429f7..57ad0482 100644 --- a/src/libqmi-glib/libqmi-glib.h +++ b/src/libqmi-glib/libqmi-glib.h @@ -102,6 +102,7 @@ /* generated */ #include "qmi-error-types.h" #include "qmi-enum-types.h" +#include "qmi-flag-types.h" #include "qmi-flags64-types.h" #if QMI_QRTR_SUPPORTED diff --git a/src/libqmi-glib/qmi-client.c b/src/libqmi-glib/qmi-client.c index 5a9c3a3a..e0c96fd0 100644 --- a/src/libqmi-glib/qmi-client.c +++ b/src/libqmi-glib/qmi-client.c @@ -24,6 +24,7 @@ #include "qmi-error-types.h" #include "qmi-enum-types.h" +#include "qmi-flag-types.h" #include "qmi-device.h" #include "qmi-client.h" #include "qmi-ctl.h" diff --git a/src/libqmi-glib/qmi-compat.c b/src/libqmi-glib/qmi-compat.c index 78ffb372..636a9631 100644 --- a/src/libqmi-glib/qmi-compat.c +++ b/src/libqmi-glib/qmi-compat.c @@ -24,6 +24,7 @@ #include "qmi-compat.h" #include "qmi-helpers.h" #include "qmi-enum-types.h" +#include "qmi-flag-types.h" #ifndef QMI_DISABLE_DEPRECATED diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c index 01e7ba13..e9576de5 100644 --- a/src/libqmi-glib/qmi-device.c +++ b/src/libqmi-glib/qmi-device.c @@ -61,6 +61,7 @@ #include "qmi-helpers.h" #include "qmi-error-types.h" #include "qmi-enum-types.h" +#include "qmi-flag-types.h" #include "qmi-proxy.h" #include "qmi-net-port-manager-qmiwwan.h" #include "qmi-version.h" diff --git a/src/libqmi-glib/qmi-endpoint-qrtr.c b/src/libqmi-glib/qmi-endpoint-qrtr.c index 8c4007a1..fee18f5d 100644 --- a/src/libqmi-glib/qmi-endpoint-qrtr.c +++ b/src/libqmi-glib/qmi-endpoint-qrtr.c @@ -35,6 +35,7 @@ #include "qmi-endpoint-qrtr.h" #include "qmi-errors.h" #include "qmi-enum-types.h" +#include "qmi-flag-types.h" #include "qmi-error-types.h" #include "qmi-message.h" diff --git a/src/libqmi-glib/qmi-message.c b/src/libqmi-glib/qmi-message.c index a51b77e1..7ba130c1 100644 --- a/src/libqmi-glib/qmi-message.c +++ b/src/libqmi-glib/qmi-message.c @@ -38,7 +38,9 @@ #include "qmi-helpers.h" #include "qmi-enums-private.h" #include "qmi-enum-types-private.h" +#include "qmi-flag-types-private.h" #include "qmi-enum-types.h" +#include "qmi-flag-types.h" #include "qmi-error-types.h" #include "qmi-ctl.h" diff --git a/src/libqmi-glib/qmi-net-port-manager-qmiwwan.c b/src/libqmi-glib/qmi-net-port-manager-qmiwwan.c index d533469b..8c3f3acd 100644 --- a/src/libqmi-glib/qmi-net-port-manager-qmiwwan.c +++ b/src/libqmi-glib/qmi-net-port-manager-qmiwwan.c @@ -25,6 +25,7 @@ #include "qmi-net-port-manager-qmiwwan.h" #include "qmi-enum-types.h" +#include "qmi-flag-types.h" #include "qmi-error-types.h" #include "qmi-errors.h" #include "qmi-helpers.h" diff --git a/src/libqmi-glib/qmi-proxy.c b/src/libqmi-glib/qmi-proxy.c index eeff4bf0..15c3fe44 100644 --- a/src/libqmi-glib/qmi-proxy.c +++ b/src/libqmi-glib/qmi-proxy.c @@ -33,6 +33,7 @@ #include "config.h" #include "qmi-enum-types.h" +#include "qmi-flag-types.h" #include "qmi-error-types.h" #include "qmi-device.h" #include "qmi-ctl.h" diff --git a/src/qmi-firmware-update/meson.build b/src/qmi-firmware-update/meson.build index f30b1d35..0228b81a 100644 --- a/src/qmi-firmware-update/meson.build +++ b/src/qmi-firmware-update/meson.build @@ -69,6 +69,7 @@ sources += custom_target( command: [ python, qmi_mkenums, + '--enums-only', '--fhead', '#ifndef QFU_ENUM_TYPES_H\n#define QFU_ENUM_TYPES_H\n#include "qfu-image.h"\n#include "qfu-qdl-message.h"\n#include "qfu-dload-message.h"\n#include "qfu-sahara-message.h"\n', '--template', files(templates_dir / enum_types + '.h.template'), '--ftail', '#endif /* __QFUENUM_TYPES_H__ */\n', @@ -83,6 +84,7 @@ sources += custom_target( command: [ python, qmi_mkenums, + '--enums-only', '--fhead', '#include "qfu-enum-types.h"\n', '--template', files(templates_dir / enum_types + '.c.template'), '@INPUT@'], |