فهرست منبع

corotypes: drop deprecated EVS_ defines

none of our current dependencies use it.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Fabio M. Di Nitto 14 سال پیش
والد
کامیت
4120a2c1cb
13فایلهای تغییر یافته به همراه45 افزوده شده و 63 حذف شده
  1. 0 18
      include/corosync/corotypes.h
  2. 21 21
      lib/evs.c
  3. 1 1
      man/evs_context_get.3
  4. 1 1
      man/evs_context_set.3
  5. 8 8
      man/evs_dispatch.3
  6. 1 1
      man/evs_fd_get.3
  7. 1 1
      man/evs_finalize.3
  8. 1 1
      man/evs_initialize.3
  9. 1 1
      man/evs_join.3
  10. 1 1
      man/evs_leave.3
  11. 1 1
      man/evs_mcast_groups.3
  12. 1 1
      man/evs_mcast_joined.3
  13. 7 7
      test/testevsth.c

+ 0 - 18
include/corosync/corotypes.h

@@ -214,24 +214,6 @@ static inline cs_error_t qb_to_cs_error (int result)
 /*
 /*
  * DEPRECATED
  * DEPRECATED
  */
  */
-#define EVS_DISPATCH_ONE			CS_DISPATCH_ONE
-#define EVS_DISPATCH_ALL			CS_DISPATCH_ALL
-#define EVS_DISPATCH_BLOCKING		CS_DISPATCH_BLOCKING
-#define EVS_OK						CS_OK
-#define EVS_ERR_LIBRARY				CS_ERR_LIBRARY
-#define EVS_ERR_TIMEOUT				CS_ERR_TIMEOUT
-#define EVS_ERR_TRY_AGAIN			CS_ERR_TRY_AGAIN
-#define EVS_ERR_INVALID_PARAM		CS_ERR_INVALID_PARAM
-#define EVS_ERR_NO_MEMORY			CS_ERR_NO_MEMORY
-#define EVS_ERR_BAD_HANDLE			CS_ERR_BAD_HANDLE
-#define EVS_ERR_ACCESS				CS_ERR_ACCESS
-#define EVS_ERR_NOT_EXIST			CS_ERR_NOT_EXIST
-#define EVS_ERR_EXIST				CS_ERR_EXIST
-#define EVS_ERR_NOT_SUPPORTED		CS_ERR_NOT_SUPPORTED
-#define EVS_ERR_SECURITY			CS_ERR_SECURITY
-#define EVS_ERR_TOO_MANY_GROUPS		CS_ERR_TOO_MANY_GROUPS
-#define evs_error_t cs_error_t
-
 #define CPG_DISPATCH_ONE			CS_DISPATCH_ONE
 #define CPG_DISPATCH_ONE			CS_DISPATCH_ONE
 #define CPG_DISPATCH_ALL			CS_DISPATCH_ALL
 #define CPG_DISPATCH_ALL			CS_DISPATCH_ALL
 #define CPG_DISPATCH_BLOCKING		CS_DISPATCH_BLOCKING
 #define CPG_DISPATCH_BLOCKING		CS_DISPATCH_BLOCKING

+ 21 - 21
lib/evs.c

@@ -82,9 +82,9 @@ DECLARE_HDB_DATABASE (evs_handle_t_db,NULL);
  * test
  * test
  * @param handle The handle of evs initialize
  * @param handle The handle of evs initialize
  * @param callbacks The callbacks for evs_initialize
  * @param callbacks The callbacks for evs_initialize
- * @returns EVS_OK
+ * @returns CS_OK
  */
  */
-evs_error_t evs_initialize (
+cs_error_t evs_initialize (
 	evs_handle_t *handle,
 	evs_handle_t *handle,
 	evs_callbacks_t *callbacks)
 	evs_callbacks_t *callbacks)
 {
 {
@@ -123,7 +123,7 @@ error_no_destroy:
 	return (error);
 	return (error);
 }
 }
 
 
-evs_error_t evs_finalize (
+cs_error_t evs_finalize (
 	evs_handle_t handle)
 	evs_handle_t handle)
 {
 {
 	struct evs_inst *evs_inst;
 	struct evs_inst *evs_inst;
@@ -139,7 +139,7 @@ evs_error_t evs_finalize (
 	 */
 	 */
 	if (evs_inst->finalize) {
 	if (evs_inst->finalize) {
 		hdb_handle_put (&evs_handle_t_db, handle);
 		hdb_handle_put (&evs_handle_t_db, handle);
-		return (EVS_ERR_BAD_HANDLE);
+		return (CS_ERR_BAD_HANDLE);
 	}
 	}
 
 
 	evs_inst->finalize = 1;
 	evs_inst->finalize = 1;
@@ -150,10 +150,10 @@ evs_error_t evs_finalize (
 
 
 	hdb_handle_put (&evs_handle_t_db, handle);
 	hdb_handle_put (&evs_handle_t_db, handle);
 
 
-	return (EVS_OK);
+	return (CS_OK);
 }
 }
 
 
-evs_error_t evs_fd_get (
+cs_error_t evs_fd_get (
 	evs_handle_t handle,
 	evs_handle_t handle,
 	int *fd)
 	int *fd)
 {
 {
@@ -172,7 +172,7 @@ evs_error_t evs_fd_get (
 	return (CS_OK);
 	return (CS_OK);
 }
 }
 
 
-evs_error_t evs_context_get (
+cs_error_t evs_context_get (
 	evs_handle_t handle,
 	evs_handle_t handle,
 	void **context)
 	void **context)
 {
 {
@@ -210,7 +210,7 @@ cs_error_t evs_context_set (
 	return (CS_OK);
 	return (CS_OK);
 }
 }
 
 
-evs_error_t evs_dispatch (
+cs_error_t evs_dispatch (
 	evs_handle_t handle,
 	evs_handle_t handle,
 	cs_dispatch_flags_t dispatch_types)
 	cs_dispatch_flags_t dispatch_types)
 {
 {
@@ -233,7 +233,7 @@ evs_error_t evs_dispatch (
 	 * Timeout instantly for CS_DISPATCH_ONE or CS_DISPATCH_ALL and
 	 * Timeout instantly for CS_DISPATCH_ONE or CS_DISPATCH_ALL and
 	 * wait indefinately for CS_DISPATCH_BLOCKING
 	 * wait indefinately for CS_DISPATCH_BLOCKING
 	 */
 	 */
-	if (dispatch_types == EVS_DISPATCH_ALL) {
+	if (dispatch_types == CS_DISPATCH_ALL) {
 		timeout = 0;
 		timeout = 0;
 	}
 	}
 
 
@@ -250,7 +250,7 @@ evs_error_t evs_dispatch (
 		}
 		}
 		if (error == CS_ERR_TRY_AGAIN) {
 		if (error == CS_ERR_TRY_AGAIN) {
 			error = CS_OK;
 			error = CS_OK;
-			if (dispatch_types == CPG_DISPATCH_ALL) {
+			if (dispatch_types == CS_DISPATCH_ALL) {
 				break; /* exit do while cont is 1 loop */
 				break; /* exit do while cont is 1 loop */
 			} else {
 			} else {
 				continue; /* next poll */
 				continue; /* next poll */
@@ -320,19 +320,19 @@ error_put:
 	return (error);
 	return (error);
 }
 }
 
 
-evs_error_t evs_join (
+cs_error_t evs_join (
     evs_handle_t handle,
     evs_handle_t handle,
     const struct evs_group *groups,
     const struct evs_group *groups,
     size_t group_entries)
     size_t group_entries)
 {
 {
-	evs_error_t error;
+	cs_error_t error;
 	struct evs_inst *evs_inst;
 	struct evs_inst *evs_inst;
 	struct iovec iov[2];
 	struct iovec iov[2];
 	struct req_lib_evs_join req_lib_evs_join;
 	struct req_lib_evs_join req_lib_evs_join;
 	struct res_lib_evs_join res_lib_evs_join;
 	struct res_lib_evs_join res_lib_evs_join;
 
 
 	error = hdb_error_to_cs(hdb_handle_get (&evs_handle_t_db, handle, (void *)&evs_inst));
 	error = hdb_error_to_cs(hdb_handle_get (&evs_handle_t_db, handle, (void *)&evs_inst));
-	if (error != EVS_OK) {
+	if (error != CS_OK) {
 		return (error);
 		return (error);
 	}
 	}
 
 
@@ -361,12 +361,12 @@ error_exit:
 	return (error);
 	return (error);
 }
 }
 
 
-evs_error_t evs_leave (
+cs_error_t evs_leave (
     evs_handle_t handle,
     evs_handle_t handle,
     const struct evs_group *groups,
     const struct evs_group *groups,
     size_t group_entries)
     size_t group_entries)
 {
 {
-	evs_error_t error;
+	cs_error_t error;
 	struct evs_inst *evs_inst;
 	struct evs_inst *evs_inst;
 	struct iovec iov[2];
 	struct iovec iov[2];
 	struct req_lib_evs_leave req_lib_evs_leave;
 	struct req_lib_evs_leave req_lib_evs_leave;
@@ -402,14 +402,14 @@ error_exit:
 	return (error);
 	return (error);
 }
 }
 
 
-evs_error_t evs_mcast_joined (
+cs_error_t evs_mcast_joined (
 	evs_handle_t handle,
 	evs_handle_t handle,
 	evs_guarantee_t guarantee,
 	evs_guarantee_t guarantee,
 	const struct iovec *iovec,
 	const struct iovec *iovec,
 	unsigned int iov_len)
 	unsigned int iov_len)
 {
 {
 	int i;
 	int i;
-	evs_error_t error;
+	cs_error_t error;
 	struct evs_inst *evs_inst;
 	struct evs_inst *evs_inst;
 	struct iovec iov[64];
 	struct iovec iov[64];
 	struct req_lib_evs_mcast_joined req_lib_evs_mcast_joined;
 	struct req_lib_evs_mcast_joined req_lib_evs_mcast_joined;
@@ -453,7 +453,7 @@ error_exit:
 	return (error);
 	return (error);
 }
 }
 
 
-evs_error_t evs_mcast_groups (
+cs_error_t evs_mcast_groups (
 	evs_handle_t handle,
 	evs_handle_t handle,
 	evs_guarantee_t guarantee,
 	evs_guarantee_t guarantee,
 	const struct evs_group *groups,
 	const struct evs_group *groups,
@@ -462,7 +462,7 @@ evs_error_t evs_mcast_groups (
 	unsigned int iov_len)
 	unsigned int iov_len)
 {
 {
 	int i;
 	int i;
-	evs_error_t error;
+	cs_error_t error;
 	struct evs_inst *evs_inst;
 	struct evs_inst *evs_inst;
 	struct iovec iov[64]; /* FIXME: what if iov_len > 62 ?  use malloc */
 	struct iovec iov[64]; /* FIXME: what if iov_len > 62 ?  use malloc */
 	struct req_lib_evs_mcast_groups req_lib_evs_mcast_groups;
 	struct req_lib_evs_mcast_groups req_lib_evs_mcast_groups;
@@ -506,13 +506,13 @@ error_exit:
 	return (error);
 	return (error);
 }
 }
 
 
-evs_error_t evs_membership_get (
+cs_error_t evs_membership_get (
 	evs_handle_t handle,
 	evs_handle_t handle,
 	unsigned int *local_nodeid,
 	unsigned int *local_nodeid,
 	unsigned int *member_list,
 	unsigned int *member_list,
 	size_t *member_list_entries)
 	size_t *member_list_entries)
 {
 {
-	evs_error_t error;
+	cs_error_t error;
 	struct evs_inst *evs_inst;
 	struct evs_inst *evs_inst;
 	struct iovec iov;
 	struct iovec iov;
 	struct req_lib_evs_membership_get req_lib_evs_membership_get;
 	struct req_lib_evs_membership_get req_lib_evs_membership_get;

+ 1 - 1
man/evs_context_get.3

@@ -44,7 +44,7 @@ The
 function is used to retrieve the context variable previously stored using
 function is used to retrieve the context variable previously stored using
 .B evs_context_set(3)
 .B evs_context_set(3)
 .SH RETURN VALUE
 .SH RETURN VALUE
-This call returns the EVS_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .PP
 .SH ERRORS
 .SH ERRORS
 The errors are undocumented.
 The errors are undocumented.

+ 1 - 1
man/evs_context_set.3

@@ -46,7 +46,7 @@ meaning insire libevs itself and will not be touched by the library. It can
 be retrieved using
 be retrieved using
 .B evs_context_get(3)
 .B evs_context_get(3)
 .SH RETURN VALUE
 .SH RETURN VALUE
-This call returns the EVS_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .PP
 .SH ERRORS
 .SH ERRORS
 The errors are undocumented.
 The errors are undocumented.

+ 8 - 8
man/evs_dispatch.3

@@ -60,10 +60,10 @@ defined by the structure:
 .nf
 .nf
 .ta 4n 30n 33n
 .ta 4n 30n 33n
 typedef enum {
 typedef enum {
-        EVS_DISPATCH_ONE,
-        EVS_DISPATCH_ALL,
-        EVS_DISPATCH_BLOCKING
-} evs_dispatch_t;
+        CS_DISPATCH_ONE,
+        CS_DISPATCH_ALL,
+        CS_DISPATCH_BLOCKING
+} cs_dispatch_flags_t;
 .ta
 .ta
 .fi
 .fi
 .RE
 .RE
@@ -72,19 +72,19 @@ typedef enum {
 .PP
 .PP
 The dispatch values have the following meanings:
 The dispatch values have the following meanings:
 .TP
 .TP
-.B EVS_DISPATCH_ONE
+.B CS_DISPATCH_ONE
 Dispatch atleast one callback, blocking until the callback is dispatched.
 Dispatch atleast one callback, blocking until the callback is dispatched.
 .TP
 .TP
-.B EVS_DISPATCH_ALL
+.B CS_DISPATCH_ALL
 Dispatch all waiting callbacks without blocking to wait for any callbacks.
 Dispatch all waiting callbacks without blocking to wait for any callbacks.
 .TP
 .TP
-.B EVS_DISPATCH_BLOCKING
+.B CS_DISPATCH_BLOCKING
 Dispatch all callbacks blocking indefinately.  This is used in a threaded
 Dispatch all callbacks blocking indefinately.  This is used in a threaded
 program where a thread is created, and then evs_dispatch() is called immediately
 program where a thread is created, and then evs_dispatch() is called immediately
 from the created thread to execute callbacks.
 from the created thread to execute callbacks.
 
 
 .SH RETURN VALUE
 .SH RETURN VALUE
-This call returns the EVS_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .PP
 .SH ERRORS
 .SH ERRORS
 The errors are undocumented.
 The errors are undocumented.

+ 1 - 1
man/evs_fd_get.3

@@ -51,7 +51,7 @@ argument may not be used directly with
 because it is not the file descriptor, but instead an internal identifier used
 because it is not the file descriptor, but instead an internal identifier used
 by the EVS library.
 by the EVS library.
 .SH RETURN VALUE
 .SH RETURN VALUE
-This call returns the EVS_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .PP
 .SH ERRORS
 .SH ERRORS
 The errors are undocumented.
 The errors are undocumented.

+ 1 - 1
man/evs_finalize.3

@@ -47,7 +47,7 @@ No more callbacks will be dispatched from the
 .B evs_dispatch function.
 .B evs_dispatch function.
 .PP
 .PP
 .SH RETURN VALUE
 .SH RETURN VALUE
-This call returns the EVS_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .PP
 .SH ERRORS
 .SH ERRORS
 The errors are undocumented.
 The errors are undocumented.

+ 1 - 1
man/evs_initialize.3

@@ -102,7 +102,7 @@ is called.  If a delivery of a message occurs,
 is called.
 is called.
 
 
 .SH RETURN VALUE
 .SH RETURN VALUE
-This call returns the EVS_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .PP
 .SH ERRORS
 .SH ERRORS
 The errors are undocumented.
 The errors are undocumented.

+ 1 - 1
man/evs_join.3

@@ -86,7 +86,7 @@ typedef struct {
 .PP
 .PP
 .PP
 .PP
 .SH RETURN VALUE
 .SH RETURN VALUE
-This call returns the EVS_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .PP
 .SH ERRORS
 .SH ERRORS
 The errors are undocumented.
 The errors are undocumented.

+ 1 - 1
man/evs_leave.3

@@ -81,7 +81,7 @@ typedef struct {
 .IP
 .IP
 .PP
 .PP
 .SH RETURN VALUE
 .SH RETURN VALUE
-This call returns the EVS_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .PP
 .SH ERRORS
 .SH ERRORS
 The errors are undocumented.
 The errors are undocumented.

+ 1 - 1
man/evs_mcast_groups.3

@@ -145,7 +145,7 @@ argument describes the number of entires in the
 argument.
 argument.
 
 
 .SH RETURN VALUE
 .SH RETURN VALUE
-This call returns the EVS_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .PP
 .SH ERRORS
 .SH ERRORS
 The errors are undocumented.
 The errors are undocumented.

+ 1 - 1
man/evs_mcast_joined.3

@@ -118,7 +118,7 @@ argument describes the number of entires in the
 argument.
 argument.
 
 
 .SH RETURN VALUE
 .SH RETURN VALUE
-This call returns the EVS_OK value if successful, otherwise an error is returned.
+This call returns the CS_OK value if successful, otherwise an error is returned.
 .PP
 .PP
 .SH ERRORS
 .SH ERRORS
 The errors are undocumented.
 The errors are undocumented.

+ 7 - 7
test/testevsth.c

@@ -103,11 +103,11 @@ struct iovec iov = {
 
 
 void *th_dispatch (void *arg)
 void *th_dispatch (void *arg)
 {
 {
-	evs_error_t result;
+	cs_error_t result;
 	evs_handle_t handle = *(evs_handle_t *)arg;
 	evs_handle_t handle = *(evs_handle_t *)arg;
 
 
 	printf ("THREAD DISPATCH starting.\n");
 	printf ("THREAD DISPATCH starting.\n");
-	result = evs_dispatch (handle, EVS_DISPATCH_BLOCKING);
+	result = evs_dispatch (handle, CS_DISPATCH_BLOCKING);
 	printf ("THREAD DISPATCH return result is %d\n", result);
 	printf ("THREAD DISPATCH return result is %d\n", result);
 	return (0);
 	return (0);
 }
 }
@@ -119,13 +119,13 @@ static struct sched_param sched_param = {
 int main (void)
 int main (void)
 {
 {
 	evs_handle_t handle;
 	evs_handle_t handle;
-	evs_error_t result;
+	cs_error_t result;
 	int i = 0;
 	int i = 0;
 	pthread_t dispatch_thread;
 	pthread_t dispatch_thread;
 	pthread_attr_t dispatch_thread_attribute;
 	pthread_attr_t dispatch_thread_attribute;
 
 
 	result = evs_initialize (&handle, &callbacks);
 	result = evs_initialize (&handle, &callbacks);
-	if (result != EVS_OK) {
+	if (result != CS_OK) {
 		printf ("Couldn't initialize EVS service %d\n", result);
 		printf ("Couldn't initialize EVS service %d\n", result);
 		exit (0);
 		exit (0);
 	}
 	}
@@ -150,10 +150,10 @@ int main (void)
 		sprintf (buffer, "evs_mcast_joined: This is message %d", i);
 		sprintf (buffer, "evs_mcast_joined: This is message %d", i);
 try_again_one:
 try_again_one:
 		result = evs_mcast_joined (handle, EVS_TYPE_AGREED, &iov, 1);
 		result = evs_mcast_joined (handle, EVS_TYPE_AGREED, &iov, 1);
-		if (result == EVS_ERR_TRY_AGAIN) {
+		if (result == CS_ERR_TRY_AGAIN) {
 			goto try_again_one;
 			goto try_again_one;
 		} else
 		} else
-		if (result != EVS_OK) {
+		if (result != CS_OK) {
 			printf ("Got error result, exiting %d\n", result);
 			printf ("Got error result, exiting %d\n", result);
 			exit (1);
 			exit (1);
 		}
 		}
@@ -168,7 +168,7 @@ try_again_one:
 try_again_two:
 try_again_two:
 		result = evs_mcast_groups (handle, EVS_TYPE_AGREED,
 		result = evs_mcast_groups (handle, EVS_TYPE_AGREED,
 			 &groups[1], 1, &iov, 1);
 			 &groups[1], 1, &iov, 1);
-		if (result == EVS_ERR_TRY_AGAIN) {
+		if (result == CS_ERR_TRY_AGAIN) {
 			goto try_again_two;
 			goto try_again_two;
 		}
 		}
 	}
 	}