cpld: altera-epm240: Add additional IDCODEs
[fw/openocd] / src / server / server.h
index 061523346caa52d8e22404ead24ffb5852fc0870..bacd1116a15354364bae92acfc48552ac6d2c2da 100644 (file)
  *   GNU General Public License for more details.                          *
  *                                                                         *
  *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 
-#ifndef SERVER_H
-#define SERVER_H
+#ifndef OPENOCD_SERVER_SERVER_H
+#define OPENOCD_SERVER_SERVER_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <helper/log.h>
+#include <helper/replacements.h>
 
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
@@ -47,7 +50,7 @@ struct connection {
        struct sockaddr_in sin;
        struct command_context *cmd_ctx;
        struct service *service;
-       int input_pending;
+       bool input_pending;
        void *priv;
        struct connection *next;
 };
@@ -76,11 +79,16 @@ int add_service(char *name, const char *port,
                int max_connections, new_connection_handler_t new_connection_handler,
                input_handler_t in_handler, connection_closed_handler_t close_handler,
                void *priv);
+int remove_service(const char *name, const char *port);
+
+int server_host_os_entry(void);
+int server_host_os_close(void);
 
 int server_preinit(void);
 int server_init(struct command_context *cmd_ctx);
 int server_quit(void);
-void exit_on_signal(int);
+void server_free(void);
+void exit_on_signal(int sig);
 
 int server_loop(struct command_context *command_context);
 
@@ -89,15 +97,6 @@ int server_register_commands(struct command_context *context);
 int connection_write(struct connection *connection, const void *data, int len);
 int connection_read(struct connection *connection, void *data, int len);
 
-/**
- * Used by server_loop(), defined in server_stubs.c
- */
-void openocd_sleep_prelude(void);
-/**
- * Used by server_loop(), defined in server_stubs.c
- */
-void openocd_sleep_postlude(void);
-
 /**
  * Defines an extended command handler function declaration to enable
  * access to (and manipulation of) the server port number.
@@ -111,4 +110,4 @@ COMMAND_HELPER(server_port_command, unsigned short *out);
 #define ERROR_SERVER_REMOTE_CLOSED             (-400)
 #define ERROR_CONNECTION_REJECTED              (-401)
 
-#endif /* SERVER_H */
+#endif /* OPENOCD_SERVER_SERVER_H */