aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-10-09 12:09:44 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-10-09 15:23:48 +0200
commit586aba166aaa9fae91318917c73fd3c30c045def (patch)
tree59800e4c56197452e97492e4588fe2d1f48128da
parent3bbdc479476a401398b1b62dac9a881bfc636feb (diff)
downloadexternal_libqmi-586aba166aaa9fae91318917c73fd3c30c045def.zip
external_libqmi-586aba166aaa9fae91318917c73fd3c30c045def.tar.gz
external_libqmi-586aba166aaa9fae91318917c73fd3c30c045def.tar.bz2
qmi-codegen: make internal get_printable() and get_version_introduced()
These methods are (should only be) used only by the library.
-rw-r--r--build-aux/qmi-codegen/MessageList.py38
-rw-r--r--libqmi-glib/qmi-message.c22
2 files changed, 29 insertions, 31 deletions
diff --git a/build-aux/qmi-codegen/MessageList.py b/build-aux/qmi-codegen/MessageList.py
index 7d3802d..ac375fe 100644
--- a/build-aux/qmi-codegen/MessageList.py
+++ b/build-aux/qmi-codegen/MessageList.py
@@ -113,15 +113,21 @@ class MessageList:
template = (
'\n'
- 'gchar *qmi_message_${service}_get_printable (\n'
+ '#if defined (LIBQMI_GLIB_COMPILATION)\n'
+ '\n'
+ 'G_GNUC_INTERNAL\n'
+ 'gchar *__qmi_message_${service}_get_printable (\n'
' QmiMessage *self,\n'
- ' const gchar *line_prefix);\n')
+ ' const gchar *line_prefix);\n'
+ '\n'
+ '#endif\n'
+ '\n')
hfile.write(string.Template(template).substitute(translations))
template = (
'\n'
'gchar *\n'
- 'qmi_message_${service}_get_printable (\n'
+ '__qmi_message_${service}_get_printable (\n'
' QmiMessage *self,\n'
' const gchar *line_prefix)\n'
'{\n'
@@ -173,16 +179,22 @@ class MessageList:
template = (
'\n'
- 'gboolean qmi_message_${service}_get_version_introduced (\n'
+ '#if defined (LIBQMI_GLIB_COMPILATION)\n'
+ '\n'
+ 'G_GNUC_INTERNAL\n'
+ 'gboolean __qmi_message_${service}_get_version_introduced (\n'
' QmiMessage *self,\n'
' guint *major,\n'
- ' guint *minor);\n')
+ ' guint *minor);\n'
+ '\n'
+ '#endif\n'
+ '\n')
hfile.write(string.Template(template).substitute(translations))
template = (
'\n'
'gboolean\n'
- 'qmi_message_${service}_get_version_introduced (\n'
+ '__qmi_message_${service}_get_version_introduced (\n'
' QmiMessage *self,\n'
' guint *major,\n'
' guint *minor)\n'
@@ -237,17 +249,3 @@ class MessageList:
# Emit all message sections
for message in self.list:
message.emit_sections(sfile)
-
- translations = { 'hyphened' : utils.build_dashed_name (self.service + 'Private'),
- 'service' : utils.build_underscore_name (self.service) }
-
- # Emit dummy section for service-specific private methods
- template = (
- '<SECTION>\n'
- '<FILE>${hyphened}</FILE>\n'
- '<SUBSECTION Private>\n'
- 'qmi_message_${service}_get_printable\n'
- 'qmi_message_${service}_get_version_introduced\n'
- '</SECTION>\n'
- '\n')
- sfile.write(string.Template(template).substitute(translations))
diff --git a/libqmi-glib/qmi-message.c b/libqmi-glib/qmi-message.c
index 319a3c3..3227820 100644
--- a/libqmi-glib/qmi-message.c
+++ b/libqmi-glib/qmi-message.c
@@ -839,22 +839,22 @@ 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_message_ctl_get_printable (self, line_prefix);
break;
case QMI_SERVICE_DMS:
- contents = qmi_message_dms_get_printable (self, line_prefix);
+ contents = __qmi_message_dms_get_printable (self, line_prefix);
break;
case QMI_SERVICE_WDS:
- contents = qmi_message_wds_get_printable (self, line_prefix);
+ contents = __qmi_message_wds_get_printable (self, line_prefix);
break;
case QMI_SERVICE_NAS:
- contents = qmi_message_nas_get_printable (self, line_prefix);
+ contents = __qmi_message_nas_get_printable (self, line_prefix);
break;
case QMI_SERVICE_WMS:
- contents = qmi_message_wms_get_printable (self, line_prefix);
+ contents = __qmi_message_wms_get_printable (self, line_prefix);
break;
case QMI_SERVICE_PDS:
- contents = qmi_message_pds_get_printable (self, line_prefix);
+ contents = __qmi_message_pds_get_printable (self, line_prefix);
break;
default:
break;
@@ -891,19 +891,19 @@ 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_message_dms_get_version_introduced (self, major, minor);
case QMI_SERVICE_WDS:
- return qmi_message_wds_get_version_introduced (self, major, minor);
+ return __qmi_message_wds_get_version_introduced (self, major, minor);
case QMI_SERVICE_NAS:
- return qmi_message_nas_get_version_introduced (self, major, minor);
+ return __qmi_message_nas_get_version_introduced (self, major, minor);
case QMI_SERVICE_WMS:
- return qmi_message_wms_get_version_introduced (self, major, minor);
+ return __qmi_message_wms_get_version_introduced (self, major, minor);
case QMI_SERVICE_PDS:
- return qmi_message_pds_get_version_introduced (self, major, minor);
+ return __qmi_message_pds_get_version_introduced (self, major, minor);
default:
/* For the still unsupported services, cannot do anything */