Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
3.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: tclappinit.c
  8. //
  9. //--------------------------------------------------------------------------
  10. /*
  11. * tclAppInit.c --
  12. *
  13. * Provides a default version of the Tcl_AppInit procedure.
  14. *
  15. * Copyright (c) 1993 The Regents of the University of California.
  16. * All rights reserved.
  17. *
  18. * Permission is hereby granted, without written agreement and without
  19. * license or royalty fees, to use, copy, modify, and distribute this
  20. * software and its documentation for any purpose, provided that the
  21. * above copyright notice and the following two paragraphs appear in
  22. * all copies of this software.
  23. *
  24. * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
  25. * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
  26. * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  27. * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. *
  29. * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  30. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  31. * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
  32. * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  33. * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  34. */
  35. #ifndef lint
  36. /* ++ */
  37. static char rcsid[] = "Header: /user6/ouster/tcl/RCS/tclAppInit.c,v 1.6 93/08/26 14:34:55 ouster Exp SPRITE (Berkeley)";
  38. /* -- */
  39. #endif /* not lint */
  40. #ifndef __STDC__
  41. #define __STDC__ 1
  42. #endif
  43. #include "tcl.h"
  44. /* ++ */
  45. #ifdef _WIN32
  46. #include "tclNT.h"
  47. #endif
  48. #include "scExt.h"
  49. /* -- */
  50. /*
  51. * The following variable is a special hack that allows applications
  52. * to be linked using the procedure "main" from the Tcl library. The
  53. * variable generates a reference to "main", which causes main to
  54. * be brought in from the library (and all of Tcl with it).
  55. */
  56. /* ++ */
  57. extern int CDECL main();
  58. /* -- */
  59. int *tclDummyMainPtr = (int *) main;
  60. /*
  61. *----------------------------------------------------------------------
  62. *
  63. * Tcl_AppInit --
  64. *
  65. * This procedure performs application-specific initialization.
  66. * Most applications, especially those that incorporate additional
  67. * packages, will have their own version of this procedure.
  68. *
  69. * Results:
  70. * Returns a standard Tcl completion code, and leaves an error
  71. * message in interp->result if an error occurs.
  72. *
  73. * Side effects:
  74. * Depends on the startup script.
  75. *
  76. *----------------------------------------------------------------------
  77. */
  78. int
  79. Tcl_AppInit(interp)
  80. Tcl_Interp *interp; /* Interpreter for application. */
  81. {
  82. /*
  83. * Call Tcl_CreateCommand for application-specific commands.
  84. */
  85. Tcl_CreateCommand(interp, "try", TclExt_tryCmd, NULL, NULL);
  86. Tcl_CreateCommand(interp, "thread", TclExt_threadCmd, NULL, NULL);
  87. Tcl_CreateCommand(interp, "crypt", Tclsc_cryptCmd, NULL, NULL);
  88. /*
  89. * Call the init procedures for included packages. Each call should
  90. * look like this:
  91. *
  92. * if (Mod_Init(interp) == TCL_ERROR) {
  93. * return TCL_ERROR;
  94. * }
  95. *
  96. * where "Mod" is the name of the module.
  97. */
  98. if (Tcl_Init(interp) == TCL_ERROR) {
  99. return TCL_ERROR;
  100. }
  101. /*
  102. * Specify a user-specific startup file to invoke if the application
  103. * is run interactively. Typically the startup file is "~/.apprc"
  104. * where "app" is the name of the application. If this line is deleted
  105. * then no user-specific startup file will be run under any conditions.
  106. */
  107. tcl_RcFileName = "~/.tclcrypt";
  108. return TCL_OK;
  109. }