summaryrefslogtreecommitdiff
path: root/include/privates.h
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-02-23 13:19:53 -0500
committerEamon Walsh <ewalsh@moss-uranus.epoch.ncsc.mil>2007-02-23 13:19:53 -0500
commit779faccfb78648a9f7e70b77dcfa9f6e19559772 (patch)
tree46981eb12fcad5b9223ed64fccee7c9e8269de30 /include/privates.h
parent9a3eb0357e779d5d5f76858f23667956c4c5d721 (diff)
devPrivates rework: add dix header file containing new interface.
Diffstat (limited to 'include/privates.h')
-rw-r--r--include/privates.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/include/privates.h b/include/privates.h
new file mode 100644
index 000000000..8d7427074
--- /dev/null
+++ b/include/privates.h
@@ -0,0 +1,77 @@
+/***********************************************************
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+******************************************************************/
+
+#ifndef PRIVATES_H
+#define PRIVATES_H 1
+
+#include "dix.h"
+#include "resource.h"
+
+/*****************************************************************
+ * STUFF FOR PRIVATES
+ *****************************************************************/
+
+/*
+ * Request private space for your driver/module in all resources of a type.
+ * A non-null pScreen argument restricts to resources on a given screen.
+ */
+extern int
+dixRequestPrivate(RESTYPE type, unsigned size, pointer pScreen);
+
+/*
+ * Request private space in just one individual resource object.
+ */
+extern int
+dixRequestSinglePrivate(RESTYPE type, unsigned size, pointer instance);
+
+/*
+ * Look up a private pointer.
+ */
+extern pointer
+dixLookupPrivate(RESTYPE type, int index, pointer instance);
+
+/*
+ * Register callbacks to be called on private allocation/freeing.
+ * The calldata argument to the callbacks is a PrivateCallbackPtr.
+ */
+typedef struct _PrivateCallback {
+ pointer value; /* pointer to private */
+ int index; /* registration index */
+ ResourcePtr resource; /* resource record (do not modify!) */
+} PrivateCallbackRec, *PrivateCallbackPtr;
+
+extern int
+dixRegisterPrivateInitFunc(RESTYPE type, int index,
+ CallbackProcPtr callback, pointer userdata);
+
+extern int
+dixRegisterPrivateDeleteFunc(RESTYPE type, int index,
+ CallbackProcPtr callback, pointer userdata);
+
+/*
+ * Internal functions
+ */
+extern void
+dixResetPrivates(void);
+
+extern int
+dixUpdatePrivates(void);
+
+extern ResourcePtr
+dixAllocateResourceRec(RESTYPE type, pointer value, pointer parent);
+
+extern void
+dixCallPrivateInitFuncs(ResourcePtr res);
+
+extern void
+dixFreeResourceRec(ResourcePtr res);
+
+#endif /* PRIVATES_H */