From f5e20a77eda067e4a22e4631d905e4fae1cb4627 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sun, 25 Jan 2015 18:52:43 +0100 Subject: [PATCH] build: avoid using underscores when defining header guards and other symbols Names starting with underscore are reserved identifiers by the C standard, so just avoid them. The only thing this patch doesn't fix is the definition of the public GObject types, which are currently defined as e.g.: typedef struct _QmiDevice QmiDevice; struct _QmiDevice { ... }; These names aren't changed to avoid breaking API, even if the struct types aren't really used (typedefs are). https://bugs.freedesktop.org/show_bug.cgi?id=70697 --- build-aux/qmi-codegen/Client.py | 16 ++- build-aux/qmi-codegen/Field.py | 4 +- build-aux/qmi-codegen/Message.py | 6 +- build-aux/qmi-codegen/MessageList.py | 10 +- build-aux/qmi-codegen/VariableInteger.py | 4 +- build-aux/qmi-codegen/utils.py | 2 +- build-aux/templates/qmi-enum-types-template.c | 8 +- build-aux/templates/qmi-enum-types-template.h | 6 +- build-aux/templates/qmi-flags64-types-template.h | 4 +- .../libqmi-glib/libqmi-glib-common.sections | 140 +++++++++++++++++++++ src/libqmi-glib/generated/Makefile.am | 16 +-- src/libqmi-glib/libqmi-glib.h | 8 +- src/libqmi-glib/qmi-client.h | 8 +- src/libqmi-glib/qmi-device.c | 12 +- src/libqmi-glib/qmi-device.h | 8 +- src/libqmi-glib/qmi-enums-dms.h | 8 +- src/libqmi-glib/qmi-enums-nas.h | 8 +- src/libqmi-glib/qmi-enums-oma.h | 8 +- src/libqmi-glib/qmi-enums-pbm.h | 8 +- src/libqmi-glib/qmi-enums-pds.h | 8 +- src/libqmi-glib/qmi-enums-private.h | 6 +- src/libqmi-glib/qmi-enums-uim.h | 8 +- src/libqmi-glib/qmi-enums-wda.h | 8 +- src/libqmi-glib/qmi-enums-wds.h | 8 +- src/libqmi-glib/qmi-enums-wms.h | 8 +- src/libqmi-glib/qmi-enums.h | 8 +- src/libqmi-glib/qmi-errors.h | 8 +- src/libqmi-glib/qmi-flags64-dms.h | 8 +- src/libqmi-glib/qmi-flags64-nas.h | 8 +- src/libqmi-glib/qmi-message.c | 47 +++---- src/libqmi-glib/qmi-message.h | 14 +-- src/libqmi-glib/qmi-proxy.c | 4 +- src/libqmi-glib/qmi-proxy.h | 10 +- src/libqmi-glib/qmi-utils.c | 16 +-- src/libqmi-glib/qmi-utils.h | 18 +-- src/libqmi-glib/qmi-version.h.in | 10 +- src/libqmi-glib/test/test-message.c | 24 ++-- src/qmicli/qmicli-helpers.h | 6 +- src/qmicli/qmicli.h | 6 +- utils/qmitest.c | 3 +- 40 files changed, 338 insertions(+), 182 deletions(-) diff --git a/build-aux/qmi-codegen/Client.py b/build-aux/qmi-codegen/Client.py index 1e342ae..ca99a9a 100644 --- a/build-aux/qmi-codegen/Client.py +++ b/build-aux/qmi-codegen/Client.py @@ -159,7 +159,7 @@ class Client: ' GError *error = NULL;\n' '\n' ' /* Parse indication */\n' - ' output = __${message_fullname_underscore}_indication_parse (message, &error);\n' + ' output = ${message_fullname_underscore}_indication_parse (message, &error);\n' ' if (!output) {\n' ' g_warning ("Couldn\'t parse \'${message_name}\' indication: %s",\n' ' error ? error->message : "Unknown error");\n' @@ -346,7 +346,7 @@ class Client: '\n' ' reply = qmi_device_command_finish (device, res, &error);\n' ' if (reply) {\n' - ' output = __qmi_message_${service_lowercase}_abort_response_parse (reply, &error);\n' + ' output = qmi_message_${service_lowercase}_abort_response_parse (reply, &error);\n' ' if (output)\n' ' qmi_message_${service_lowercase}_abort_output_unref (output);\n' ' qmi_message_unref (reply);\n' @@ -394,7 +394,7 @@ class Client: ' input,\n' ' transaction_id,\n' ' NULL);\n' - ' abort = __qmi_message_${service_lowercase}_abort_request_create (\n' + ' abort = qmi_message_${service_lowercase}_abort_request_create (\n' ' qmi_client_get_next_transaction_id (QMI_CLIENT (self)),\n' ' qmi_client_get_cid (QMI_CLIENT (self)),\n' ' input,\n' @@ -420,7 +420,7 @@ class Client: ' }\n' '\n' ' /* Parse reply */\n' - ' output = __${message_fullname_underscore}_response_parse (reply, &error);\n' + ' output = ${message_fullname_underscore}_response_parse (reply, &error);\n' ' if (!output)\n' ' g_simple_async_result_take_error (simple, error);\n' ' else\n' @@ -470,7 +470,7 @@ class Client: '\n' ' transaction_id = qmi_client_get_next_transaction_id (QMI_CLIENT (self));\n' '\n' - ' request = __${message_fullname_underscore}_request_create (\n' + ' request = ${message_fullname_underscore}_request_create (\n' ' transaction_id,\n' ' qmi_client_get_cid (QMI_CLIENT (self)),\n' ' ${input_var},\n' @@ -522,7 +522,8 @@ class Client: translations = { 'underscore' : utils.build_underscore_name(self.name), 'no_prefix_underscore_upper' : utils.build_underscore_name(self.name[4:]).upper(), 'camelcase' : utils.build_camelcase_name (self.name), - 'hyphened' : utils.build_dashed_name (self.name) } + 'hyphened' : utils.build_dashed_name (self.name), + 'service' : self.service.lower() } template = ( '
\n' @@ -538,6 +539,9 @@ class Client: 'QMI_IS_${no_prefix_underscore_upper}_CLASS\n' 'QMI_${no_prefix_underscore_upper}_GET_CLASS\n' '${underscore}_get_type\n' + '\n' + 'qmi_int_message_${service}_get_printable\n' + 'qmi_int_message_${service}_get_version_introduced\n' '
\n' '\n') sfile.write(string.Template(template).substitute(translations)) diff --git a/build-aux/qmi-codegen/Field.py b/build-aux/qmi-codegen/Field.py index c64bf29..25dab82 100644 --- a/build-aux/qmi-codegen/Field.py +++ b/build-aux/qmi-codegen/Field.py @@ -303,7 +303,7 @@ class Field: template = ( '\n' '${lp}/* The remaining size of the buffer needs to be 0 if we successfully read the TLV */\n' - '${lp}if ((offset = __qmi_message_tlv_read_remaining_size (message, init_offset, offset)) > 0) {\n' + '${lp}if ((offset = qmi_int_message_tlv_read_remaining_size (message, init_offset, offset)) > 0) {\n' '${lp} g_warning ("Left \'%" G_GSIZE_FORMAT "\' bytes unread when getting the \'${name}\' TLV", offset);\n' '${lp}}\n' '\n' @@ -358,7 +358,7 @@ class Field: template = ( '\n' - ' if ((offset = __qmi_message_tlv_read_remaining_size (message, init_offset, offset)) > 0)\n' + ' if ((offset = qmi_int_message_tlv_read_remaining_size (message, init_offset, offset)) > 0)\n' ' g_string_append_printf (printable, "Additional unexpected \'%" G_GSIZE_FORMAT "\' bytes", offset);\n' '\n' 'out:\n' diff --git a/build-aux/qmi-codegen/Message.py b/build-aux/qmi-codegen/Message.py index 7060006..76e1b39 100644 --- a/build-aux/qmi-codegen/Message.py +++ b/build-aux/qmi-codegen/Message.py @@ -93,7 +93,7 @@ class Message: template = ( '\n' 'static QmiMessage *\n' - '__${underscore}_request_create (\n' + '${underscore}_request_create (\n' ' guint8 transaction_id,\n' ' guint8 cid,\n' ' %s,\n' @@ -193,7 +193,7 @@ class Message: template = ( '\n' 'static ${container} *\n' - '__${underscore}_${type}_parse (\n' + '${underscore}_${type}_parse (\n' ' QmiMessage *message,\n' ' GError **error)\n' '{\n' @@ -329,7 +329,7 @@ class Message: ' } else {\n' ' gchar *value_hex;\n' '\n' - ' value_hex = __qmi_utils_str_hex (value, length, \':\');\n' + ' value_hex = qmi_int_utils_str_hex (value, length, \':\');\n' ' g_string_append_printf (ctx->printable,\n' ' "%sTLV:\\n"\n' ' "%s type = \\"%s\\" (0x%02x)\\n"\n' diff --git a/build-aux/qmi-codegen/MessageList.py b/build-aux/qmi-codegen/MessageList.py index c3207d5..1cdba74 100644 --- a/build-aux/qmi-codegen/MessageList.py +++ b/build-aux/qmi-codegen/MessageList.py @@ -116,7 +116,7 @@ class MessageList: '#if defined (LIBQMI_GLIB_COMPILATION)\n' '\n' 'G_GNUC_INTERNAL\n' - 'gchar *__qmi_message_${service}_get_printable (\n' + 'gchar *qmi_int_message_${service}_get_printable (\n' ' QmiMessage *self,\n' ' const gchar *line_prefix);\n' '\n' @@ -126,8 +126,9 @@ class MessageList: template = ( '\n' + '/* Internal */\n' 'gchar *\n' - '__qmi_message_${service}_get_printable (\n' + 'qmi_int_message_${service}_get_printable (\n' ' QmiMessage *self,\n' ' const gchar *line_prefix)\n' '{\n' @@ -182,7 +183,7 @@ class MessageList: '#if defined (LIBQMI_GLIB_COMPILATION)\n' '\n' 'G_GNUC_INTERNAL\n' - 'gboolean __qmi_message_${service}_get_version_introduced (\n' + 'gboolean qmi_int_message_${service}_get_version_introduced (\n' ' QmiMessage *self,\n' ' guint *major,\n' ' guint *minor);\n' @@ -193,8 +194,9 @@ class MessageList: template = ( '\n' + '/* Internal */\n' 'gboolean\n' - '__qmi_message_${service}_get_version_introduced (\n' + 'qmi_int_message_${service}_get_version_introduced (\n' ' QmiMessage *self,\n' ' guint *major,\n' ' guint *minor)\n' diff --git a/build-aux/qmi-codegen/VariableInteger.py b/build-aux/qmi-codegen/VariableInteger.py index 060548d..3a56df9 100644 --- a/build-aux/qmi-codegen/VariableInteger.py +++ b/build-aux/qmi-codegen/VariableInteger.py @@ -219,9 +219,9 @@ class VariableInteger(Variable): translations['public_type_underscore'] = utils.build_underscore_name_from_camelcase(self.public_format) translations['public_type_underscore_upper'] = utils.build_underscore_name_from_camelcase(self.public_format).upper() template += ( - '#if defined __${public_type_underscore_upper}_IS_ENUM__\n' + '#if defined LIBQMI_GLIB_${public_type_underscore_upper}_IS_ENUM\n' '${lp} g_string_append_printf (printable, "%s", ${public_type_underscore}_get_string ((${public_format})tmp));\n' - '#elif defined __${public_type_underscore_upper}_IS_FLAGS__\n' + '#elif defined LIBQMI_GLIB_${public_type_underscore_upper}_IS_FLAGS\n' '${lp} {\n' '${lp} gchar *flags_str;\n' '\n' diff --git a/build-aux/qmi-codegen/utils.py b/build-aux/qmi-codegen/utils.py index 7754fb6..e0d3172 100644 --- a/build-aux/qmi-codegen/utils.py +++ b/build-aux/qmi-codegen/utils.py @@ -55,7 +55,7 @@ def add_copyright(f): Build a header guard string based on the given filename """ def build_header_guard(output_name): - return "__LIBQMI_GLIB_" + output_name.replace('-', '_').upper() + "__" + return "LIBQMI_GLIB_" + output_name.replace('-', '_').upper() """ Write the common header start chunk diff --git a/build-aux/templates/qmi-enum-types-template.c b/build-aux/templates/qmi-enum-types-template.c index 635147f..d1eef4e 100644 --- a/build-aux/templates/qmi-enum-types-template.c +++ b/build-aux/templates/qmi-enum-types-template.c @@ -36,7 +36,7 @@ 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__ +#if defined LIBQMI_GLIB_@ENUMNAME@_IS_ENUM /** * @enum_name@_get_string: * @val: a @EnumName@. @@ -57,13 +57,13 @@ const gchar * return NULL; } -#endif /* __@ENUMNAME@_IS_ENUM__ */ +#endif /* LIBQMI_GLIB_@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__ +#if defined LIBQMI_GLIB_@ENUMNAME@_IS_FLAGS /** * @enum_name@_build_string_from_mask: * @mask: bitmask of @EnumName@ values. @@ -110,7 +110,7 @@ gchar * return (str ? g_string_free (str, FALSE) : NULL); } -#endif /* __@ENUMNAME@_IS_FLAGS__ */ +#endif /* LIBQMI_GLIB_@ENUMNAME@_IS_FLAGS */ /*** END value-tail ***/ diff --git a/build-aux/templates/qmi-enum-types-template.h b/build-aux/templates/qmi-enum-types-template.h index 31e0732..bd4f3b1 100644 --- a/build-aux/templates/qmi-enum-types-template.h +++ b/build-aux/templates/qmi-enum-types-template.h @@ -15,13 +15,13 @@ 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@__ +#define LIBQMI_GLIB_@ENUMNAME@_IS_@TYPE@ -#if defined __@ENUMNAME@_IS_ENUM__ +#if defined LIBQMI_GLIB_@ENUMNAME@_IS_ENUM const gchar *@enum_name@_get_string (@EnumName@ val); #endif -#if defined __@ENUMNAME@_IS_FLAGS__ +#if defined LIBQMI_GLIB_@ENUMNAME@_IS_FLAGS gchar *@enum_name@_build_string_from_mask (@EnumName@ mask); #endif diff --git a/build-aux/templates/qmi-flags64-types-template.h b/build-aux/templates/qmi-flags64-types-template.h index 981d0e1..99157cf 100644 --- a/build-aux/templates/qmi-flags64-types-template.h +++ b/build-aux/templates/qmi-flags64-types-template.h @@ -12,9 +12,9 @@ G_BEGIN_DECLS /*** BEGIN value-header ***/ -#define __@ENUMNAME@_IS_@TYPE@__ +#define LIBQMI_GLIB_@ENUMNAME@_IS_@TYPE@ -#if defined __@ENUMNAME@_IS_ENUM__ +#if defined LIBQMI_GLIB_@ENUMNAME@_IS_ENUM #error Only flags expected, @EnumName@ is an enumeration #endif diff --git a/docs/reference/libqmi-glib/libqmi-glib-common.sections b/docs/reference/libqmi-glib/libqmi-glib-common.sections index ca964b7..7ad125e 100644 --- a/docs/reference/libqmi-glib/libqmi-glib-common.sections +++ b/docs/reference/libqmi-glib/libqmi-glib-common.sections @@ -5,6 +5,8 @@ QMI_MAJOR_VERSION QMI_MINOR_VERSION QMI_MICRO_VERSION QMI_CHECK_VERSION + +LIBQMI_GLIB_H_INSIDE
@@ -88,6 +90,8 @@ qmi_device_release_client_flags_get_type qmi_device_open_flags_get_string qmi_device_release_client_flags_get_string +LIBQMI_GLIB_QMI_DEVICE_OPEN_FLAGS_IS_FLAGS +LIBQMI_GLIB_QMI_DEVICE_RELEASE_CLIENT_FLAGS_IS_FLAGS
@@ -117,6 +121,7 @@ QmiService qmi_service_get_string qmi_service_build_string_from_mask +LIBQMI_GLIB_QMI_SERVICE_IS_ENUM QMI_TYPE_SERVICE qmi_service_get_type @@ -175,6 +180,23 @@ 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 +LIBQMI_GLIB_QMI_DMS_ACTIVATION_STATE_IS_ENUM +LIBQMI_GLIB_QMI_DMS_BAND_CAPABILITY_IS_FLAGS +LIBQMI_GLIB_QMI_DMS_DATA_SERVICE_CAPABILITY_IS_ENUM +LIBQMI_GLIB_QMI_DMS_FIRMWARE_IMAGE_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_DMS_LTE_BAND_CAPABILITY_IS_FLAGS +LIBQMI_GLIB_QMI_DMS_OFFLINE_REASON_IS_FLAGS +LIBQMI_GLIB_QMI_DMS_OPERATING_MODE_IS_ENUM +LIBQMI_GLIB_QMI_DMS_POWER_STATE_IS_FLAGS +LIBQMI_GLIB_QMI_DMS_RADIO_INTERFACE_IS_ENUM +LIBQMI_GLIB_QMI_DMS_SIM_CAPABILITY_IS_ENUM +LIBQMI_GLIB_QMI_DMS_TIME_REFERENCE_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_DMS_TIME_SOURCE_IS_ENUM +LIBQMI_GLIB_QMI_DMS_UIM_FACILITY_IS_ENUM +LIBQMI_GLIB_QMI_DMS_UIM_FACILITY_STATE_IS_ENUM +LIBQMI_GLIB_QMI_DMS_UIM_PIN_ID_IS_ENUM +LIBQMI_GLIB_QMI_DMS_UIM_PIN_STATUS_IS_ENUM +LIBQMI_GLIB_QMI_DMS_UIM_STATE_IS_ENUM QMI_TYPE_DMS_ACTIVATION_STATE QMI_TYPE_DMS_DATA_SERVICE_CAPABILITY @@ -327,6 +349,45 @@ 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 +LIBQMI_GLIB_QMI_NAS_ACTIVE_BAND_IS_ENUM +LIBQMI_GLIB_QMI_NAS_ATTACH_STATE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_BAND_PREFERENCE_IS_FLAGS +LIBQMI_GLIB_QMI_NAS_CALL_BARRING_STATUS_IS_ENUM +LIBQMI_GLIB_QMI_NAS_CDMA_PILOT_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_CDMA_PRL_PREFERENCE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_CELL_BROADCAST_CAPABILITY_IS_ENUM +LIBQMI_GLIB_QMI_NAS_CHANGE_DURATION_IS_ENUM +LIBQMI_GLIB_QMI_NAS_DATA_CAPABILITY_IS_ENUM +LIBQMI_GLIB_QMI_NAS_DAYLIGHT_SAVINGS_ADJUSTMENT_IS_ENUM +LIBQMI_GLIB_QMI_NAS_DAY_OF_WEEK_IS_ENUM +LIBQMI_GLIB_QMI_NAS_EVDO_SINR_LEVEL_IS_ENUM +LIBQMI_GLIB_QMI_NAS_GSM_WCDMA_ACQUISITION_ORDER_PREFERENCE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_HDR_PERSONALITY_IS_ENUM +LIBQMI_GLIB_QMI_NAS_HDR_PROTOCOL_REVISION_IS_ENUM +LIBQMI_GLIB_QMI_NAS_LTE_BAND_PREFERENCE_IS_FLAGS +LIBQMI_GLIB_QMI_NAS_NETWORK_DESCRIPTION_DISPLAY_IS_ENUM +LIBQMI_GLIB_QMI_NAS_NETWORK_DESCRIPTION_ENCODING_IS_ENUM +LIBQMI_GLIB_QMI_NAS_NETWORK_REGISTER_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_NETWORK_SCAN_TYPE_IS_FLAGS +LIBQMI_GLIB_QMI_NAS_NETWORK_SELECTION_PREFERENCE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_NETWORK_SERVICE_DOMAIN_IS_ENUM +LIBQMI_GLIB_QMI_NAS_NETWORK_STATUS_IS_FLAGS +LIBQMI_GLIB_QMI_NAS_NETWORK_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_PREFERENCE_DURATION_IS_ENUM +LIBQMI_GLIB_QMI_NAS_RADIO_INTERFACE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_IS_FLAGS +LIBQMI_GLIB_QMI_NAS_RAT_MODE_PREFERENCE_IS_FLAGS +LIBQMI_GLIB_QMI_NAS_REGISTRATION_STATE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_ROAMING_INDICATOR_STATUS_IS_ENUM +LIBQMI_GLIB_QMI_NAS_ROAMING_PREFERENCE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_ROAMING_STATUS_IS_ENUM +LIBQMI_GLIB_QMI_NAS_SERVICE_DOMAIN_PREFERENCE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_SERVICE_STATUS_IS_ENUM +LIBQMI_GLIB_QMI_NAS_SIGNAL_STRENGTH_REQUEST_IS_FLAGS +LIBQMI_GLIB_QMI_NAS_SIM_REJECT_STATE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_TD_SCDMA_BAND_PREFERENCE_IS_FLAGS +LIBQMI_GLIB_QMI_NAS_WCDMA_HS_SERVICE_IS_ENUM +LIBQMI_GLIB_QMI_NAS_WCDMA_RRC_STATE_IS_ENUM QMI_TYPE_NAS_ACTIVE_BAND QMI_TYPE_NAS_ATTACH_STATE @@ -502,6 +563,37 @@ 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 +LIBQMI_GLIB_QMI_WDS_AUTHENTICATION_IS_FLAGS +LIBQMI_GLIB_QMI_WDS_CALL_END_REASON_IS_ENUM +LIBQMI_GLIB_QMI_WDS_CALL_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_WDS_CONNECTION_STATUS_IS_ENUM +LIBQMI_GLIB_QMI_WDS_DATA_BEARER_TECHNOLOGY_IS_ENUM +LIBQMI_GLIB_QMI_WDS_DELIVERY_ORDER_IS_ENUM +LIBQMI_GLIB_QMI_WDS_DS_PROFILE_ERROR_IS_ENUM +LIBQMI_GLIB_QMI_WDS_EXTENDED_TECHNOLOGY_PREFERENCE_IS_ENUM +LIBQMI_GLIB_QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_IS_FLAGS +LIBQMI_GLIB_QMI_WDS_IP_FAMILY_IS_ENUM +LIBQMI_GLIB_QMI_WDS_NETWORK_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_WDS_PACKET_STATISTICS_MASK_FLAG_IS_FLAGS +LIBQMI_GLIB_QMI_WDS_PDP_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_WDS_PROFILE_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_WDS_RAT_3GPP2_IS_FLAGS +LIBQMI_GLIB_QMI_WDS_RAT_3GPP_IS_FLAGS +LIBQMI_GLIB_QMI_WDS_SDU_ERRONEOUS_DELIVERY_IS_ENUM +LIBQMI_GLIB_QMI_WDS_SDU_ERROR_RATIO_IS_ENUM +LIBQMI_GLIB_QMI_WDS_SDU_RESIDUAL_BIT_ERROR_RATIO_IS_ENUM +LIBQMI_GLIB_QMI_WDS_SO_CDMA1X_IS_FLAGS +LIBQMI_GLIB_QMI_WDS_SO_EVDO_REVA_IS_FLAGS +LIBQMI_GLIB_QMI_WDS_TECHNOLOGY_PREFERENCE_IS_FLAGS +LIBQMI_GLIB_QMI_WDS_TRAFFIC_CLASS_IS_ENUM +LIBQMI_GLIB_QMI_WDS_VERBOSE_CALL_END_REASON_3GPP_IS_ENUM +LIBQMI_GLIB_QMI_WDS_VERBOSE_CALL_END_REASON_CM_IS_ENUM +LIBQMI_GLIB_QMI_WDS_VERBOSE_CALL_END_REASON_EHRPD_IS_ENUM +LIBQMI_GLIB_QMI_WDS_VERBOSE_CALL_END_REASON_INTERNAL_IS_ENUM +LIBQMI_GLIB_QMI_WDS_VERBOSE_CALL_END_REASON_IPV6_IS_ENUM +LIBQMI_GLIB_QMI_WDS_VERBOSE_CALL_END_REASON_MIP_IS_ENUM +LIBQMI_GLIB_QMI_WDS_VERBOSE_CALL_END_REASON_PPP_IS_ENUM +LIBQMI_GLIB_QMI_WDS_VERBOSE_CALL_END_REASON_TYPE_IS_ENUM QMI_TYPE_WDS_AUTHENTICATION QMI_TYPE_WDS_CALL_END_REASON @@ -622,6 +714,23 @@ 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 +LIBQMI_GLIB_QMI_WMS_ACK_INDICATOR_IS_ENUM +LIBQMI_GLIB_QMI_WMS_CDMA_CAUSE_CODE_IS_ENUM +LIBQMI_GLIB_QMI_WMS_CDMA_ERROR_CLASS_IS_ENUM +LIBQMI_GLIB_QMI_WMS_CDMA_SERVICE_OPTION_IS_ENUM +LIBQMI_GLIB_QMI_WMS_GSM_UMTS_RP_CAUSE_IS_ENUM +LIBQMI_GLIB_QMI_WMS_GSM_UMTS_TP_CAUSE_IS_ENUM +LIBQMI_GLIB_QMI_WMS_MESSAGE_CLASS_IS_ENUM +LIBQMI_GLIB_QMI_WMS_MESSAGE_DELIVERY_FAILURE_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_WMS_MESSAGE_FORMAT_IS_ENUM +LIBQMI_GLIB_QMI_WMS_MESSAGE_MODE_IS_ENUM +LIBQMI_GLIB_QMI_WMS_MESSAGE_PROTOCOL_IS_ENUM +LIBQMI_GLIB_QMI_WMS_MESSAGE_TAG_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_WMS_MESSAGE_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_WMS_NOTIFICATION_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_WMS_RECEIPT_ACTION_IS_ENUM +LIBQMI_GLIB_QMI_WMS_STORAGE_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_WMS_TRANSFER_INDICATION_IS_ENUM QMI_TYPE_WMS_ACK_INDICATOR QMI_TYPE_WMS_CDMA_CAUSE_CODE @@ -681,6 +790,12 @@ 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 +LIBQMI_GLIB_QMI_PDS_DATA_VALID_IS_FLAGS +LIBQMI_GLIB_QMI_PDS_NETWORK_MODE_IS_ENUM +LIBQMI_GLIB_QMI_PDS_OPERATING_MODE_IS_ENUM +LIBQMI_GLIB_QMI_PDS_OPERATION_MODE_IS_ENUM +LIBQMI_GLIB_QMI_PDS_POSITION_SESSION_STATUS_IS_ENUM +LIBQMI_GLIB_QMI_PDS_TRACKING_SESSION_STATE_IS_ENUM QMI_TYPE_PDS_DATA_VALID QMI_TYPE_PDS_OPERATION_MODE @@ -709,6 +824,9 @@ qmi_pbm_session_type_get_string qmi_pbm_event_registration_flag_get_string qmi_pbm_phonebook_type_get_string qmi_pbm_session_type_build_string_from_mask +LIBQMI_GLIB_QMI_PBM_EVENT_REGISTRATION_FLAG_IS_FLAGS +LIBQMI_GLIB_QMI_PBM_PHONEBOOK_TYPE_IS_FLAGS +LIBQMI_GLIB_QMI_PBM_SESSION_TYPE_IS_ENUM QMI_TYPE_PBM_EVENT_REGISTRATION_FLAG QMI_TYPE_PBM_PHONEBOOK_TYPE @@ -755,6 +873,17 @@ 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 +LIBQMI_GLIB_QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_IS_ENUM +LIBQMI_GLIB_QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_IS_ENUM +LIBQMI_GLIB_QMI_UIM_CARD_APPLICATION_STATE_IS_ENUM +LIBQMI_GLIB_QMI_UIM_CARD_APPLICATION_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_UIM_CARD_ERROR_IS_ENUM +LIBQMI_GLIB_QMI_UIM_CARD_STATE_IS_ENUM +LIBQMI_GLIB_QMI_UIM_FILE_TYPE_IS_ENUM +LIBQMI_GLIB_QMI_UIM_PIN_STATE_IS_ENUM +LIBQMI_GLIB_QMI_UIM_SECURITY_ATTRIBUTE_IS_FLAGS +LIBQMI_GLIB_QMI_UIM_SECURITY_ATTRIBUTE_LOGIC_IS_ENUM +LIBQMI_GLIB_QMI_UIM_SESSION_TYPE_IS_ENUM QMI_TYPE_UIM_SESSION_TYPE QMI_TYPE_UIM_FILE_TYPE @@ -796,6 +925,10 @@ 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 +LIBQMI_GLIB_QMI_OMA_HFA_FEATURE_DONE_STATE_IS_ENUM +LIBQMI_GLIB_QMI_OMA_SESSION_FAILED_REASON_IS_ENUM +LIBQMI_GLIB_QMI_OMA_SESSION_STATE_IS_ENUM +LIBQMI_GLIB_QMI_OMA_SESSION_TYPE_IS_ENUM QMI_TYPE_OMA_SESSION_TYPE QMI_TYPE_OMA_SESSION_STATE @@ -817,6 +950,8 @@ qmi_wda_data_aggregation_protocol_get_string qmi_wda_link_layer_protocol_build_string_from_mask qmi_wda_data_aggregation_protocol_build_string_from_mask +LIBQMI_GLIB_QMI_WDA_DATA_AGGREGATION_PROTOCOL_IS_ENUM +LIBQMI_GLIB_QMI_WDA_LINK_LAYER_PROTOCOL_IS_ENUM QMI_TYPE_WDA_LINK_LAYER_PROTOCOL QMI_TYPE_WDA_DATA_AGGREGATION_PROTOCOL @@ -904,6 +1039,8 @@ qmi_message_set_transaction_id qmi_message_get_printable qmi_message_get_tlv_printable + +qmi_int_message_tlv_read_remaining_size
@@ -937,4 +1074,7 @@ qmi_utils_write_gint64_to_buffer qmi_utils_write_sized_guint_to_buffer qmi_utils_write_string_to_buffer qmi_utils_write_fixed_size_string_to_buffer + +qmi_int_utils_user_allowed +qmi_int_utils_str_hex
diff --git a/src/libqmi-glib/generated/Makefile.am b/src/libqmi-glib/generated/Makefile.am index b803b5e..3968b19 100644 --- a/src/libqmi-glib/generated/Makefile.am +++ b/src/libqmi-glib/generated/Makefile.am @@ -49,9 +49,9 @@ GENERATED_SECTIONS = \ # Error types qmi-error-types.h: $(top_srcdir)/src/libqmi-glib/qmi-errors.h $(top_srcdir)/build-aux/templates/qmi-error-types-template.h $(AM_V_GEN) $(GLIB_MKENUMS) \ - --fhead "#ifndef __LIBQMI_GLIB_ERROR_TYPES_H__\n#define __LIBQMI_GLIB_ERROR_TYPES_H__\n#include \"qmi-errors.h\"\n" \ + --fhead "#ifndef LIBQMI_GLIB_ERROR_TYPES_H\n#define LIBQMI_GLIB_ERROR_TYPES_H\n#include \"qmi-errors.h\"\n" \ --template $(top_srcdir)/build-aux/templates/qmi-error-types-template.h \ - --ftail "#endif /* __LIBQMI_GLIB_ERROR_TYPES_H__ */\n" \ + --ftail "#endif /* LIBQMI_GLIB_ERROR_TYPES_H */\n" \ $(top_srcdir)/src/libqmi-glib/qmi-errors.h > $@ qmi-error-types.c: $(top_srcdir)/src/libqmi-glib/qmi-errors.h qmi-error-types.h $(top_srcdir)/build-aux/templates/qmi-error-types-template.c @@ -81,9 +81,9 @@ ENUMS = \ $(top_srcdir)/src/libqmi-glib/qmi-device.h qmi-enum-types.h: $(ENUMS) $(top_srcdir)/build-aux/templates/qmi-enum-types-template.h $(AM_V_GEN) $(GLIB_MKENUMS) \ - --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-pbm.h\"\n#include \"qmi-enums-uim.h\"\n#include \"qmi-enums-oma.h\"\n#include \"qmi-enums-wda.h\"\n#include \"qmi-device.h\"\n" \ + --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-pbm.h\"\n#include \"qmi-enums-uim.h\"\n#include \"qmi-enums-oma.h\"\n#include \"qmi-enums-wda.h\"\n#include \"qmi-device.h\"\n" \ --template $(top_srcdir)/build-aux/templates/qmi-enum-types-template.h \ - --ftail "#endif /* __LIBQMI_GLIB_ENUM_TYPES_H__ */\n" \ + --ftail "#endif /* LIBQMI_GLIB_ENUM_TYPES_H */\n" \ $(ENUMS) > $@ qmi-enum-types.c: $(ENUMS) qmi-enum-types.h $(top_srcdir)/build-aux/templates/qmi-enum-types-template.c @@ -97,9 +97,9 @@ PRIVATE_ENUMS = \ $(top_srcdir)/src/libqmi-glib/qmi-enums-private.h qmi-enum-types-private.h: $(PRIVATE_ENUMS) $(top_srcdir)/build-aux/templates/qmi-enum-types-template.h $(AM_V_GEN) $(GLIB_MKENUMS) \ - --fhead "#ifndef __LIBQMI_GLIB_ENUM_TYPES_PRIVATE_H__\n#define __LIBQMI_GLIB_ENUM_TYPES_PRIVATE_H__\n#include \"qmi-enums-private.h\"\n" \ + --fhead "#ifndef LIBQMI_GLIB_ENUM_TYPES_PRIVATE_H\n#define LIBQMI_GLIB_ENUM_TYPES_PRIVATE_H\n#include \"qmi-enums-private.h\"\n" \ --template $(top_srcdir)/build-aux/templates/qmi-enum-types-template.h \ - --ftail "#endif /* __LIBQMI_GLIB_ENUM_TYPES_PRIVATE_H__ */\n" \ + --ftail "#endif /* LIBQMI_GLIB_ENUM_TYPES_PRIVATE_H */\n" \ $(PRIVATE_ENUMS) > $@ qmi-enum-types-private.c: $(PRIVATE_ENUMS) qmi-enum-types-private.h $(top_srcdir)/build-aux/templates/qmi-enum-types-template.c @@ -112,9 +112,9 @@ qmi-enum-types-private.c: $(PRIVATE_ENUMS) qmi-enum-types-private.h $(top_srcdir FLAGS64 = $(top_srcdir)/src/libqmi-glib/qmi-flags64-dms.h $(top_srcdir)/src/libqmi-glib/qmi-flags64-nas.h qmi-flags64-types.h: $(FLAGS64) $(top_srcdir)/build-aux/templates/qmi-flags64-types-template.h $(AM_V_GEN) $(GLIB_MKENUMS) \ - --fhead "#ifndef __LIBQMI_GLIB_FLAGS64_TYPES_H__\n#define __LIBQMI_GLIB_FLAGS64_TYPES_H__\n#include \"qmi-flags64-dms.h\"\n#include \"qmi-flags64-nas.h\"\n" \ + --fhead "#ifndef LIBQMI_GLIB_FLAGS64_TYPES_H\n#define LIBQMI_GLIB_FLAGS64_TYPES_H\n#include \"qmi-flags64-dms.h\"\n#include \"qmi-flags64-nas.h\"\n" \ --template $(top_srcdir)/build-aux/templates/qmi-flags64-types-template.h \ - --ftail "#endif /* __LIBQMI_GLIB_FLAGS64_TYPES_H__ */\n" \ + --ftail "#endif /* LIBQMI_GLIB_FLAGS64_TYPES_H */\n" \ $(FLAGS64) > $@ qmi-flags64-types.c: $(FLAGS64) qmi-flags64-types.h $(top_srcdir)/build-aux/templates/qmi-flags64-types-template.c diff --git a/src/libqmi-glib/libqmi-glib.h b/src/libqmi-glib/libqmi-glib.h index fac1a15..1754827 100644 --- a/src/libqmi-glib/libqmi-glib.h +++ b/src/libqmi-glib/libqmi-glib.h @@ -21,10 +21,10 @@ * Copyright (C) 2012 Google, Inc. */ -#ifndef _LIBQMI_GLIB_H_ -#define _LIBQMI_GLIB_H_ +#ifndef LIBQMI_GLIB_H +#define LIBQMI_GLIB_H -#define __LIBQMI_GLIB_H_INSIDE__ +#define LIBQMI_GLIB_H_INSIDE /* libqmi-glib headers */ @@ -70,4 +70,4 @@ #include "qmi-enum-types.h" #include "qmi-flags64-types.h" -#endif /* _LIBQMI_GLIB_H_ */ +#endif /* LIBQMI_GLIB_H */ diff --git a/src/libqmi-glib/qmi-client.h b/src/libqmi-glib/qmi-client.h index 1305f15..79bf716 100644 --- a/src/libqmi-glib/qmi-client.h +++ b/src/libqmi-glib/qmi-client.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Aleksander Morgado */ -#ifndef _LIBQMI_GLIB_QMI_CLIENT_H_ -#define _LIBQMI_GLIB_QMI_CLIENT_H_ +#ifndef LIBQMI_GLIB_QMI_CLIENT_H +#define LIBQMI_GLIB_QMI_CLIENT_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -96,4 +96,4 @@ void qmi_client_process_indication (QmiClient *self, G_END_DECLS -#endif /* _LIBQMI_GLIB_QMI_CLIENT_H_ */ +#endif /* LIBQMI_GLIB_QMI_CLIENT_H */ diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c index d50c5b9..0da58ac 100644 --- a/src/libqmi-glib/qmi-device.c +++ b/src/libqmi-glib/qmi-device.c @@ -1256,9 +1256,9 @@ process_message (QmiDevice *self, if (qmi_utils_get_traces_enabled ()) { gchar *printable; - printable = __qmi_utils_str_hex (((GByteArray *)message)->data, - ((GByteArray *)message)->len, - ':'); + printable = qmi_int_utils_str_hex (((GByteArray *)message)->data, + ((GByteArray *)message)->len, + ':'); g_debug ("[%s] Received message...\n" ">>>>>> RAW:\n" ">>>>>> length = %u\n" @@ -2215,9 +2215,9 @@ qmi_device_command (QmiDevice *self, if (qmi_utils_get_traces_enabled ()) { gchar *printable; - printable = __qmi_utils_str_hex (((GByteArray *)message)->data, - ((GByteArray *)message)->len, - ':'); + printable = qmi_int_utils_str_hex (((GByteArray *)message)->data, + ((GByteArray *)message)->len, + ':'); g_debug ("[%s] Sent message...\n" "<<<<<< RAW:\n" "<<<<<< length = %u\n" diff --git a/src/libqmi-glib/qmi-device.h b/src/libqmi-glib/qmi-device.h index cef7c50..01df17a 100644 --- a/src/libqmi-glib/qmi-device.h +++ b/src/libqmi-glib/qmi-device.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Aleksander Morgado */ -#ifndef _LIBQMI_GLIB_QMI_DEVICE_H_ -#define _LIBQMI_GLIB_QMI_DEVICE_H_ +#ifndef LIBQMI_GLIB_QMI_DEVICE_H +#define LIBQMI_GLIB_QMI_DEVICE_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -202,4 +202,4 @@ GArray *qmi_device_get_service_version_info_finish (QmiDevice *self, G_END_DECLS -#endif /* _LIBQMI_GLIB_QMI_DEVICE_H_ */ +#endif /* LIBQMI_GLIB_QMI_DEVICE_H */ diff --git a/src/libqmi-glib/qmi-enums-dms.h b/src/libqmi-glib/qmi-enums-dms.h index 3476c4d..a7c6ae1 100644 --- a/src/libqmi-glib/qmi-enums-dms.h +++ b/src/libqmi-glib/qmi-enums-dms.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Lanedo GmbH */ -#ifndef _LIBQMI_GLIB_QMI_ENUMS_DMS_H_ -#define _LIBQMI_GLIB_QMI_ENUMS_DMS_H_ +#ifndef LIBQMI_GLIB_QMI_ENUMS_DMS_H +#define LIBQMI_GLIB_QMI_ENUMS_DMS_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -338,4 +338,4 @@ typedef enum { QMI_DMS_FIRMWARE_IMAGE_TYPE_PRI = 1 } QmiDmsFirmwareImageType; -#endif /* _LIBQMI_GLIB_QMI_ENUMS_DMS_H_ */ +#endif /* LIBQMI_GLIB_QMI_ENUMS_DMS_H */ diff --git a/src/libqmi-glib/qmi-enums-nas.h b/src/libqmi-glib/qmi-enums-nas.h index 5bac29f..db011e2 100644 --- a/src/libqmi-glib/qmi-enums-nas.h +++ b/src/libqmi-glib/qmi-enums-nas.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Google Inc. */ -#ifndef _LIBQMI_GLIB_QMI_ENUMS_NAS_H_ -#define _LIBQMI_GLIB_QMI_ENUMS_NAS_H_ +#ifndef LIBQMI_GLIB_QMI_ENUMS_NAS_H +#define LIBQMI_GLIB_QMI_ENUMS_NAS_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -893,4 +893,4 @@ typedef enum { QMI_NAS_WCDMA_RRC_STATE_CELL_DCH = 4 } QmiNasWcdmaRrcState; -#endif /* _LIBQMI_GLIB_QMI_ENUMS_NAS_H_ */ +#endif /* LIBQMI_GLIB_QMI_ENUMS_NAS_H */ diff --git a/src/libqmi-glib/qmi-enums-oma.h b/src/libqmi-glib/qmi-enums-oma.h index 6d4e826..94cf426 100644 --- a/src/libqmi-glib/qmi-enums-oma.h +++ b/src/libqmi-glib/qmi-enums-oma.h @@ -20,10 +20,10 @@ * Copyright (C) 2013 Google Inc. */ -#ifndef _LIBQMI_GLIB_QMI_ENUMS_OMA_H_ -#define _LIBQMI_GLIB_QMI_ENUMS_OMA_H_ +#ifndef LIBQMI_GLIB_QMI_ENUMS_OMA_H +#define LIBQMI_GLIB_QMI_ENUMS_OMA_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -121,4 +121,4 @@ typedef enum { QMI_OMA_HFA_FEATURE_DONE_STATE_FAILED = 2 } QmiOmaHfaFeatureDoneState; -#endif /* _LIBQMI_GLIB_QMI_ENUMS_OMA_H_ */ +#endif /* LIBQMI_GLIB_QMI_ENUMS_OMA_H */ diff --git a/src/libqmi-glib/qmi-enums-pbm.h b/src/libqmi-glib/qmi-enums-pbm.h index 2b10872..b67dba7 100644 --- a/src/libqmi-glib/qmi-enums-pbm.h +++ b/src/libqmi-glib/qmi-enums-pbm.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Google Inc. */ -#ifndef _LIBQMI_GLIB_QMI_ENUMS_PBM_H_ -#define _LIBQMI_GLIB_QMI_ENUMS_PBM_H_ +#ifndef LIBQMI_GLIB_QMI_ENUMS_PBM_H +#define LIBQMI_GLIB_QMI_ENUMS_PBM_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -109,4 +109,4 @@ typedef enum { QMI_PBM_SESSION_TYPE_GLOBAL_PHONEBOOK_SLOT_2 = 7, } QmiPbmSessionType; -#endif /* _LIBQMI_GLIB_QMI_ENUMS_PBM_H_ */ +#endif /* LIBQMI_GLIB_QMI_ENUMS_PBM_H */ diff --git a/src/libqmi-glib/qmi-enums-pds.h b/src/libqmi-glib/qmi-enums-pds.h index d9ced54..9d6ac61 100644 --- a/src/libqmi-glib/qmi-enums-pds.h +++ b/src/libqmi-glib/qmi-enums-pds.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Google Inc. */ -#ifndef _LIBQMI_GLIB_QMI_ENUMS_PDS_H_ -#define _LIBQMI_GLIB_QMI_ENUMS_PDS_H_ +#ifndef LIBQMI_GLIB_QMI_ENUMS_PDS_H +#define LIBQMI_GLIB_QMI_ENUMS_PDS_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -183,4 +183,4 @@ typedef enum { QMI_PDS_NETWORK_MODE_CDMA = 1, } QmiPdsNetworkMode; -#endif /* _LIBQMI_GLIB_QMI_ENUMS_PDS_H_ */ +#endif /* LIBQMI_GLIB_QMI_ENUMS_PDS_H */ diff --git a/src/libqmi-glib/qmi-enums-private.h b/src/libqmi-glib/qmi-enums-private.h index 21afead..7b2c54c 100644 --- a/src/libqmi-glib/qmi-enums-private.h +++ b/src/libqmi-glib/qmi-enums-private.h @@ -20,8 +20,8 @@ * Copyright (C) 2012 Google Inc. */ -#ifndef _LIBQMI_GLIB_QMI_ENUMS_PRIVATE_H_ -#define _LIBQMI_GLIB_QMI_ENUMS_PRIVATE_H_ +#ifndef LIBQMI_GLIB_QMI_ENUMS_PRIVATE_H +#define LIBQMI_GLIB_QMI_ENUMS_PRIVATE_H /*****************************************************************************/ /* QMI Control */ @@ -82,4 +82,4 @@ typedef enum { QMI_SERVICE_FLAG_INDICATION = 1 << 2 } QmiServiceFlag; -#endif /* _LIBQMI_GLIB_QMI_ENUMS_PRIVATE_H_ */ +#endif /* LIBQMI_GLIB_QMI_ENUMS_PRIVATE_H */ diff --git a/src/libqmi-glib/qmi-enums-uim.h b/src/libqmi-glib/qmi-enums-uim.h index 35b8f73..17f9efc 100644 --- a/src/libqmi-glib/qmi-enums-uim.h +++ b/src/libqmi-glib/qmi-enums-uim.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Google Inc. */ -#ifndef _LIBQMI_GLIB_QMI_ENUMS_UIM_H_ -#define _LIBQMI_GLIB_QMI_ENUMS_UIM_H_ +#ifndef LIBQMI_GLIB_QMI_ENUMS_UIM_H +#define LIBQMI_GLIB_QMI_ENUMS_UIM_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -278,4 +278,4 @@ typedef enum { QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_UNKNOWN = 11 } QmiUimCardApplicationPersonalizationFeature; -#endif /* _LIBQMI_GLIB_QMI_ENUMS_UIM_H_ */ +#endif /* LIBQMI_GLIB_QMI_ENUMS_UIM_H */ diff --git a/src/libqmi-glib/qmi-enums-wda.h b/src/libqmi-glib/qmi-enums-wda.h index 6f23930..4d4f13b 100644 --- a/src/libqmi-glib/qmi-enums-wda.h +++ b/src/libqmi-glib/qmi-enums-wda.h @@ -20,10 +20,10 @@ * Copyright (C) 2014 Aleksander Morgado */ -#ifndef _LIBQMI_GLIB_QMI_ENUMS_WDA_H_ -#define _LIBQMI_GLIB_QMI_ENUMS_WDA_H_ +#ifndef LIBQMI_GLIB_QMI_ENUMS_WDA_H +#define LIBQMI_GLIB_QMI_ENUMS_WDA_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -69,4 +69,4 @@ typedef enum { QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAP = 0x05, } QmiWdaDataAggregationProtocol; -#endif /* _LIBQMI_GLIB_QMI_ENUMS_WDA_H_ */ +#endif /* LIBQMI_GLIB_QMI_ENUMS_WDA_H */ diff --git a/src/libqmi-glib/qmi-enums-wds.h b/src/libqmi-glib/qmi-enums-wds.h index 1fc9515..9247c49 100644 --- a/src/libqmi-glib/qmi-enums-wds.h +++ b/src/libqmi-glib/qmi-enums-wds.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Lanedo GmbH */ -#ifndef _LIBQMI_GLIB_QMI_ENUMS_WDS_H_ -#define _LIBQMI_GLIB_QMI_ENUMS_WDS_H_ +#ifndef LIBQMI_GLIB_QMI_ENUMS_WDS_H +#define LIBQMI_GLIB_QMI_ENUMS_WDS_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -1101,4 +1101,4 @@ typedef enum { QMI_WDS_DS_PROFILE_ERROR_3GPP2_INVALID_PROFILE_ID = 1101, } QmiWdsDsProfileError; -#endif /* _LIBQMI_GLIB_QMI_ENUMS_WDS_H_ */ +#endif /* LIBQMI_GLIB_QMI_ENUMS_WDS_H */ diff --git a/src/libqmi-glib/qmi-enums-wms.h b/src/libqmi-glib/qmi-enums-wms.h index d2df5bc..a8f03ff 100644 --- a/src/libqmi-glib/qmi-enums-wms.h +++ b/src/libqmi-glib/qmi-enums-wms.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Google Inc. */ -#ifndef _LIBQMI_GLIB_QMI_ENUMS_WMS_H_ -#define _LIBQMI_GLIB_QMI_ENUMS_WMS_H_ +#ifndef LIBQMI_GLIB_QMI_ENUMS_WMS_H +#define LIBQMI_GLIB_QMI_ENUMS_WMS_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -426,4 +426,4 @@ typedef enum { QMI_WMS_TRANSFER_INDICATION_CLIENT = 0x01 } QmiWmsTransferIndication; -#endif /* _LIBQMI_GLIB_QMI_ENUMS_WMS_H_ */ +#endif /* LIBQMI_GLIB_QMI_ENUMS_WMS_H */ diff --git a/src/libqmi-glib/qmi-enums.h b/src/libqmi-glib/qmi-enums.h index 9e9081b..e1e3283 100644 --- a/src/libqmi-glib/qmi-enums.h +++ b/src/libqmi-glib/qmi-enums.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Google, Inc. */ -#ifndef _LIBQMI_GLIB_QMI_ENUMS_H_ -#define _LIBQMI_GLIB_QMI_ENUMS_H_ +#ifndef LIBQMI_GLIB_QMI_ENUMS_H +#define LIBQMI_GLIB_QMI_ENUMS_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -136,4 +136,4 @@ typedef enum { QMI_SERVICE_OMA = 226 } QmiService; -#endif /* _LIBQMI_GLIB_QMI_ENUMS_H_ */ +#endif /* LIBQMI_GLIB_QMI_ENUMS_H */ diff --git a/src/libqmi-glib/qmi-errors.h b/src/libqmi-glib/qmi-errors.h index 9c73d27..7ce6e5c 100644 --- a/src/libqmi-glib/qmi-errors.h +++ b/src/libqmi-glib/qmi-errors.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Aleksander Morgado */ -#ifndef _LIBQMI_GLIB_QMI_ERRORS_H_ -#define _LIBQMI_GLIB_QMI_ERRORS_H_ +#ifndef LIBQMI_GLIB_QMI_ERRORS_H +#define LIBQMI_GLIB_QMI_ERRORS_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -278,4 +278,4 @@ typedef enum { /*< underscore_name=qmi_protocol_error >*/ QMI_PROTOCOL_ERROR_CAT_ENVELOPE_COMMAND_FAILED = 61445 /*< nick=Cat.EnvelopeCommandFailed >*/ } QmiProtocolError; -#endif /* _LIBQMI_GLIB_QMI_ERRORS_H_ */ +#endif /* LIBQMI_GLIB_QMI_ERRORS_H */ diff --git a/src/libqmi-glib/qmi-flags64-dms.h b/src/libqmi-glib/qmi-flags64-dms.h index 23dd67c..9face2a 100644 --- a/src/libqmi-glib/qmi-flags64-dms.h +++ b/src/libqmi-glib/qmi-flags64-dms.h @@ -21,10 +21,10 @@ * Copyright (C) 2012 Google, Inc. */ -#ifndef _LIBQMI_GLIB_QMI_FLAGS64_DMS_H_ -#define _LIBQMI_GLIB_QMI_FLAGS64_DMS_H_ +#ifndef LIBQMI_GLIB_QMI_FLAGS64_DMS_H +#define LIBQMI_GLIB_QMI_FLAGS64_DMS_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -201,4 +201,4 @@ typedef enum { /* Bit 43-64 reserved */ } QmiDmsLteBandCapability; -#endif /* _LIBQMI_GLIB_QMI_FLAGS64_DMS_H_ */ +#endif /* LIBQMI_GLIB_QMI_FLAGS64_DMS_H */ diff --git a/src/libqmi-glib/qmi-flags64-nas.h b/src/libqmi-glib/qmi-flags64-nas.h index b76f8f2..2fc709a 100644 --- a/src/libqmi-glib/qmi-flags64-nas.h +++ b/src/libqmi-glib/qmi-flags64-nas.h @@ -20,10 +20,10 @@ * Copyright (C) 2012 Google Inc. */ -#ifndef _LIBQMI_GLIB_QMI_FLAGS64_NAS_H_ -#define _LIBQMI_GLIB_QMI_FLAGS64_NAS_H_ +#ifndef LIBQMI_GLIB_QMI_FLAGS64_NAS_H +#define LIBQMI_GLIB_QMI_FLAGS64_NAS_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -197,4 +197,4 @@ typedef enum { /* Bit 43-64 reserved */ } QmiNasLteBandPreference; -#endif /* _LIBQMI_GLIB_QMI_FLAGS64_NAS_H_ */ +#endif /* LIBQMI_GLIB_QMI_FLAGS64_NAS_H */ diff --git a/src/libqmi-glib/qmi-message.c b/src/libqmi-glib/qmi-message.c index e31aa4a..3374098 100644 --- a/src/libqmi-glib/qmi-message.c +++ b/src/libqmi-glib/qmi-message.c @@ -1826,10 +1826,11 @@ qmi_message_tlv_read_fixed_size_string (QmiMessage *self, return TRUE; } +/* Internal */ guint16 -__qmi_message_tlv_read_remaining_size (QmiMessage *self, - gsize tlv_offset, - gsize offset) +qmi_int_message_tlv_read_remaining_size (QmiMessage *self, + gsize tlv_offset, + gsize offset) { struct tlv *tlv; @@ -2033,7 +2034,7 @@ qmi_message_get_tlv_printable (QmiMessage *self, g_return_val_if_fail (raw != NULL, NULL); g_return_val_if_fail (raw_length > 0, NULL); - value_hex = __qmi_utils_str_hex (raw, raw_length, ':'); + value_hex = qmi_int_utils_str_hex (raw, raw_length, ':'); printable = g_strdup_printf ("%sTLV:\n" "%s type = 0x%02x\n" "%s length = %" G_GSIZE_FORMAT "\n" @@ -2132,34 +2133,34 @@ qmi_message_get_printable (QmiMessage *self, contents = NULL; switch (qmi_message_get_service (self)) { case QMI_SERVICE_CTL: - contents = __qmi_message_ctl_get_printable (self, line_prefix); + contents = qmi_int_message_ctl_get_printable (self, line_prefix); break; case QMI_SERVICE_DMS: - contents = __qmi_message_dms_get_printable (self, line_prefix); + contents = qmi_int_message_dms_get_printable (self, line_prefix); break; case QMI_SERVICE_WDS: - contents = __qmi_message_wds_get_printable (self, line_prefix); + contents = qmi_int_message_wds_get_printable (self, line_prefix); break; case QMI_SERVICE_NAS: - contents = __qmi_message_nas_get_printable (self, line_prefix); + contents = qmi_int_message_nas_get_printable (self, line_prefix); break; case QMI_SERVICE_WMS: - contents = __qmi_message_wms_get_printable (self, line_prefix); + contents = qmi_int_message_wms_get_printable (self, line_prefix); break; case QMI_SERVICE_PDS: - contents = __qmi_message_pds_get_printable (self, line_prefix); + contents = qmi_int_message_pds_get_printable (self, line_prefix); break; case QMI_SERVICE_PBM: - contents = __qmi_message_pbm_get_printable (self, line_prefix); + contents = qmi_int_message_pbm_get_printable (self, line_prefix); break; case QMI_SERVICE_UIM: - contents = __qmi_message_uim_get_printable (self, line_prefix); + contents = qmi_int_message_uim_get_printable (self, line_prefix); break; case QMI_SERVICE_OMA: - contents = __qmi_message_oma_get_printable (self, line_prefix); + contents = qmi_int_message_oma_get_printable (self, line_prefix); break; case QMI_SERVICE_WDA: - contents = __qmi_message_wda_get_printable (self, line_prefix); + contents = qmi_int_message_wda_get_printable (self, line_prefix); break; default: break; @@ -2196,31 +2197,31 @@ qmi_message_get_version_introduced (QmiMessage *self, return TRUE; case QMI_SERVICE_DMS: - return __qmi_message_dms_get_version_introduced (self, major, minor); + return qmi_int_message_dms_get_version_introduced (self, major, minor); case QMI_SERVICE_WDS: - return __qmi_message_wds_get_version_introduced (self, major, minor); + return qmi_int_message_wds_get_version_introduced (self, major, minor); case QMI_SERVICE_NAS: - return __qmi_message_nas_get_version_introduced (self, major, minor); + return qmi_int_message_nas_get_version_introduced (self, major, minor); case QMI_SERVICE_WMS: - return __qmi_message_wms_get_version_introduced (self, major, minor); + return qmi_int_message_wms_get_version_introduced (self, major, minor); case QMI_SERVICE_PDS: - return __qmi_message_pds_get_version_introduced (self, major, minor); + return qmi_int_message_pds_get_version_introduced (self, major, minor); case QMI_SERVICE_PBM: - return __qmi_message_pbm_get_version_introduced (self, major, minor); + return qmi_int_message_pbm_get_version_introduced (self, major, minor); case QMI_SERVICE_UIM: - return __qmi_message_uim_get_version_introduced (self, major, minor); + return qmi_int_message_uim_get_version_introduced (self, major, minor); case QMI_SERVICE_OMA: - return __qmi_message_oma_get_version_introduced (self, major, minor); + return qmi_int_message_oma_get_version_introduced (self, major, minor); case QMI_SERVICE_WDA: - return __qmi_message_wda_get_version_introduced (self, major, minor); + return qmi_int_message_wda_get_version_introduced (self, major, minor); default: /* For the still unsupported services, cannot do anything */ diff --git a/src/libqmi-glib/qmi-message.h b/src/libqmi-glib/qmi-message.h index 9e2a1dc..04f0d05 100644 --- a/src/libqmi-glib/qmi-message.h +++ b/src/libqmi-glib/qmi-message.h @@ -27,10 +27,10 @@ * Copyright (C) 2012-2014 Aleksander Morgado */ -#ifndef _LIBQMI_GLIB_QMI_MESSAGE_H_ -#define _LIBQMI_GLIB_QMI_MESSAGE_H_ +#ifndef LIBQMI_GLIB_QMI_MESSAGE_H +#define LIBQMI_GLIB_QMI_MESSAGE_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -217,9 +217,9 @@ gboolean qmi_message_tlv_read_fixed_size_string (QmiMessage *self, #if defined (LIBQMI_GLIB_COMPILATION) G_GNUC_INTERNAL -guint16 __qmi_message_tlv_read_remaining_size (QmiMessage *self, - gsize tlv_offset, - gsize offset); +guint16 qmi_int_message_tlv_read_remaining_size (QmiMessage *self, + gsize tlv_offset, + gsize offset); #endif /*****************************************************************************/ @@ -261,4 +261,4 @@ gchar *qmi_message_get_tlv_printable (QmiMessage *self, G_END_DECLS -#endif /* _LIBQMI_GLIB_QMI_MESSAGE_H_ */ +#endif /* LIBQMI_GLIB_QMI_MESSAGE_H */ diff --git a/src/libqmi-glib/qmi-proxy.c b/src/libqmi-glib/qmi-proxy.c index 567f691..e4fb586 100644 --- a/src/libqmi-glib/qmi-proxy.c +++ b/src/libqmi-glib/qmi-proxy.c @@ -645,7 +645,7 @@ incoming_cb (GSocketService *service, g_error_free (error); return; } - if (!__qmi_user_allowed (uid, &error)) { + if (!qmi_int_utils_user_allowed (uid, &error)) { g_warning ("Client not allowed: %s", error->message); g_error_free (error); return; @@ -734,7 +734,7 @@ qmi_proxy_new (GError **error) { QmiProxy *self; - if (!__qmi_user_allowed (getuid (), error)) + if (!qmi_int_utils_user_allowed (getuid (), error)) return NULL; self = g_object_new (QMI_TYPE_PROXY, NULL); diff --git a/src/libqmi-glib/qmi-proxy.h b/src/libqmi-glib/qmi-proxy.h index ce64976..6e7aeca 100644 --- a/src/libqmi-glib/qmi-proxy.h +++ b/src/libqmi-glib/qmi-proxy.h @@ -20,8 +20,12 @@ * Copyright (C) 2013 Aleksander Morgado */ -#ifndef QMI_PROXY_H -#define QMI_PROXY_H +#ifndef LIBQMI_GLIB_QMI_PROXY_H +#define LIBQMI_GLIB_QMI_PROXY_H + +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) +#error "Only can be included directly." +#endif #include #include @@ -55,4 +59,4 @@ GType qmi_proxy_get_type (void); QmiProxy *qmi_proxy_new (GError **error); guint qmi_proxy_get_n_clients (QmiProxy *self); -#endif /* QMI_PROXY_H */ +#endif /* LIBQMI_GLIB_QMI_PROXY_H */ diff --git a/src/libqmi-glib/qmi-utils.c b/src/libqmi-glib/qmi-utils.c index 20f059c..c03dd77 100644 --- a/src/libqmi-glib/qmi-utils.c +++ b/src/libqmi-glib/qmi-utils.c @@ -41,10 +41,11 @@ /*****************************************************************************/ +/* Internal */ gchar * -__qmi_utils_str_hex (gconstpointer mem, - gsize size, - gchar delimiter) +qmi_int_utils_str_hex (gconstpointer mem, + gsize size, + gchar delimiter) { const guint8 *data = mem; gsize i; @@ -77,9 +78,10 @@ __qmi_utils_str_hex (gconstpointer mem, /*****************************************************************************/ +/* Internal */ gboolean -__qmi_user_allowed (uid_t uid, - GError **error) +qmi_int_utils_user_allowed (uid_t uid, + GError **error) { #ifndef QMI_USERNAME_ENABLED if (uid == 0) @@ -127,8 +129,8 @@ print_read_bytes_trace (const gchar *type, gchar *str1; gchar *str2; - str1 = __qmi_utils_str_hex (buffer, n_bytes, ':'); - str2 = __qmi_utils_str_hex (out, n_bytes, ':'); + str1 = qmi_int_utils_str_hex (buffer, n_bytes, ':'); + str2 = qmi_int_utils_str_hex (out, n_bytes, ':'); g_debug ("Read %s (%s) --> (%s)", type, str1, str2); g_warn_if_fail (g_str_equal (str1, str2)); diff --git a/src/libqmi-glib/qmi-utils.h b/src/libqmi-glib/qmi-utils.h index 8511810..4a6a6fc 100644 --- a/src/libqmi-glib/qmi-utils.h +++ b/src/libqmi-glib/qmi-utils.h @@ -22,10 +22,10 @@ * Copyright (C) 2012 Dan Williams */ -#ifndef _LIBQMI_GLIB_QMI_UTILS_H_ -#define _LIBQMI_GLIB_QMI_UTILS_H_ +#ifndef LIBQMI_GLIB_QMI_UTILS_H +#define LIBQMI_GLIB_QMI_UTILS_H -#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) #error "Only can be included directly." #endif @@ -193,13 +193,13 @@ void qmi_utils_set_traces_enabled (gboolean enabled); #if defined (LIBQMI_GLIB_COMPILATION) G_GNUC_INTERNAL -gchar *__qmi_utils_str_hex (gconstpointer mem, - gsize size, - gchar delimiter); -gboolean __qmi_user_allowed (uid_t uid, - GError **error); +gchar *qmi_int_utils_str_hex (gconstpointer mem, + gsize size, + gchar delimiter); +gboolean qmi_int_utils_user_allowed (uid_t uid, + GError **error); #endif G_END_DECLS -#endif /* _LIBQMI_GLIB_QMI_UTILS_H_ */ +#endif /* LIBQMI_GLIB_QMI_UTILS_H */ diff --git a/src/libqmi-glib/qmi-version.h.in b/src/libqmi-glib/qmi-version.h.in index 22dda01..40432ac 100644 --- a/src/libqmi-glib/qmi-version.h.in +++ b/src/libqmi-glib/qmi-version.h.in @@ -18,8 +18,12 @@ * Copyright (C) 2013 Lanedo GmbH */ -#ifndef _QMI_VERSION_H_ -#define _QMI_VERSION_H_ +#ifndef LIBQMI_GLIB_QMI_VERSION_H +#define LIBQMI_GLIB_QMI_VERSION_H + +#if !defined (LIBQMI_GLIB_H_INSIDE) && !defined (LIBQMI_GLIB_COMPILATION) +#error "Only can be included directly." +#endif /** * SECTION:qmi-version @@ -66,4 +70,4 @@ (QMI_MAJOR_VERSION == (major) && QMI_MINOR_VERSION > (minor)) || \ (QMI_MAJOR_VERSION == (major) && QMI_MINOR_VERSION == (minor) && QMI_MICRO_VERSION >= (micro))) -#endif /* _QMI_VERSION_H_ */ +#endif /* LIBQMI_GLIB_QMI_VERSION_H */ diff --git a/src/libqmi-glib/test/test-message.c b/src/libqmi-glib/test/test-message.c index e058343..96c5b60 100644 --- a/src/libqmi-glib/test/test-message.c +++ b/src/libqmi-glib/test/test-message.c @@ -26,9 +26,9 @@ /*****************************************************************************/ static gchar * -__str_hex (gconstpointer mem, - gsize size, - gchar delimiter) +test_str_hex (gconstpointer mem, + gsize size, + gchar delimiter) { const guint8 *data = mem; gsize i; @@ -60,16 +60,16 @@ __str_hex (gconstpointer mem, } static void -_g_assert_cmpmem (gconstpointer mem1, - gsize size1, - gconstpointer mem2, - gsize size2) +qmi_assert_cmpmem (gconstpointer mem1, + gsize size1, + gconstpointer mem2, + gsize size2) { gchar *str1; gchar *str2; - str1 = __str_hex (mem1, size1, ':'); - str2 = __str_hex (mem2, size2, ':'); + str1 = test_str_hex (mem1, size1, ':'); + str2 = test_str_hex (mem2, size2, ':'); g_assert_cmpstr (str1, ==, str2); g_free (str1); g_free (str2); @@ -267,7 +267,7 @@ test_message_new_request (void) g_assert (buffer != NULL); g_assert_cmpuint (buffer_length, >, 0); - _g_assert_cmpmem (buffer, buffer_length, expected_buffer, sizeof (expected_buffer)); + qmi_assert_cmpmem (buffer, buffer_length, expected_buffer, sizeof (expected_buffer)); qmi_message_unref (self); } @@ -308,7 +308,7 @@ test_message_new_response_ok (void) g_assert (buffer != NULL); g_assert_cmpuint (buffer_length, >, 0); - _g_assert_cmpmem (buffer, buffer_length, expected_buffer, sizeof (expected_buffer)); + qmi_assert_cmpmem (buffer, buffer_length, expected_buffer, sizeof (expected_buffer)); qmi_message_unref (request); qmi_message_unref (response); @@ -350,7 +350,7 @@ test_message_new_response_error (void) g_assert (buffer != NULL); g_assert_cmpuint (buffer_length, >, 0); - _g_assert_cmpmem (buffer, buffer_length, expected_buffer, sizeof (expected_buffer)); + qmi_assert_cmpmem (buffer, buffer_length, expected_buffer, sizeof (expected_buffer)); qmi_message_unref (request); qmi_message_unref (response); diff --git a/src/qmicli/qmicli-helpers.h b/src/qmicli/qmicli-helpers.h index 72f8825..fb906cc 100644 --- a/src/qmicli/qmicli-helpers.h +++ b/src/qmicli/qmicli-helpers.h @@ -22,8 +22,8 @@ #include -#ifndef __QMICLI_HELPERS_H__ -#define __QMICLI_HELPERS_H__ +#ifndef QMICLI_HELPERS_H +#define QMICLI_HELPERS_H gchar *qmicli_get_raw_data_printable (const GArray *data, gsize max_line_length, @@ -55,4 +55,4 @@ gboolean qmicli_read_non_empty_string (const gchar *str, gboolean qmicli_read_uint_from_string (const gchar *str, guint *out); -#endif /* __QMICLI_H__ */ +#endif /* QMICLI_H */ diff --git a/src/qmicli/qmicli.h b/src/qmicli/qmicli.h index 8b84f4d..df9c6d3 100644 --- a/src/qmicli/qmicli.h +++ b/src/qmicli/qmicli.h @@ -20,8 +20,8 @@ #include -#ifndef __QMICLI_H__ -#define __QMICLI_H__ +#ifndef QMICLI_H +#define QMICLI_H /* Common */ void qmicli_async_operation_done (gboolean operation_status); @@ -68,4 +68,4 @@ void qmicli_wda_run (QmiDevice *device, QmiClientWda *client, GCancellable *cancellable); -#endif /* __QMICLI_H__ */ +#endif /* QMICLI_H */ diff --git a/utils/qmitest.c b/utils/qmitest.c index 7df896e..2adcba8 100644 --- a/utils/qmitest.c +++ b/utils/qmitest.c @@ -150,7 +150,7 @@ struct qmi_ctl_version_info_list_service { struct qmi_tlv_ctl_version_info_list { u8 count; struct qmi_ctl_version_info_list_service services[0]; -}__attribute__((__packed__)); +} __attribute__((__packed__)); struct seteventreport_req { struct qmux header; @@ -815,4 +815,3 @@ out: close (fd); return 0; } - -- 2.2.2