diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-12-16 22:20:10 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-12-16 22:20:10 +0000 |
commit | 0fc19255c365a59acf4683d177bacf662e84d4f1 (patch) | |
tree | 3040742475f5489e629a5e2185e3ef2f319de232 /src/openocd.c | |
parent | 439a187ea146146e9dc008df5c7511d4c13ded5c (diff) | |
download | riscv-openocd-0fc19255c365a59acf4683d177bacf662e84d4f1.zip riscv-openocd-0fc19255c365a59acf4683d177bacf662e84d4f1.tar.gz riscv-openocd-0fc19255c365a59acf4683d177bacf662e84d4f1.tar.bz2 |
work in progress to hook up libmicrohttpd + tcl integration
git-svn-id: svn://svn.berlios.de/openocd/trunk@1251 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/openocd.c')
-rw-r--r-- | src/openocd.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/openocd.c b/src/openocd.c index 014433c..471a097 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -229,6 +229,9 @@ command_context_t *setup_command_handler(void) return cmd_ctx; } +int httpd_start(void); +void httpd_stop(void); + /* normally this is the main() function entry, but if OpenOCD is linked * into application, then this fn will not be invoked, but rather that * application will have it's own implementation of main(). */ @@ -255,6 +258,11 @@ int openocd_main(int argc, char *argv[]) if ( (ret != ERROR_OK) && (ret != ERROR_COMMAND_CLOSE_CONNECTION) ) return EXIT_FAILURE; +#if BUILD_HTTPD + if (httpd_start()!=ERROR_OK) + return EXIT_FAILURE; +#endif + if (ret != ERROR_COMMAND_CLOSE_CONNECTION) { command_context_mode(cmd_ctx, COMMAND_EXEC); @@ -268,10 +276,15 @@ int openocd_main(int argc, char *argv[]) /* shut server down */ server_quit(); +#if BUILD_HTTPD + httpd_stop(); +#endif + unregister_all_commands(cmd_ctx); /* free commandline interface */ command_done(cmd_ctx); + return EXIT_SUCCESS; } |