tree-wide: s/_EP_/_ENDPOINT_/g (API break)
authorDaniel Mack <daniel@zonque.org>
Wed, 8 Oct 2014 11:52:41 +0000 (13:52 +0200)
committerDaniel Mack <daniel@zonque.org>
Wed, 8 Oct 2014 15:11:11 +0000 (17:11 +0200)
Avoid abbr. and rename EP → ENDPOINT.

Signed-off-by: Daniel Mack <daniel@zonque.org>
endpoint.h
handle.c
kdbus.h
kdbus.txt
test/kdbus-enum.c
test/test-endpoint.c

index 52263caad8a3e76b5f4d665669c23b29955633b8..018c74ad177be3d34fdc674a110160f3cb73b56c 100644 (file)
@@ -11,8 +11,8 @@
  * your option) any later version.
  */
 
-#ifndef __KDBUS_EP_H
-#define __KDBUS_EP_H
+#ifndef __KDBUS_ENDPOINT_H
+#define __KDBUS_ENDPOINT_H
 
 #include <linux/device.h>
 #include "limits.h"
index d08b5dda433879ebc410e3e2c798b6f0c8ec158c..d8d618db0980d66f11a05f122606c91ac2269c67 100644 (file)
--- a/handle.c
+++ b/handle.c
@@ -44,8 +44,8 @@
  * @KDBUS_HANDLE_CONTROL_DOMAIN_OWNER: File descriptor to hold a domain
  * @KDBUS_HANDLE_CONTROL_BUS_OWNER:    File descriptor to hold a bus
  * @KDBUS_HANDLE_EP:                   New file descriptor of a bus node
- * @KDBUS_HANDLE_EP_CONNECTED:         A bus connection after HELLO
- * @KDBUS_HANDLE_EP_OWNER:             File descriptor to hold an endpoint
+ * @KDBUS_HANDLE_ENDPOINT_CONNECTED:   A bus connection after HELLO
+ * @KDBUS_HANDLE_ENDPOINT_OWNER:       File descriptor to hold an endpoint
  */
 enum kdbus_handle_type {
        _KDBUS_HANDLE_NULL,
@@ -53,8 +53,8 @@ enum kdbus_handle_type {
        KDBUS_HANDLE_CONTROL_DOMAIN_OWNER,
        KDBUS_HANDLE_CONTROL_BUS_OWNER,
        KDBUS_HANDLE_EP,
-       KDBUS_HANDLE_EP_CONNECTED,
-       KDBUS_HANDLE_EP_OWNER,
+       KDBUS_HANDLE_ENDPOINT_CONNECTED,
+       KDBUS_HANDLE_ENDPOINT_OWNER,
 };
 
 /**
@@ -63,8 +63,8 @@ enum kdbus_handle_type {
  * @domain:            Domain for this handle
  * @meta:              Cached connection creator's metadata/credentials
  * @ep:                        The endpoint for this handle, in case @type is
- *                     KDBUS_HANDLE_EP, KDBUS_HANDLE_EP_OWNER or
- *                     KDBUS_HANDLE_EP_CONNECTED
+ *                     KDBUS_HANDLE_EP, KDBUS_HANDLE_ENDPOINT_OWNER or
+ *                     KDBUS_HANDLE_ENDPOINT_CONNECTED
  * @ptr:               Generic pointer used as alias for other members
  *                     in the same union by kdbus_handle_transform()
  * @domain_owner:      The domain this handle owns, in case @type
@@ -72,10 +72,10 @@ enum kdbus_handle_type {
  * @bus_owner:         The bus this handle owns, in case @type
  *                     is KDBUS_HANDLE_CONTROL_BUS_OWNER
  * @ep_owner:          The endpoint this handle owns, in case @type
- *                     is KDBUS_HANDLE_EP_OWNER
+ *                     is KDBUS_HANDLE_ENDPOINT_OWNER
  * @conn:              The connection this handle owns, in case @type
  *                     is KDBUS_HANDLE_EP, after HELLO it is
- *                     KDBUS_HANDLE_EP_CONNECTED
+ *                     KDBUS_HANDLE_ENDPOINT_CONNECTED
  */
 struct kdbus_handle {
        enum kdbus_handle_type type;
@@ -175,12 +175,12 @@ static int kdbus_handle_release(struct inode *inode, struct file *file)
                kdbus_bus_unref(handle->bus_owner);
                break;
 
-       case KDBUS_HANDLE_EP_OWNER:
+       case KDBUS_HANDLE_ENDPOINT_OWNER:
                kdbus_ep_disconnect(handle->ep_owner);
                kdbus_ep_unref(handle->ep_owner);
                break;
 
-       case KDBUS_HANDLE_EP_CONNECTED:
+       case KDBUS_HANDLE_ENDPOINT_CONNECTED:
                kdbus_conn_disconnect(handle->conn, false);
                kdbus_conn_unref(handle->conn);
                break;
@@ -412,7 +412,7 @@ static long kdbus_handle_ioctl_ep(struct file *file, unsigned int cmd,
        long ret = 0;
 
        switch (cmd) {
-       case KDBUS_CMD_EP_MAKE: {
+       case KDBUS_CMD_ENDPOINT_MAKE: {
                struct kdbus_cmd_make *make;
                umode_t mode = 0;
                kgid_t gid = KGIDT_INIT(0);
@@ -486,7 +486,7 @@ static long kdbus_handle_ioctl_ep(struct file *file, unsigned int cmd,
 
                /* turn the ep fd into a new endpoint owner device */
                ret = kdbus_handle_transform(handle, KDBUS_HANDLE_EP,
-                                            KDBUS_HANDLE_EP_OWNER, ep);
+                                            KDBUS_HANDLE_ENDPOINT_OWNER, ep);
                if (ret < 0) {
                        kdbus_ep_disconnect(ep);
                        kdbus_ep_unref(ep);
@@ -531,7 +531,7 @@ static long kdbus_handle_ioctl_ep(struct file *file, unsigned int cmd,
 
                /* turn the ep fd into a new connection */
                ret = kdbus_handle_transform(handle, KDBUS_HANDLE_EP,
-                                            KDBUS_HANDLE_EP_CONNECTED,
+                                            KDBUS_HANDLE_ENDPOINT_CONNECTED,
                                             conn);
                if (ret < 0) {
                        kdbus_conn_disconnect(conn, false);
@@ -886,7 +886,7 @@ static long kdbus_handle_ioctl_ep_owner(struct file *file, unsigned int cmd,
        long ret = 0;
 
        switch (cmd) {
-       case KDBUS_CMD_EP_UPDATE: {
+       case KDBUS_CMD_ENDPOINT_UPDATE: {
                struct kdbus_cmd_update *cmd_update;
 
                /* update the properties of a custom endpoint */
@@ -934,10 +934,10 @@ static long kdbus_handle_ioctl(struct file *file, unsigned int cmd,
        case KDBUS_HANDLE_EP:
                return kdbus_handle_ioctl_ep(file, cmd, argp);
 
-       case KDBUS_HANDLE_EP_CONNECTED:
+       case KDBUS_HANDLE_ENDPOINT_CONNECTED:
                return kdbus_handle_ioctl_ep_connected(file, cmd, argp);
 
-       case KDBUS_HANDLE_EP_OWNER:
+       case KDBUS_HANDLE_ENDPOINT_OWNER:
                return kdbus_handle_ioctl_ep_owner(file, cmd, argp);
 
        default:
@@ -953,7 +953,7 @@ static unsigned int kdbus_handle_poll(struct file *file,
        unsigned int mask = POLLOUT | POLLWRNORM;
 
        /* Only a connected endpoint can read/write data */
-       if (handle->type != KDBUS_HANDLE_EP_CONNECTED)
+       if (handle->type != KDBUS_HANDLE_ENDPOINT_CONNECTED)
                return POLLERR | POLLHUP;
 
        /* make sure handle->conn is set if handle->type is */
@@ -976,7 +976,7 @@ static int kdbus_handle_mmap(struct file *file, struct vm_area_struct *vma)
 {
        struct kdbus_handle *handle = file->private_data;
 
-       if (handle->type != KDBUS_HANDLE_EP_CONNECTED)
+       if (handle->type != KDBUS_HANDLE_ENDPOINT_CONNECTED)
                return -EPERM;
 
        /* make sure handle->conn is set if handle->type is */
diff --git a/kdbus.h b/kdbus.h
index b227c513eb7cfe63531be65844786183747c9b8d..79a17f3449a55cd9ce36019f1a90e0e99c85a4eb 100644 (file)
--- a/kdbus.h
+++ b/kdbus.h
@@ -602,8 +602,8 @@ enum kdbus_make_flags {
  * @flags:             Properties for the bus/ep/domain to create
  * @items:             Items describing details
  *
- * This structure is used with the KDBUS_CMD_BUS_MAKE, KDBUS_CMD_EP_MAKE and
- * KDBUS_CMD_DOMAIN_MAKE ioctls.
+ * This structure is used with the KDBUS_CMD_BUS_MAKE, KDBUS_CMD_ENDPOINT_MAKE
+ * and KDBUS_CMD_DOMAIN_MAKE ioctls.
  */
 struct kdbus_cmd_make {
        __u64 size;
@@ -779,7 +779,7 @@ struct kdbus_cmd_match {
  *                             is closed.
  * @KDBUS_CMD_DOMAIN_MAKE:     Similar to KDBUS_CMD_BUS_MAKE, but it creates a
  *                             new kdbus domain.
- * @KDBUS_CMD_EP_MAKE:         Creates a new named special endpoint to talk to
+ * @KDBUS_CMD_ENDPOINT_MAKE:   Creates a new named special endpoint to talk to
  *                             the bus. Such endpoints usually carry a more
  *                             restrictive policy and grant restricted access
  *                             to specific applications.
@@ -815,7 +815,7 @@ struct kdbus_cmd_match {
  * @KDBUS_CMD_CONN_UPDATE:     Update the properties of a connection. Used to
  *                             update the metadata subscription mask and
  *                             policy.
- * @KDBUS_CMD_EP_UPDATE:       Update the properties of a custom enpoint. Used
+ * @KDBUS_CMD_ENDPOINT_UPDATE: Update the properties of a custom enpoint. Used
  *                             to update the policy.
  * @KDBUS_CMD_MATCH_ADD:       Install a match which broadcast messages should
  *                             be delivered to the connection.
@@ -826,7 +826,7 @@ enum kdbus_ioctl_type {
                                             struct kdbus_cmd_make),
        KDBUS_CMD_DOMAIN_MAKE =         _IOW(KDBUS_IOCTL_MAGIC, 0x10,
                                             struct kdbus_cmd_make),
-       KDBUS_CMD_EP_MAKE =             _IOW(KDBUS_IOCTL_MAGIC, 0x20,
+       KDBUS_CMD_ENDPOINT_MAKE =       _IOW(KDBUS_IOCTL_MAGIC, 0x20,
                                             struct kdbus_cmd_make),
 
        KDBUS_CMD_HELLO =               _IOWR(KDBUS_IOCTL_MAGIC, 0x30,
@@ -854,7 +854,7 @@ enum kdbus_ioctl_type {
        KDBUS_CMD_CONN_UPDATE =         _IOW(KDBUS_IOCTL_MAGIC, 0x61,
                                             struct kdbus_cmd_update),
 
-       KDBUS_CMD_EP_UPDATE =           _IOW(KDBUS_IOCTL_MAGIC, 0x71,
+       KDBUS_CMD_ENDPOINT_UPDATE =     _IOW(KDBUS_IOCTL_MAGIC, 0x71,
                                             struct kdbus_cmd_update),
 
        KDBUS_CMD_MATCH_ADD =           _IOW(KDBUS_IOCTL_MAGIC, 0x80,
index 74082c4e43bd42678f1667a5eebffda897358e67..2f3602855c89e29d4d112cc10614797955eaa964 100644 (file)
--- a/kdbus.txt
+++ b/kdbus.txt
@@ -292,7 +292,7 @@ Endpoints are entry points to a bus. By default, each bus has a default
 endpoint called 'bus'. The bus owner has the ability to create custom
 endpoints with specific names, permissions, and policy databases (see below).
 
-To create a custom endpoint, use the KDBUS_CMD_EP_MAKE ioctl with struct
+To create a custom endpoint, use the KDBUS_CMD_ENDPOINT_MAKE ioctl with struct
 kdbus_cmd_make. Custom endpoints always have a policy db that, by default,
 does not allow anything. Everything that users of this new endpoint should be
 able to do has to be explicitly specified through KDBUS_ITEM_NAME and
@@ -301,8 +301,8 @@ KDBUS_ITEM_POLICY_ACCESS items.
 5.3 Creating domains, buses and endpoints
 -----------------------------------------
 
-KDBUS_CMD_BUS_MAKE, KDBUS_CMD_DOMAIN_MAKE and KDBUS_CMD_EP_MAKE take a struct
-kdbus_cmd_make argument.
+KDBUS_CMD_BUS_MAKE, KDBUS_CMD_DOMAIN_MAKE and KDBUS_CMD_ENDPOINT_MAKE take a
+struct kdbus_cmd_make argument.
 
 struct kdbus_cmd_make {
   __u64 size;
@@ -1327,10 +1327,10 @@ struct kdbus_policy_access {
 
 Policies are set through KDBUS_CMD_HELLO (when creating a policy holder
 connection), KDBUS_CMD_CONN_UPDATE (when updating a policy holder connection),
-KDBUS_CMD_EP_MAKE (creating a custom endpoint) or KDBUS_CMD_EP_UPDATE (updating
-a custom endpoint). In all cases, the name and policy access information is
-stored in items of type KDBUS_ITEM_NAME and KDBUS_ITEM_POLICY_ACCESS. For this
-transport, the following rules apply.
+KDBUS_CMD_ENDPOINT_MAKE (creating a custom endpoint) or
+KDBUS_CMD_ENDPOINT_UPDATE (updating a custom endpoint). In all cases, the name
+and policy access information is stored in items of type KDBUS_ITEM_NAME and
+KDBUS_ITEM_POLICY_ACCESS. For this transport, the following rules apply.
 
   * An item of type KDBUS_ITEM_NAME must be followed by at least one
     KDBUS_ITEM_POLICY_ACCESS item
@@ -1561,7 +1561,7 @@ KDBUS_CMD_DOMAIN_MAKE
   -EINVAL      No name supplied for top-level domain
   -EEXIST      A domain of that name already exists
 
-KDBUS_CMD_EP_MAKE
+KDBUS_CMD_ENDPOINT_MAKE
 
   -EPERM       The calling user is not privileged (see Terminology)
   -EOPNOTSUPP  The flags supplied in the kdbus_cmd_make struct are invalid
@@ -1682,7 +1682,7 @@ For KDBUS_CMD_CONN_UPDATE:
   -EINVAL      Wildcards submitted in policy entries, or illegal sequence
                of policy items
 
-For KDBUS_CMD_EP_UPDATE:
+For KDBUS_CMD_ENDPOINT_UPDATE:
 
   -E2BIG       Too many policy items attached
   -EINVAL      Wildcards submitted in policy entries, or illegal sequence
index df68aa3c2168ae1121ebb2023d735d8e85d7670e..7be41fbb0201abe72957e89f61fe674b6c188345 100644 (file)
@@ -39,7 +39,7 @@ struct kdbus_enum_table {
 TABLE(CMD) = {
        ENUM(KDBUS_CMD_BUS_MAKE),
        ENUM(KDBUS_CMD_DOMAIN_MAKE),
-       ENUM(KDBUS_CMD_EP_MAKE),
+       ENUM(KDBUS_CMD_ENDPOINT_MAKE),
        ENUM(KDBUS_CMD_HELLO),
        ENUM(KDBUS_CMD_MSG_SEND),
        ENUM(KDBUS_CMD_MSG_RECV),
index 1ff7bf5bacbf6574bd40d3a99ac80ee67d3d59be..390a65b0db73bd3ee2b8e1795384aca7cfd17884 100644 (file)
@@ -74,7 +74,7 @@ static int create_endpoint(const char *buspath, const char *name)
        ep_make.head.size = sizeof(ep_make.head) +
                            ep_make.name.size;
 
-       ret = ioctl(fd, KDBUS_CMD_EP_MAKE, &ep_make);
+       ret = ioctl(fd, KDBUS_CMD_ENDPOINT_MAKE, &ep_make);
        if (ret < 0)
                return ret;
 
@@ -115,7 +115,7 @@ static int update_endpoint(int fd, const char *name)
 
        ep_update.head.size = sizeof(ep_update);
 
-       ret = ioctl(fd, KDBUS_CMD_EP_UPDATE, &ep_update);
+       ret = ioctl(fd, KDBUS_CMD_ENDPOINT_UPDATE, &ep_update);
        if (ret < 0)
                return -errno;