Back to index

lightning-sunbird  0.9+nobinonly
process.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  *
00003  * ***** BEG LICENSE BLOCK *****
00004  * ***** BEGIN LICENSE BLOCK *****
00005  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00006  *
00007  * The contents of this file are subject to the Mozilla Public License Version
00008  * 1.1 (the "License"); you may not use this file except in compliance with
00009  * the License. You may obtain a copy of the License at
00010  * http://www.mozilla.org/MPL/
00011  *
00012  * Software distributed under the License is distributed on an "AS IS" basis,
00013  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00014  * for the specific language governing rights and limitations under the
00015  * License.
00016  *
00017  * The Original Code is mozilla.org code, released
00018  * Jan 28, 2003.
00019  *
00020  * The Initial Developer of the Original Code is
00021  * Netscape Communications Corporation.
00022  * Portions created by the Initial Developer are Copyright (C) 2003
00023  * the Initial Developer. All Rights Reserved.
00024  *
00025  * Contributor(s):
00026  *   Garrett Arch Blythe, 28-January-2003
00027  *
00028  * Alternatively, the contents of this file may be used under the terms of
00029  * either the GNU General Public License Version 2 or later (the "GPL"), or
00030  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00031  * in which case the provisions of the GPL or the LGPL are applicable instead
00032  * of those above. If you wish to allow use of your version of this file only
00033  * under the terms of either the GPL or the LGPL, and not to allow others to
00034  * use your version of this file under the terms of the MPL, indicate your
00035  * decision by deleting the provisions above and replace them with the notice
00036  * and other provisions required by the GPL or the LGPL. If you do not delete
00037  * the provisions above, a recipient may use your version of this file under
00038  * the terms of any one of the MPL, the GPL or the LGPL.
00039  *
00040  * ***** END LICENSE BLOCK ***** */
00041 
00042 #include "mozce_internal.h"
00043 
00044 extern "C" {
00045 #if 0
00046 }
00047 #endif
00048 
00049 #include "kfuncs.h"
00050 
00051 MOZCE_SHUNT_API void mozce_abort(void)
00052 {
00053     MOZCE_PRECHECK
00054 
00055 #ifdef DEBUG
00056     mozce_printf("mozce_abort called\n");
00057 #endif
00058 
00059 #if defined(DEBUG)
00060     DebugBreak();
00061 #endif
00062     TerminateProcess((HANDLE) GetCurrentProcessId(), 3);
00063 }
00064 
00065 
00066 MOZCE_SHUNT_API char* mozce_getenv(const char* inName)
00067 {
00068     MOZCE_PRECHECK
00069 
00070 #ifdef DEBUG
00071     mozce_printf("mozce_getenv called (%s)\n", inName);
00072 #endif
00073 
00074     char* retval = NULL;
00075 
00076 #ifdef DEBUG_NSPR_ALL
00077     if (!strcmp(inName, "NSPR_LOG_MODULES"))
00078         return "all:5";
00079 
00080     if (!strcmp(inName, "NSPR_LOG_FILE"))
00081         return "nspr.log";
00082 #endif  
00083 
00084 #ifdef TIMELINE
00085     if (!strcmp(inName, "NS_TIMELINE_LOG_FILE"))
00086         return "\\bin\\timeline.log";
00087     
00088     if (!strcmp(inName, "NS_TIMELINE_ENABLE"))
00089         return "1";
00090 #endif
00091 
00092        if (!_stricmp(inName, "tmp"))
00093         return "/Temp";
00094     return retval;
00095 }
00096 
00097 MOZCE_SHUNT_API int mozce_putenv(const char *a) 
00098 {
00099     MOZCE_PRECHECK
00100 
00101 #ifdef DEBUG
00102     mozce_printf("mozce_putenv called\n");
00103 #endif
00104 
00105     return 0;
00106 }
00107 
00108 MOZCE_SHUNT_API int mozce_getpid(void)
00109 {
00110     MOZCE_PRECHECK
00111 
00112 #ifdef DEBUG
00113     mozce_printf("mozce_getpid called\n");
00114 #endif
00115 
00116     int retval = 0;
00117 
00118     retval = (int)GetCurrentProcessId();
00119 
00120     return retval;
00121 }
00122 
00123 
00124 #if 0
00125 {
00126 #endif
00127 } /* extern "C" */
00128