Просмотр исходного кода

Merge in split for command structure to be shared.

Brian Aker 14 лет назад
Родитель
Сommit
dc85b16193

+ 2 - 1
libgearman-server/include.am

@@ -71,7 +71,8 @@ libgearman_server_libgearman_server_la_SOURCES+= \
 						 libgearman-server/server.c \
 						 libgearman-server/thread.c \
 						 libgearman-server/wakeup.cc \
-						 libgearman-server/worker.cc
+						 libgearman-server/worker.cc \
+						 libgearman/command.cc
 
 libgearman_server_libgearman_server_la_CFLAGS+= \
 					       ${AM_CFLAGS} \

+ 13 - 59
libgearman-server/packet.cc

@@ -13,6 +13,9 @@
 
 #include <libgearman-server/common.h>
 
+#define GEARMAN_CORE
+#include <libgearman/command.h>
+
 #include <libgearman-server/fifo.h>
 #include <assert.h>
 #include <cstring>
@@ -198,59 +201,10 @@ gearman_server_proc_packet_remove(gearman_server_con_st *con)
   return server_packet;
 }
 
-/**
- * Command info. Update GEARMAN_MAX_COMMAND_ARGS to the largest number in the
- * args column.
- */
-gearman_command_info_st gearmand_command_info_list[GEARMAN_COMMAND_MAX]=
-{
-  { "TEXT",               3, false },
-  { "CAN_DO",             1, false },
-  { "CANT_DO",            1, false },
-  { "RESET_ABILITIES",    0, false },
-  { "PRE_SLEEP",          0, false },
-  { "UNUSED",             0, false },
-  { "NOOP",               0, false },
-  { "SUBMIT_JOB",         2, true  },
-  { "JOB_CREATED",        1, false },
-  { "GRAB_JOB",           0, false },
-  { "NO_JOB",             0, false },
-  { "JOB_ASSIGN",         2, true  },
-  { "WORK_STATUS",        3, false },
-  { "WORK_COMPLETE",      1, true  },
-  { "WORK_FAIL",          1, false },
-  { "GET_STATUS",         1, false },
-  { "ECHO_REQ",           0, true  },
-  { "ECHO_RES",           0, true  },
-  { "SUBMIT_JOB_BG",      2, true  },
-  { "ERROR",              2, false },
-  { "STATUS_RES",         5, false },
-  { "SUBMIT_JOB_HIGH",    2, true  },
-  { "SET_CLIENT_ID",      1, false },
-  { "CAN_DO_TIMEOUT",     2, false },
-  { "ALL_YOURS",          0, false },
-  { "WORK_EXCEPTION",     1, true  },
-  { "OPTION_REQ",         1, false },
-  { "OPTION_RES",         1, false },
-  { "WORK_DATA",          1, true  },
-  { "WORK_WARNING",       1, true  },
-  { "GRAB_JOB_UNIQ",      0, false },
-  { "JOB_ASSIGN_UNIQ",    3, true  },
-  { "SUBMIT_JOB_HIGH_BG", 2, true  },
-  { "SUBMIT_JOB_LOW",     2, true  },
-  { "SUBMIT_JOB_LOW_BG",  2, true  },
-  { "SUBMIT_JOB_SCHED",   7, true  },
-  { "SUBMIT_JOB_EPOCH",   3, true  },
-  { "GEARMAN_COMMAND_SUBMIT_REDUCE_JOB", 4, true },
-  { "GEARMAN_COMMAND_SUBMIT_REDUCE_JOB_BACKGROUND", 4, true },
-  { "GEARMAN_COMMAND_GRAB_JOB_ALL",    0, false  },
-  { "GEARMAN_COMMAND_JOB_ASSIGN_ALL",    4, true  }
-};
-
 const char *gearmand_strcommand(gearmand_packet_st *packet)
 {
   assert(packet);
-  return gearmand_command_info_list[packet->command].name;
+  return gearman_command_info(packet->command)->name;
 }
 
 inline static gearmand_error_t packet_create_arg(gearmand_packet_st *packet,
@@ -259,15 +213,15 @@ inline static gearmand_error_t packet_create_arg(gearmand_packet_st *packet,
   void *new_args;
   size_t offset;
 
-  if (packet->argc == gearmand_command_info_list[packet->command].argc &&
-      (! (gearmand_command_info_list[packet->command].data) ||
+  if (packet->argc == gearman_command_info(packet->command)->argc &&
+      (not (gearman_command_info(packet->command)->data) ||
        packet->data != NULL))
   {
-    gearmand_log_error("too many arguments for command(%s)", gearmand_command_info_list[packet->command].name);
+    gearmand_log_error("too many arguments for command(%s)", gearman_command_info(packet->command)->name);
     return GEARMAN_TOO_MANY_ARGS;
   }
 
-  if (packet->argc == gearmand_command_info_list[packet->command].argc)
+  if (packet->argc == gearman_command_info(packet->command)->argc)
   {
     packet->data= static_cast<const char *>(arg);
     packet->data_size= arg_size;
@@ -562,15 +516,15 @@ size_t gearmand_packet_unpack(gearmand_packet_st *packet,
     used_size= 0;
   }
 
-  while (packet->argc != gearmand_command_info_list[packet->command].argc)
+  while (packet->argc != gearman_command_info(packet->command)->argc)
   {
-    if (packet->argc != (gearmand_command_info_list[packet->command].argc - 1) ||
-        gearmand_command_info_list[packet->command].data)
+    if (packet->argc != (gearman_command_info(packet->command)->argc - 1) ||
+        gearman_command_info(packet->command)->data)
     {
       ptr= (uint8_t *)memchr(((uint8_t *)data) + used_size, 0, data_size - used_size);
-      if (ptr == NULL)
+      if (not ptr)
       {
-        gearmand_log_crazy("Possible protocol error for %s, recieved only %u args", gearmand_command_info_list[packet->command].name, packet->argc);
+        gearmand_log_crazy("Possible protocol error for %s, recieved only %u args", gearman_command_info(packet->command)->name, packet->argc);
         *ret_ptr= GEARMAN_IO_WAIT;
         return used_size;
       }

+ 0 - 14
libgearman-server/packet.h

@@ -50,13 +50,6 @@ struct gearmand_packet_st
   char args_buffer[GEARMAN_ARGS_BUFFER_SIZE];
 };
 
-struct gearman_command_info_st
-{
-  const char *name;
-  const uint8_t argc; // Number of arguments to commands.
-  const bool data;
-};
-
 /**
  * @addtogroup gearman_server_packet Packet Declarations
  * @ingroup gearman_server
@@ -123,13 +116,6 @@ GEARMAN_API
 gearman_server_packet_st *
 gearman_server_proc_packet_remove(gearman_server_con_st *con);
 
-/**
- * Command information array.
- * @ingroup gearman_constants
- */
-extern GEARMAN_INTERNAL_API
-struct gearman_command_info_st gearmand_command_info_list[GEARMAN_COMMAND_MAX];
-
 
 /**
  * Initialize a packet structure.

+ 14 - 2
libgearman-server/thread.c

@@ -13,9 +13,21 @@
 
 #include <libgearman-server/common.h>
 
+#define GEARMAN_CORE
+#include <libgearman/command.h>
+
+#ifdef __cplusplus
+
+#include <cassert>
+#include <cerrno>
+
+#else
+
 #include <assert.h>
 #include <errno.h>
 
+#endif
+
 /*
  * Private declarations
  */
@@ -297,7 +309,7 @@ static gearmand_error_t _thread_packet_read(gearman_server_con_st *con)
     gearmand_log_debug("%15s:%5u Received  %s",
                        con->_host == NULL ? "-" : con->_host,
                        con->_port == NULL ? "-" : con->_port,
-                       gearmand_command_info_list[con->packet->packet.command].name);
+                       gearman_command_info(con->packet->packet.command)->name);
 
     /* We read a complete packet. */
     if (Server->flags.threaded)
@@ -341,7 +353,7 @@ static gearmand_error_t _thread_packet_flush(gearman_server_con_st *con)
     gearmand_log_debug("%15s:%5d Sent      %s",
                        con->_host == NULL ? "-" : con->_host,
                        con->_port == NULL ? "-" : con->_port,
-                       gearmand_command_info_list[con->io_packet_list->packet.command].name);
+                       gearman_command_info(con->io_packet_list->packet.command)->name);
 
     gearman_server_io_packet_remove(con);
   }

+ 98 - 0
libgearman/command.cc

@@ -0,0 +1,98 @@
+/*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ * 
+ *  Gearmand client and server library.
+ *
+ *  Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ *  Copyright (C) 2008 Brian Aker, Eric Day
+ *  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are
+ *  met:
+ *
+ *      * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ *
+ *      * Redistributions in binary form must reproduce the above
+ *  copyright notice, this list of conditions and the following disclaimer
+ *  in the documentation and/or other materials provided with the
+ *  distribution.
+ *
+ *      * The names of its contributors may not be used to endorse or
+ *  promote products derived from this software without specific prior
+ *  written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <config.h>
+
+#define GEARMAN_CORE
+
+#include <libgearman/visibility.h>
+#include <libgearman/command.h>
+
+/**
+ * Command info. Update GEARMAN_MAX_COMMAND_ARGS to the largest number in the
+ * args column.
+ */
+gearman_command_info_st gearmand_command_info_list[GEARMAN_COMMAND_MAX]=
+{
+  { "TEXT",               3, false },
+  { "CAN_DO",             1, false },
+  { "CANT_DO",            1, false },
+  { "RESET_ABILITIES",    0, false },
+  { "PRE_SLEEP",          0, false },
+  { "UNUSED",             0, false },
+  { "NOOP",               0, false },
+  { "SUBMIT_JOB",         2, true  },
+  { "JOB_CREATED",        1, false },
+  { "GRAB_JOB",           0, false },
+  { "NO_JOB",             0, false },
+  { "JOB_ASSIGN",         2, true  },
+  { "WORK_STATUS",        3, false },
+  { "WORK_COMPLETE",      1, true  },
+  { "WORK_FAIL",          1, false },
+  { "GET_STATUS",         1, false },
+  { "ECHO_REQ",           0, true  },
+  { "ECHO_RES",           0, true  },
+  { "SUBMIT_JOB_BG",      2, true  },
+  { "ERROR",              2, false },
+  { "STATUS_RES",         5, false },
+  { "SUBMIT_JOB_HIGH",    2, true  },
+  { "SET_CLIENT_ID",      1, false },
+  { "CAN_DO_TIMEOUT",     2, false },
+  { "ALL_YOURS",          0, false },
+  { "WORK_EXCEPTION",     1, true  },
+  { "OPTION_REQ",         1, false },
+  { "OPTION_RES",         1, false },
+  { "WORK_DATA",          1, true  },
+  { "WORK_WARNING",       1, true  },
+  { "GRAB_JOB_UNIQ",      0, false },
+  { "JOB_ASSIGN_UNIQ",    3, true  },
+  { "SUBMIT_JOB_HIGH_BG", 2, true  },
+  { "SUBMIT_JOB_LOW",     2, true  },
+  { "SUBMIT_JOB_LOW_BG",  2, true  },
+  { "SUBMIT_JOB_SCHED",   7, true  },
+  { "SUBMIT_JOB_EPOCH",   3, true  },
+  { "GEARMAN_COMMAND_SUBMIT_REDUCE_JOB", 4, true },
+  { "GEARMAN_COMMAND_SUBMIT_REDUCE_JOB_BACKGROUND", 4, true },
+  { "GEARMAN_COMMAND_GRAB_JOB_ALL",    0, false  },
+  { "GEARMAN_COMMAND_JOB_ASSIGN_ALL",    4, true  }
+};
+
+gearman_command_info_st *gearman_command_info(gearman_command_t command)
+{
+  return &gearmand_command_info_list[command];
+}

+ 46 - 16
libgearman/command.h

@@ -1,34 +1,64 @@
-/* Gearman server and library
- * Copyright (C) 2008 Brian Aker, Eric Day
- * All rights reserved.
+/*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ * 
+ *  Gearmand client and server library.
+ *
+ *  Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ *  Copyright (C) 2008 Brian Aker, Eric Day
+ *  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are
+ *  met:
+ *
+ *      * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ *
+ *      * Redistributions in binary form must reproduce the above
+ *  copyright notice, this list of conditions and the following disclaimer
+ *  in the documentation and/or other materials provided with the
+ *  distribution.
+ *
+ *      * The names of its contributors may not be used to endorse or
+ *  promote products derived from this software without specific prior
+ *  written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * Use and distribution licensed under the BSD license.  See
- * the COPYING file in the parent directory for full text.
  */
 
-/**
- * @file
- * @brief Definition for gearman_command_info_st
- */
 
 #pragma once
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <libgearman/protocol.h>
 
 #ifdef GEARMAN_CORE
-/**
- * @ingroup gearman_packet
- */
+
 struct gearman_command_info_st
 {
   const char *name;
   const uint8_t argc; // Number of arguments to commands.
   const bool data;
 };
-#endif /* GEARMAN_CORE */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+GEARMAN_LOCAL
+  struct gearman_command_info_st *gearman_command_info(gearman_command_t command);
 
 #ifdef __cplusplus
 }
 #endif
+
+#endif /* GEARMAN_CORE */

+ 0 - 1
libgearman/constants.h

@@ -168,7 +168,6 @@ typedef enum
 
 /* Types. */
 typedef struct gearman_packet_st gearman_packet_st;
-typedef struct gearman_command_info_st gearman_command_info_st;
 typedef struct gearman_task_st gearman_task_st;
 typedef struct gearman_client_st gearman_client_st;
 typedef struct gearman_job_st gearman_job_st;

+ 2 - 0
libgearman/include.am

@@ -48,6 +48,7 @@ noinst_HEADERS+= \
 noinst_LTLIBRARIES+= libgearman/libgearmancore.la
 libgearman_libgearmancore_la_SOURCES= \
 				      libgearman/byteorder.cc \
+				      libgearman/command.cc \
 				      libgearman/connection.cc \
 				      libgearman/log.cc \
 				      libgearman/packet.cc \
@@ -62,6 +63,7 @@ libgearman_libgearman_la_SOURCES= \
 				  libgearman/add.cc \
 				  libgearman/byteorder.cc \
 				  libgearman/client.cc \
+				  libgearman/command.cc \
 				  libgearman/connection.cc \
 				  libgearman/gearman.cc \
 				  libgearman/job.cc \

+ 11 - 67
libgearman/packet.cc

@@ -42,6 +42,7 @@
  */
 
 #include <libgearman/common.h>
+#include <libgearman/command.h>
 #include <cassert>
 #include <cerrno>
 #include <cstdlib>
@@ -54,55 +55,6 @@
  * @{
  */
 
-/**
- * Command info. Update GEARMAN_MAX_COMMAND_ARGS to the largest number in the
- * args column.
- */
-gearman_command_info_st gearman_command_info_list[GEARMAN_COMMAND_MAX]=
-{
-  { "TEXT",               3, false },
-  { "CAN_DO",             1, false },
-  { "CANT_DO",            1, false },
-  { "RESET_ABILITIES",    0, false },
-  { "PRE_SLEEP",          0, false },
-  { "UNUSED",             0, false },
-  { "NOOP",               0, false },
-  { "SUBMIT_JOB",         2, true  },
-  { "JOB_CREATED",        1, false },
-  { "GRAB_JOB",           0, false },
-  { "NO_JOB",             0, false },
-  { "JOB_ASSIGN",         2, true  },
-  { "WORK_STATUS",        3, false },
-  { "WORK_COMPLETE",      1, true  },
-  { "WORK_FAIL",          1, false },
-  { "GET_STATUS",         1, false },
-  { "ECHO_REQ",           0, true  },
-  { "ECHO_RES",           0, true  },
-  { "SUBMIT_JOB_BG",      2, true  },
-  { "ERROR",              2, false },
-  { "STATUS_RES",         5, false },
-  { "SUBMIT_JOB_HIGH",    2, true  },
-  { "SET_CLIENT_ID",      1, false },
-  { "CAN_DO_TIMEOUT",     2, false },
-  { "ALL_YOURS",          0, false },
-  { "WORK_EXCEPTION",     1, true  },
-  { "OPTION_REQ",         1, false },
-  { "OPTION_RES",         1, false },
-  { "WORK_DATA",          1, true  },
-  { "WORK_WARNING",       1, true  },
-  { "GRAB_JOB_UNIQ",      0, false },
-  { "JOB_ASSIGN_UNIQ",    3, true  },
-  { "SUBMIT_JOB_HIGH_BG", 2, true  },
-  { "SUBMIT_JOB_LOW",     2, true  },
-  { "SUBMIT_JOB_LOW_BG",  2, true  },
-  { "SUBMIT_JOB_SCHED",   7, true  },
-  { "SUBMIT_JOB_EPOCH",   3, true  },
-  { "GEARMAN_COMMAND_SUBMIT_REDUCE_JOB", 4, true },          /* C->J: MAP[0]REDUCER[0]UNIQ[0]AGGREGATOR[0]ARGS */
-  { "GEARMAN_COMMAND_SUBMIT_REDUCE_JOB_BACKGROUND", 4, true },          /* C->J: MAP[0]REDUCER[0]UNIQ[0]AGGREGATOR[0]ARGS */
-  { "GEARMAN_COMMAND_GRAB_JOB_ALL",    0, false  },
-  { "GEARMAN_COMMAND_JOB_ASSIGN_ALL",    4, true  }
-};
-
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wold-style-cast"
 #endif
@@ -110,15 +62,15 @@ gearman_command_info_st gearman_command_info_list[GEARMAN_COMMAND_MAX]=
 inline static gearman_return_t packet_create_arg(gearman_packet_st *packet,
                                                  const void *arg, size_t arg_size)
 {
-  if (packet->argc == gearman_command_info_list[packet->command].argc and
-      (not (gearman_command_info_list[packet->command].data) || packet->data != NULL))
+  if (packet->argc == gearman_command_info(packet->command)->argc and
+      (not (gearman_command_info(packet->command)->data) || packet->data != NULL))
   {
     gearman_universal_set_error(packet->universal, GEARMAN_TOO_MANY_ARGS, AT, "too many arguments for command (%s)",
-                                gearman_command_info_list[packet->command].name);
+                                gearman_command_info(packet->command)->name);
     return GEARMAN_TOO_MANY_ARGS;
   }
 
-  if (packet->argc == gearman_command_info_list[packet->command].argc)
+  if (packet->argc == gearman_command_info(packet->command)->argc)
   {
     packet->data= arg;
     packet->data_size= arg_size;
@@ -254,13 +206,13 @@ gearman_return_t gearman_packet_create_args(gearman_universal_st *gearman,
   packet->magic= magic;
   packet->command= command;
 
-  if (gearman_command_info_list[packet->command].data)
+  if (gearman_command_info(packet->command)->data)
   {
-    assert(args_count -1 == gearman_command_info_list[packet->command].argc);
+    assert(args_count -1 == gearman_command_info(packet->command)->argc);
   }
   else
   {
-    assert(args_count == gearman_command_info_list[packet->command].argc);
+    assert(args_count == gearman_command_info(packet->command)->argc);
   }
 
   for (size_t x= 0; x < args_count; x++)
@@ -525,19 +477,11 @@ size_t gearman_packet_unpack(gearman_packet_st *packet,
     used_size= 0;
   }
 
-#if 0
-  std::cerr << __func__ << " " << gearman_command_info_list[packet->command].name << std::endl;
-#endif
-  while (packet->argc != gearman_command_info_list[packet->command].argc)
+  while (packet->argc != gearman_command_info(packet->command)->argc)
   {
-    if (packet->argc != (gearman_command_info_list[packet->command].argc - 1) ||
-        gearman_command_info_list[packet->command].data)
+    if (packet->argc != (gearman_command_info(packet->command)->argc - 1) ||
+        gearman_command_info(packet->command)->data)
     {
-#if 0
-      std::cerr << __func__ << " Failing in protocol " 
-        << gearman_command_info_list[packet->command].name
-        << " " << int(packet->argc) << " != " << gearman_command_info_list[packet->command].argc -1 <<  std::endl;
-#endif
 
       uint8_t *ptr= (uint8_t *)memchr((char *)data + used_size, 0, data_size - used_size);
       if (not ptr)

+ 12 - 2
libgearman/protocol.h

@@ -13,7 +13,7 @@
 #define GEARMAN_DEFAULT_TCP_PORT_STRING "4730"
 #define GEARMAN_DEFAULT_TCP_SERVICE "gearman"
 
-typedef enum
+enum gearman_command_t
 {
   GEARMAN_COMMAND_TEXT,
   GEARMAN_COMMAND_CAN_DO,              /* W->J: FUNC */
@@ -57,4 +57,14 @@ typedef enum
   GEARMAN_COMMAND_GRAB_JOB_ALL,          /* J->W -- */
   GEARMAN_COMMAND_JOB_ASSIGN_ALL,          /* J->W: MAP[0]UNIQ[0]REDUCER[0]ARGS */
   GEARMAN_COMMAND_MAX /* Always add new commands before this. */
-} gearman_command_t;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum gearman_command_t gearman_command_t;
+
+#ifdef __cplusplus
+}
+#endif

Некоторые файлы не были показаны из-за большого количества измененных файлов