- rename log functions to stop conflicts under win32 (wingdi)
[fw/openocd] / src / openocd.c
index b636d06d388f7f9aab5cba16f620a7517f309090..604a3c5b07e79f320e856447003027713f53eab6 100644 (file)
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
 
        register_command(cmd_ctx, NULL, "version", handle_version_command,
                                         COMMAND_EXEC, "show OpenOCD version");
-       
+
        /* register subsystem commands */
        server_register_commands(cmd_ctx);
        telnet_register_commands(cmd_ctx);
@@ -88,13 +88,10 @@ int main(int argc, char *argv[])
        
        if (log_init(cmd_ctx) != ERROR_OK)
                return EXIT_FAILURE;
-       DEBUG("log init complete");
+       LOG_DEBUG("log init complete");
        
-       printf( OPENOCD_VERSION );
-       printf( "\n$URL$\n");
-  
-       DEBUG( OPENOCD_VERSION );
-       DEBUG( "$URL$");\r
+       LOG_OUTPUT( OPENOCD_VERSION "\n" );
+       LOG_OUTPUT( "$URL$\n");
 
        cfg_cmd_ctx = copy_command_context(cmd_ctx);
        cfg_cmd_ctx->mode = COMMAND_CONFIG;
@@ -114,44 +111,45 @@ int main(int argc, char *argv[])
 
        if (jtag_init(cmd_ctx) != ERROR_OK)
                return EXIT_FAILURE;
-       DEBUG("jtag init complete");
+       LOG_DEBUG("jtag init complete");
 
        if (target_init(cmd_ctx) != ERROR_OK)
                return EXIT_FAILURE;
-       DEBUG("target init complete");
+       LOG_DEBUG("target init complete");
 
        if (flash_init_drivers(cmd_ctx) != ERROR_OK)
                return EXIT_FAILURE;
-       DEBUG("flash init complete");
+       LOG_DEBUG("flash init complete");
 
        if (nand_init(cmd_ctx) != ERROR_OK)
                return EXIT_FAILURE;
-       DEBUG("NAND init complete");
+       LOG_DEBUG("NAND init complete");
 
        if (pld_init(cmd_ctx) != ERROR_OK)
                return EXIT_FAILURE;
-       DEBUG("pld init complete");
+       LOG_DEBUG("pld init complete");
 
        /* initialize tcp server */
        server_init();
-       
+
        /* initialize telnet subsystem */
        telnet_init("Open On-Chip Debugger");
        gdb_init();
-       
+
        /* call any target resets */
        if (target_init_reset(cmd_ctx) != ERROR_OK)
                return EXIT_FAILURE;
-       DEBUG("target init reset complete");
-       
+       LOG_DEBUG("target init reset complete");
+
        /* handle network connections */
        server_loop(cmd_ctx);
-       
+
        /* shut server down */
        server_quit();
-       
+
        /* free commandline interface */
        command_done(cmd_ctx);
-       
+
        return EXIT_SUCCESS;
 }
+