Mercurial > ecos
comparison host/libcdl/base.cxx @ 343:fbfd52cf7976
Try to resolve problems caused by API changes in Tcl 8.4, related to
the use of const
| author | bartv |
|---|---|
| date | Sat, 21 Sep 2002 22:05:08 +0000 |
| parents | 0d2b193a635f |
| children | 67a8feb8144a |
comparison
equal
deleted
inserted
replaced
| 342:cac491d76066 | 343:fbfd52cf7976 |
|---|---|
| 8 // | 8 // |
| 9 //============================================================================ | 9 //============================================================================ |
| 10 //####COPYRIGHTBEGIN#### | 10 //####COPYRIGHTBEGIN#### |
| 11 // | 11 // |
| 12 // ---------------------------------------------------------------------------- | 12 // ---------------------------------------------------------------------------- |
| 13 // Copyright (C) 2002 Bart Veer | |
| 13 // Copyright (C) 1999, 2000 Red Hat, Inc. | 14 // Copyright (C) 1999, 2000 Red Hat, Inc. |
| 14 // | 15 // |
| 15 // This file is part of the eCos host tools. | 16 // This file is part of the eCos host tools. |
| 16 // | 17 // |
| 17 // This program is free software; you can redistribute it and/or modify it | 18 // This program is free software; you can redistribute it and/or modify it |
| 2746 // ---------------------------------------------------------------------------- | 2747 // ---------------------------------------------------------------------------- |
| 2747 // This implements cdl_savefile_command which should appear near the | 2748 // This implements cdl_savefile_command which should appear near the |
| 2748 // start of savefiles. The command takes two arguments, a primary | 2749 // start of savefiles. The command takes two arguments, a primary |
| 2749 // command name and a set of subcommand names. | 2750 // command name and a set of subcommand names. |
| 2750 int | 2751 int |
| 2751 CdlToplevelBody::savefile_handle_command(CdlInterpreter interp, int argc, char** argv) | 2752 CdlToplevelBody::savefile_handle_command(CdlInterpreter interp, int argc, const char* argv[]) |
| 2752 { | 2753 { |
| 2753 CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_command"); | 2754 CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_command"); |
| 2754 CYG_REPORT_FUNCARG2XV(interp, argc); | 2755 CYG_REPORT_FUNCARG2XV(interp, argc); |
| 2755 CYG_PRECONDITION_CLASSC(interp); | 2756 CYG_PRECONDITION_CLASSC(interp); |
| 2756 | 2757 |
| 2798 } | 2799 } |
| 2799 | 2800 |
| 2800 // Now take care of all the subcommands. | 2801 // Now take care of all the subcommands. |
| 2801 if (2 != argc) { | 2802 if (2 != argc) { |
| 2802 | 2803 |
| 2803 int list_count = 0; | 2804 int list_count = 0; |
| 2804 char** list_entries = 0; | 2805 const char** list_entries = 0; |
| 2805 | 2806 |
| 2806 try { | 2807 try { |
| 2807 Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); | 2808 Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); |
| 2808 if (TCL_OK != Tcl_SplitList(tcl_interp, argv[2], &list_count, &list_entries)) { | 2809 if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[2]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { |
| 2809 CdlParse::report_error(interp, "", std::string("Invalid subcommand list for `cdl_command ") + argv[1] + "'."); | 2810 CdlParse::report_error(interp, "", std::string("Invalid subcommand list for `cdl_command ") + argv[1] + "'."); |
| 2810 } | 2811 } |
| 2811 | 2812 |
| 2812 for (int i = 0; i < list_count; i++) { | 2813 for (int i = 0; i < list_count; i++) { |
| 2813 bool known_subcommand = false; | 2814 bool known_subcommand = false; |
| 2869 // | 2870 // |
| 2870 // Ideally the original data could be extracted from the Tcl | 2871 // Ideally the original data could be extracted from the Tcl |
| 2871 // interpreter somehow. Currently this data is not readily available, | 2872 // interpreter somehow. Currently this data is not readily available, |
| 2872 // and the resulting string may not match the original data exactly. | 2873 // and the resulting string may not match the original data exactly. |
| 2873 int | 2874 int |
| 2874 CdlToplevelBody::savefile_handle_unsupported(CdlInterpreter interp, int argc, char** argv) | 2875 CdlToplevelBody::savefile_handle_unsupported(CdlInterpreter interp, int argc, const char* argv[]) |
| 2875 { | 2876 { |
| 2876 CYG_REPORT_FUNCNAME("CdlNode::savefile_handle_unsupported"); | 2877 CYG_REPORT_FUNCNAME("CdlNode::savefile_handle_unsupported"); |
| 2877 CYG_REPORT_FUNCARG2XV(interp, argc); | 2878 CYG_REPORT_FUNCARG2XV(interp, argc); |
| 2878 CYG_ASSERT_CLASSC(interp); | 2879 CYG_ASSERT_CLASSC(interp); |
| 2879 | 2880 |
| 2929 //{{{ handle_unknown() | 2930 //{{{ handle_unknown() |
| 2930 | 2931 |
| 2931 // ---------------------------------------------------------------------------- | 2932 // ---------------------------------------------------------------------------- |
| 2932 | 2933 |
| 2933 int | 2934 int |
| 2934 CdlToplevelBody::savefile_handle_unknown(CdlInterpreter interp, int argc, char** argv) | 2935 CdlToplevelBody::savefile_handle_unknown(CdlInterpreter interp, int argc, const char* argv[]) |
| 2935 { | 2936 { |
| 2936 CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_unknown"); | 2937 CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_unknown"); |
| 2937 CYG_REPORT_FUNCARG2XV(interp, argc); | 2938 CYG_REPORT_FUNCARG2XV(interp, argc); |
| 2938 CYG_PRECONDITION_CLASSC(interp); | 2939 CYG_PRECONDITION_CLASSC(interp); |
| 2939 | 2940 |
| 2964 | 2965 |
| 2965 // This implements the cdl_savefile_version command. It stores the | 2966 // This implements the cdl_savefile_version command. It stores the |
| 2966 // version number with the interpreter, allowing it to be retrieved | 2967 // version number with the interpreter, allowing it to be retrieved |
| 2967 // by other commands. | 2968 // by other commands. |
| 2968 int | 2969 int |
| 2969 CdlToplevelBody::savefile_handle_version(CdlInterpreter interp, int argc, char** argv) | 2970 CdlToplevelBody::savefile_handle_version(CdlInterpreter interp, int argc, const char* argv[]) |
| 2970 { | 2971 { |
| 2971 CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_version"); | 2972 CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_version"); |
| 2972 CYG_REPORT_FUNCARG2XV(interp, argc); | 2973 CYG_REPORT_FUNCARG2XV(interp, argc); |
| 2973 CYG_PRECONDITION_CLASSC(interp); | 2974 CYG_PRECONDITION_CLASSC(interp); |
| 2974 | 2975 |
| 3326 | 3327 |
| 3327 // ---------------------------------------------------------------------------- | 3328 // ---------------------------------------------------------------------------- |
| 3328 // Syntax: description <string> | 3329 // Syntax: description <string> |
| 3329 | 3330 |
| 3330 int | 3331 int |
| 3331 CdlUserVisibleBody::parse_description(CdlInterpreter interp, int argc, char** argv) | 3332 CdlUserVisibleBody::parse_description(CdlInterpreter interp, int argc, const char* argv[]) |
| 3332 { | 3333 { |
| 3333 CYG_REPORT_FUNCNAMETYPE("parse_description", "result %d"); | 3334 CYG_REPORT_FUNCNAMETYPE("parse_description", "result %d"); |
| 3334 | 3335 |
| 3335 int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Description, 0, 0); | 3336 int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Description, 0, 0); |
| 3336 | 3337 |
| 3341 | 3342 |
| 3342 // ---------------------------------------------------------------------------- | 3343 // ---------------------------------------------------------------------------- |
| 3343 // Syntax: display <short description> | 3344 // Syntax: display <short description> |
| 3344 | 3345 |
| 3345 int | 3346 int |
| 3346 CdlUserVisibleBody::parse_display(CdlInterpreter interp, int argc, char** argv) | 3347 CdlUserVisibleBody::parse_display(CdlInterpreter interp, int argc, const char* argv[]) |
| 3347 { | 3348 { |
| 3348 CYG_REPORT_FUNCNAMETYPE("parse_display", "result %d"); | 3349 CYG_REPORT_FUNCNAMETYPE("parse_display", "result %d"); |
| 3349 | 3350 |
| 3350 int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Display, 0, 0); | 3351 int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Display, 0, 0); |
| 3351 | 3352 |
| 3355 | 3356 |
| 3356 // ---------------------------------------------------------------------------- | 3357 // ---------------------------------------------------------------------------- |
| 3357 // Syntax: doc <url> | 3358 // Syntax: doc <url> |
| 3358 | 3359 |
| 3359 int | 3360 int |
| 3360 CdlUserVisibleBody::parse_doc(CdlInterpreter interp, int argc, char** argv) | 3361 CdlUserVisibleBody::parse_doc(CdlInterpreter interp, int argc, const char* argv[]) |
| 3361 { | 3362 { |
| 3362 CYG_REPORT_FUNCNAMETYPE("parse_doc", "result %d"); | 3363 CYG_REPORT_FUNCNAMETYPE("parse_doc", "result %d"); |
| 3363 | 3364 |
| 3364 int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Doc, 0, 0); | 3365 int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Doc, 0, 0); |
| 3365 | 3366 |
| 3692 | 3693 |
| 3693 CYG_REPORT_RETURN(); | 3694 CYG_REPORT_RETURN(); |
| 3694 } | 3695 } |
| 3695 | 3696 |
| 3696 int | 3697 int |
| 3697 CdlParentableBody::parse_parent(CdlInterpreter interp, int argc, char** argv) | 3698 CdlParentableBody::parse_parent(CdlInterpreter interp, int argc, const char* argv[]) |
| 3698 { | 3699 { |
| 3699 CYG_REPORT_FUNCNAMETYPE("parse_parent", "result %d"); | 3700 CYG_REPORT_FUNCNAMETYPE("parse_parent", "result %d"); |
| 3700 | 3701 |
| 3701 int result = CdlParse::parse_reference_property(interp, argc, argv, CdlPropertyId_Parent, 0, 0, true, &update_handler); | 3702 int result = CdlParse::parse_reference_property(interp, argc, argv, CdlPropertyId_Parent, 0, 0, true, &update_handler); |
| 3702 | 3703 |
