cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: pcaulfield@sourceware.org <pcaulfield@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/cman/lib libcman.c libcman.h
Date: 2 May 2007 10:27:08 -0000	[thread overview]
Message-ID: <20070502102708.18106.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-05-02 10:27:07

Modified files:
	cman/lib       : libcman.c libcman.h 

Log message:
	Add const to libcman
	Thanks to  Jim Meyering for the patch

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/lib/libcman.c.diff?cvsroot=cluster&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/lib/libcman.h.diff?cvsroot=cluster&r1=1.29&r2=1.30

--- cluster/cman/lib/libcman.c	2007/01/05 10:30:53	1.33
+++ cluster/cman/lib/libcman.c	2007/05/02 10:27:07	1.34
@@ -1,7 +1,7 @@
 /******************************************************************************
 *******************************************************************************
 **
-**  Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
+**  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
 **
 **  This library is free software; you can redistribute it and/or
 **  modify it under the terms of the GNU Lesser General Public
@@ -250,7 +250,7 @@
 }
 
 
-static int send_message(struct cman_handle *h, int msgtype, void *inbuf, int inlen)
+static int send_message(struct cman_handle *h, int msgtype, const void *inbuf, int inlen)
 {
 	struct sock_header header;
 	size_t len;
@@ -268,7 +268,7 @@
 	if (inbuf)
 	{
 		iov[1].iov_len = inlen;
-		iov[1].iov_base = inbuf;
+		iov[1].iov_base = (void *) inbuf;
 		iovlen++;
 	}
 
@@ -279,7 +279,7 @@
 }
 
 /* Does something similar to the ioctl calls */
-static int info_call(struct cman_handle *h, int msgtype, void *inbuf, int inlen, void *outbuf, int outlen)
+static int info_call(struct cman_handle *h, int msgtype, const void *inbuf, int inlen, void *outbuf, int outlen)
 {
 	if (send_message(h, msgtype, inbuf, inlen))
 		return -1;
@@ -752,7 +752,7 @@
 	return info_call(h, CMAN_CMD_GET_VERSION, NULL, 0, version, sizeof(cman_version_t));
 }
 
-int cman_set_version(cman_handle_t handle, cman_version_t *version)
+int cman_set_version(cman_handle_t handle, const cman_version_t *version)
 {
 	struct cman_handle *h = (struct cman_handle *)handle;
 	VALIDATE_HANDLE(h);
@@ -841,7 +841,7 @@
 	return info_call(h, CMAN_CMD_GETEXTRAINFO, NULL, 0, info, maxlen);
 }
 
-int cman_send_data(cman_handle_t handle, void *buf, int len, int flags, uint8_t port, int nodeid)
+int cman_send_data(cman_handle_t handle, const void *buf, int len, int flags, uint8_t port, int nodeid)
 {
 	struct cman_handle *h = (struct cman_handle *)handle;
 	struct iovec iov[2];
@@ -859,7 +859,7 @@
 	iov[0].iov_len = sizeof(header);
 	iov[0].iov_base = &header;
 	iov[1].iov_len = len;
-	iov[1].iov_base = buf;
+	iov[1].iov_base = (void *) buf;
 
 	return loopy_writev(h->fd, iov, 2);
 }
@@ -892,7 +892,7 @@
 }
 
 
-int cman_barrier_register(cman_handle_t handle, char *name, int flags, int nodes)
+int cman_barrier_register(cman_handle_t handle, const char *name, int flags, int nodes)
 {
 	struct cman_handle *h = (struct cman_handle *)handle;
 	struct cl_barrier_info binfo;
@@ -913,7 +913,7 @@
 }
 
 
-int cman_barrier_change(cman_handle_t handle, char *name, int flags, int arg)
+int cman_barrier_change(cman_handle_t handle, const char *name, int flags, int arg)
 {
 	struct cman_handle *h = (struct cman_handle *)handle;
 	struct cl_barrier_info binfo;
@@ -934,7 +934,7 @@
 
 }
 
-int cman_barrier_wait(cman_handle_t handle, char *name)
+int cman_barrier_wait(cman_handle_t handle, const char *name)
 {
 	struct cman_handle *h = (struct cman_handle *)handle;
 	struct cl_barrier_info binfo;
@@ -952,7 +952,7 @@
 	return info_call(h, CMAN_CMD_BARRIER, &binfo, sizeof(binfo), NULL, 0);
 }
 
-int cman_barrier_delete(cman_handle_t handle, char *name)
+int cman_barrier_delete(cman_handle_t handle, const char *name)
 {
 	struct cman_handle *h = (struct cman_handle *)handle;
 	struct cl_barrier_info binfo;
--- cluster/cman/lib/libcman.h	2006/10/05 07:48:33	1.29
+++ cluster/cman/lib/libcman.h	2007/05/02 10:27:07	1.30
@@ -1,7 +1,7 @@
 /******************************************************************************
 *******************************************************************************
 **
-**  Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
+**  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
 **
 **  This library is free software; you can redistribute it and/or
 **  modify it under the terms of the GNU Lesser General Public
@@ -321,7 +321,7 @@
 
 /* Change the config file version. This should be needed much less now, as cman will
    re-read the config file if a new node joins with a new config versoin */
-int cman_set_version(cman_handle_t handle, cman_version_t *version);
+int cman_set_version(cman_handle_t handle, const cman_version_t *version);
 
 /* Deprecated in favour of cman_shutdown(). Use cman_tool anyway please. */
 int cman_leave_cluster(cman_handle_t handle, int reason);
@@ -363,7 +363,7 @@
  * cman_start_recv_data() is like a bind(), and marks the port
  * as "listening". See cman_is_listening() above.
  */
-int cman_send_data(cman_handle_t handle, void *buf, int len, int flags, uint8_t port, int nodeid);
+int cman_send_data(cman_handle_t handle, const void *buf, int len, int flags, uint8_t port, int nodeid);
 int cman_start_recv_data(cman_handle_t handle, cman_datacallback_t, uint8_t port);
 int cman_end_recv_data(cman_handle_t handle);
 
@@ -372,10 +372,10 @@
  * Here for backwards compatibility. Most of the things you would achieve
  * with this can now be better done using openAIS services or just messaging.
  */
-int cman_barrier_register(cman_handle_t handle, char *name, int flags, int nodes);
-int cman_barrier_change(cman_handle_t handle, char *name, int flags, int arg);
-int cman_barrier_wait(cman_handle_t handle, char *name);
-int cman_barrier_delete(cman_handle_t handle, char *name);
+int cman_barrier_register(cman_handle_t handle, const char *name, int flags, int nodes);
+int cman_barrier_change(cman_handle_t handle, const char *name, int flags, int arg);
+int cman_barrier_wait(cman_handle_t handle, const char *name);
+int cman_barrier_delete(cman_handle_t handle, const char *name);
 
 /*
  * Add your own quorum device here, needs an admin socket



             reply	other threads:[~2007-05-02 10:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-02 10:27 pcaulfield [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-11-09 12:51 [Cluster-devel] cluster/cman/lib libcman.c libcman.h fabbione
2007-11-05 16:43 fabbione
2006-07-11  8:13 pcaulfield
2006-07-11 19:57 ` Lon Hohberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070502102708.18106.qmail@sourceware.org \
    --to=pcaulfield@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).