3 /* gras/core.h - Unsorted part of the GRAS public interface */
5 /* Authors: Martin Quinson */
6 /* Copyright (C) 2003 the OURAGAN project. */
8 /* This program is free software; you can redistribute it and/or modify it
9 under the terms of the license (GNU LGPL) which comes with this package. */
11 #ifndef GRAS_PROCESS_H
12 #define GRAS_PROCESS_H
14 #include <stddef.h> /* offsetof() */
15 #include <sys/types.h> /* size_t */
19 /*! C++ users need love */
22 # define BEGIN_DECL extern "C" {
28 /*! C++ users need love */
36 /* End of cruft for C++ */
40 /* **************************************************************************
41 * Initializing the processes
42 * **************************************************************************/
46 * Perform the various intialisations needed by gras. Each process must run it
48 gras_error_t gras_process_init(void);
53 * Frees the memory allocated by gras. Processes should run it
55 gras_error_t gras_process_exit(void);
57 /****************************************************************************/
58 /* Manipulating User Data */
59 /****************************************************************************/
63 * Get the data associated with the current process.
65 void *gras_userdata_get(void);
70 * Set the data associated with the current process.
72 void gras_userdata_set(void *ud);
77 * Malloc and set the data associated with the current process.
80 #define gras_userdata_new(type) (gras_userdata_set(malloc(sizeof(type))),gras_userdata_get())
84 #endif /* GRAS_PROCESS_H */