[PATCH xf86-input-synaptics v2 01/13] Introduce SynapticsHwStateAlloc() and SynapticsHwStateFree()

Chase Douglas chase.douglas at canonical.com
Thu Feb 9 18:24:45 PST 2012


Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
 src/synaptics.c |   13 +++++++++++++
 src/synproto.h  |    6 ++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/synaptics.c b/src/synaptics.c
index a4c1e5a..b9b4de6 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2809,3 +2809,16 @@ CalculateScalingCoeffs(SynapticsPrivate *priv)
         priv->vert_coeff = 1;
     }
 }
+
+struct SynapticsHwState *
+SynapticsHwStateAlloc(SynapticsPrivate *priv)
+{
+    return calloc(1, sizeof(struct SynapticsHwState));
+}
+
+void
+SynapticsHwStateFree(struct SynapticsHwState **hw)
+{
+    free(*hw);
+    *hw = NULL;
+}
diff --git a/src/synproto.h b/src/synproto.h
index 6962bbf..3f09bb2 100644
--- a/src/synproto.h
+++ b/src/synproto.h
@@ -32,6 +32,9 @@
 #include <xf86Xinput.h>
 #include <xisb.h>
 
+struct _SynapticsPrivateRec;
+typedef struct _SynapticsPrivateRec SynapticsPrivate;
+
 /*
  * A structure to describe the state of the touchpad hardware (buttons and pad)
  */
@@ -90,4 +93,7 @@ extern struct SynapticsProtocolOperations event_proto_operations;
 extern struct SynapticsProtocolOperations psm_proto_operations;
 #endif /* BUILD_PSMCOMM */
 
+extern struct SynapticsHwState *SynapticsHwStateAlloc(SynapticsPrivate *priv);
+extern void SynapticsHwStateFree(struct SynapticsHwState **hw);
+
 #endif /* _SYNPROTO_H_ */
-- 
1.7.8.3



More information about the xorg-devel mailing list