* **************************************************************************/
typedef enum { free_after_use, free_never } e_gras_free_directive_t;
-/* **************************************************************************
- * Initializing the processes
- * **************************************************************************/
-/**
- * gras_process_init:
- *
- * Perform the various intialisations needed by gras. Each process must run it
- */
-gras_error_t gras_process_init(void);
-
-/**
- * gras_process_finalize:
- *
- * Perform the various intialisations needed by gras. Each process must run it
- */
-gras_error_t gras_process_finalize(void);
-
-/****************************************************************************/
-/* Manipulating User Data */
-/****************************************************************************/
-/**
- * gras_userdata_get:
- *
- * Get the data associated with the current process.
- */
-void *gras_userdata_get(void);
-
-/**
- * gras_userdata_set:
- *
- * Set the data associated with the current process.
- */
-void *gras_userdata_set(void *ud);
-
-/**
- * gras_userdata_new:
- *
- * Malloc and set the data associated with the current process.
- */
-
-#define gras_userdata_new(type) gras_userdata_set(malloc(sizeof(type)))
/* **************************************************************************
* Wrappers over OS functions
#include <gras/config.h>
#include <gras/core.h>
+#include <gras/process.h>
+
#include <gras/transport.h>
#include <gras/datadesc.h>
--- /dev/null
+/* $Id$ */
+
+/* gras/core.h - Unsorted part of the GRAS public interface */
+
+/* Authors: Martin Quinson */
+/* Copyright (C) 2003 the OURAGAN project. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef GRAS_PROCESS_H
+#define GRAS_PROCESS_H
+
+#include <stddef.h> /* offsetof() */
+#include <sys/types.h> /* size_t */
+#include <stdarg.h>
+
+
+/*! C++ users need love */
+#ifndef BEGIN_DECL
+# ifdef __cplusplus
+# define BEGIN_DECL extern "C" {
+# else
+# define BEGIN_DECL
+# endif
+#endif
+
+/*! C++ users need love */
+#ifndef END_DECL
+# ifdef __cplusplus
+# define END_DECL }
+# else
+# define END_DECL
+# endif
+#endif
+/* End of cruft for C++ */
+
+BEGIN_DECL
+
+/* **************************************************************************
+ * Initializing the processes
+ * **************************************************************************/
+/**
+ * gras_process_init:
+ *
+ * Perform the various intialisations needed by gras. Each process must run it
+ */
+gras_error_t gras_process_init(void);
+
+/**
+ * gras_process_exit:
+ *
+ * Frees the memory allocated by gras. Processes should run it
+ */
+gras_error_t gras_process_exit(void);
+
+/****************************************************************************/
+/* Manipulating User Data */
+/****************************************************************************/
+/**
+ * gras_userdata_get:
+ *
+ * Get the data associated with the current process.
+ */
+void *gras_userdata_get(void);
+
+/**
+ * gras_userdata_set:
+ *
+ * Set the data associated with the current process.
+ */
+void *gras_userdata_set(void *ud);
+
+/**
+ * gras_userdata_new:
+ *
+ * Malloc and set the data associated with the current process.
+ */
+
+#define gras_userdata_new(type) gras_userdata_set(malloc(sizeof(type)))
+
+END_DECL
+
+#endif /* GRAS_PROCESS_H */
+
#include "gras/set.h"
#include "gras/config.h"
-//#include "gras/data_description.h"
-//#include "gras/dd_type_bag.h"
-
#include "gras/core.h"
+#include "gras/process.h"
#include "gras/transport.h"
-//#include "gras/datadesc_simple.h"
#include "gras/datadesc.h"
#include "gras/socket.h"
#include "gras/messages.h"
};
/**
- * grasProcessData_t:
+ * gras_process_data_t:
*
* Data for each process
*/
typedef struct {
/* queue of messages which where received but not wanted in msgWait, and therefore
temporarly queued until the next msgHandle */
- int grasMsgQueueLen;
- gras_msg_t **grasMsgQueue;
+ gras_dynar_t *msg_queue; /* elm type: gras_msg_t */
/* registered callbacks for each message */
- int grasCblListLen;
- gras_cblist_t *grasCblList;
+ gras_dynar_t *cbl_list; /* elm type: gras_cblist_t */
+
/* The channel we are listening to in SG for formated messages */
int chan;
/* globals of the process */
void *userdata;
-} grasProcessData_t;
+} gras_process_data_t;
/*@unused@*/static const DataDescriptor headerDescriptor[] =
gras_msgentry_t * grasMsgEntryGet(gras_msgid_t id);
/**
- * grasProcessDataGet:
+ * gras_process_data_get:
*
* Get the GRAS globals for this host
*/ /*@observer@*/
-grasProcessData_t *grasProcessDataGet(void);
+gras_process_data_t *gras_process_data_get(void);
/**
* gras_cb_get: