The original source code to the JavaScript Interpreter was provided by Netscape Communications Corporation
and the modifications to the source code are derived, directly or indirectly, from such code.
The changes to the original code from Netscape Communications Corporation are documented
in the accompanying Readme file.
--------------------------------------------------------------
**** Start of js.c ****
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express oqr
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU Public License (the "GPL"), in which case the
* provisions of the GPL are applicable instead of those above.
* If you wish to allow use of your version of this file only
* under the terms of the GPL and not to allow others to use your
* version of this file under the NPL, indicate your decision by
* deleting the provisions above and replace them with the notice
* and other provisions required by the GPL. If you do not delete
* the provisions above, a recipient may use your version of this
* file under either the NPL or the GPL.
*/
/*
* JS shell.
*/
#include "jsstddef.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "jstypes.h"
#include "jsarena.h" /* Added by JSIFY */
/* Removed by JSIFY: #include "prlog.h" */
#include "jsutil.h" /* Added by JSIFY */
#include "jsprf.h"
#include "jsapi.h"
#include "jsatom.h"
#include "jscntxt.h"
#include "jsdbgapi.h"
#include "jsemit.h"
#include "jsfun.h"
#include "jsgc.h"
#include "jslock.h"
#include "jsobj.h"
#include "jsparse.h"
#include "jsscope.h"
#include "jsscript.h"
#ifdef PERLCONNECT
#include "perlconnect/jsperl.h"
#endif
#ifdef LIVECONNECT
#include "jsjava.h"
#endif
#ifdef JSDEBUGGER
#include "jsdebug.h"
#ifdef JSDEBUGGER_JAVA_UI
#include "jsdjava.h"
#endif /* JSDEBUGGER_JAVA_UI */
#ifdef JSDEBUGGER_C_UI
#include "jsdb.h"
#endif /* JSDEBUGGER_C_UI */
#endif /* JSDEBUGGER */
#ifdef XP_UNIX
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#endif
#ifdef XP_PC
#include <io.h> /* for isatty() */
#endif
#define EXITCODE_RUNTIME_ERROR 3
#define EXITCODE_FILE_NOT_FOUND 4
size_t gStackChunkSize = 8192;
int gExitCode = 0;
FILE *gErrFile = NULL;
FILE *gOutFile = NULL;
#ifdef XP_MAC
#ifdef MAC_TEST_HACK
/* this is the data file that all Print strings will be echoed into */
FILE *gTestResultFile = NULL;
#define isatty(f) 0
#else
#define isatty(f) 1
#endif
char *strdup(const char *str)
{
char *copy = (char *) malloc(strlen(str)+1);
if (copy)
strcpy(copy, str);
return copy;
}
#ifdef XP_MAC_MPW
/* Macintosh MPW replacements for the ANSI routines. These translate LF's to CR's because
the MPW libraries supplied by Metrowerks don't do that for some reason. */
static void translateLFtoCR(char *str, int length)
{
char *limit = str + length;
while (str != limit) {
if (*str == '\n')
*str = '\r';
str++;
}
}
int fputc(int c, FILE *file)
{
char buffer = c;
if (buffer == '\n')
buffer = '\r';
return fwrite(&buffer, 1, 1, file);
}
int fputs(const char *s, FILE *file)
{
char buffer[4096];
int n = strlen(s);
int extra = 0;
while (n > sizeof buffer) {
memcpy(buffer, s, sizeof buffer);
translateLFtoCR(buffer, sizeof buffer);
extra += fwrite(buffer, 1, sizeof buffer, file);
n -= sizeof buffer;
s += sizeof buffer;
}
memcpy(buffer, s, n);
translateLFtoCR(buffer, n);
return extra + fwrite(buffer, 1, n, file);
}
int fprintf(FILE* file, const char *format, ...)
{
va_list args;
char smallBuffer[4096];
int n;
int bufferSize = sizeof smallBuffer;
char *buffer = smallBuffer;
int result;
va_start(args, format);
n = vsnprintf(buffer, bufferSize, format, args);
va_end(args);
while (n < 0) {
if (buffer != smallBuffer)
free(buffer);
bufferSize <<= 1;
buffer = malloc(bufferSize);
if (!buffer) {
JS_ASSERT(JS_FALSE);
return 0;
}
va_start(args, format);
n = vsnprintf(buffer, bufferSize, format, args);
va_end(args);
}
translateLFtoCR(buffer, n);
result = fwrite(buffer, 1, n, file);
if (buffer != smallBuffer)
free(buffer);
return result;
}
#else
#include <SIOUX.h>
#include <MacTypes.h>
static char* mac_argv[] = { "js", NULL };
static void initConsole(StringPtr consoleName, const char* startupMessage, int *argc, char** *argv)
{
SIOUXSettings.autocloseonquit = true;
SIOUXSettings.asktosaveonclose = false;
/* SIOUXSettings.initializeTB = false;
SIOUXSettings.showstatusline = true;*/
puts(startupMessage);
SIOUXSetTitle(consoleName);
/* set up a buffer for stderr (otherwise it's a pig). */
setvbuf(stderr, (char *) malloc(BUFSIZ), _IOLBF, BUFSIZ);
*argc = 1;
*argv = mac_argv;
}
#ifdef LIVECONNECT
/* Little hack to provide a default CLASSPATH on the Mac. */
#define getenv(var) mac_getenv(var)
static char* mac_getenv(const char* var)
{
if (strcmp(var, "CLASSPATH") == 0) {
static char class_path[] = "liveconnect.jar";
return class_path;
}
return NULL;
}
#endif /* LIVECONNECT */
#endif
#endif
#ifdef JSDEBUGGER
static JSDContext *_jsdc;
#ifdef JSDEBUGGER_JAVA_UI
static JSDJContext *_jsdjc;
#endif /* JSDEBUGGER_JAVA_UI */
#endif /* JSDEBUGGER */
static JSBool reportWarnings = JS_TRUE;
typedef enum JSShellErrNum {
#define MSG_DEF(name, number, count, exception, format) \
name = number,
#include "jsshell.msg"
#undef MSG_DEF
JSShellErr_Limit
#undef MSGDEF
} JSShellErrNum;
static const JSErrorFormatString *
my_GetErrorMessage(void *userRef, const char *locale, const uintN errorNumber);
#ifdef EDITLINE
extern char *readline(const char *prompt);
extern void add_history(char *line);
#endif
static JSBool
GetLine(JSContext *cx, char *bufp, FILE *fh, const char *prompt) {
#ifdef EDITLINE
/*
* Use readline only if fh is stdin, because there's no way to specify
* another handle. Are other filehandles interactive?
*/
if (fh == stdin) {
char *linep;
if ((linep = readline(prompt)) == NULL)
return JS_FALSE;
if (strlen(linep) > 0)
add_history(linep);
strcpy(bufp, linep);
JS_free(cx, linep);
bufp += strlen(bufp);
*bufp++ = '\n';
*bufp = '\0';
} else
#endif
{
char line[256];
fprintf(gOutFile, prompt);
#ifdef XP_MAC_MPW
/* Print a CR after the prompt because MPW g
没有合适的资源?快使用搜索试试~ 我知道了~
Macromedia Fireworks 8
共621个文件
mxi:129个
gif:95个
jpg:77个
5星 · 超过95%的资源 需积分: 43 8 下载量 46 浏览量
2022-07-04
19:54:32
上传
评论
收藏 37.9MB RAR 举报
温馨提示
Macromedia Fireworks 8 是用来设计和制作专业化网页图形的终极解决方案。它是第一个可以帮助网页图形设计人员和开发人员解决所面临的特殊问题的制作环境。 使用 Fireworks,您可以在一个专业化的环境中创建和编辑网页图形、对其进行动画处理、添加高级交互功能以及优化图像。Fireworks 使您可以在单个应用程序中创建和编辑位图和矢量两种图形。并且所有元素都可以随时被编辑。除此之外,工作流可以实现自动化,从而满足耗费时间的更新和更改要求。 Fireworks 与多种产品集成在一起,包括 Macromedia 的其它产品(如 Dreamweaver、Flash、FreeHand 和 Director)和其它您喜欢的图形应用程序及 HTML 编辑器,从而提供了一个真正集成的 Web 解决方案。利用为您所使用的 HTML 编辑器自定义的 HTML 和 JavaScript 代码,您可以轻松地导出 Fireworks 图形。 安装:点击安装包中绿化再点击Fireworks 打开
资源详情
资源评论
资源推荐
收起资源包目录
Macromedia Fireworks 8 (621个子文件)
EyeCandy4000.8bf 852KB
Splat LE-eng.8bf 124KB
cafeLogo.ai 6KB
All Colors Smeared and Masked 125B
All Colors Smeared and Unmasked 125B
Blue Light 420B
Blue Marble 212B
Button 50B
Carve 50B
Carve and Bevel Combo 389B
Carve With Lip 375B
FWHelp.chm 5.43MB
SSCEIT2.CLX 956KB
SSCEFI2.CLX 925KB
SSCEGE2.CLX 884KB
SSCEGN2.CLX 880KB
SSCESP2.CLX 800KB
SSCEDU2.CLX 748KB
SSCEDA2.CLX 731KB
SSCEPO2.CLX 367KB
SSCEFR2.CLX 340KB
SSCEBR2.CLX 320KB
SSCECA2.CLX 317KB
SSCEAM2.CLX 317KB
SSCENB2.CLX 304KB
SSCEPB2.CLX 304KB
SSCESW2.CLX 287KB
Comet Tail 124B
docresources.css 651B
Cutaround 64B
gsdll32.dll 4.35MB
FreeHand Reader.dll 2.54MB
Fireworks Resources.dll 2.52MB
gdiplus.dll 1.63MB
MMxptResources.dll 1.57MB
authplay.dll 1.56MB
mfc71.dll 1.01MB
mfc71u.dll 1023KB
Splat LE Core.dll 620KB
msvcp71.dll 488KB
msvcr71.dll 340KB
jslib.dll 328KB
MMNotes.dll 228KB
libpng.dll 116KB
python.dll 104KB
giflib.dll 104KB
zlib.dll 68KB
SN.dll 40KB
EMLaunch.dll 13KB
Dot Edge 188B
Edge Smear Only 125B
Fireworks.exe 15.43MB
@绿化.exe 96KB
Eye Candy 4000 Preferences 44B
Flat 36B
control_panel.gif 58KB
default_regional_options.gif 41KB
supportfiles.gif 40KB
lang_txt.gif 37KB
MUI.gif 36KB
System_Prefs_Finder.gif 31KB
System_Prefs.gif 28KB
Moving_German.gif 28KB
splat_carton.gif 18KB
ec4k_carton2.gif 14KB
german_lang_txt.gif 7KB
Frame.gif 3KB
index_r7_c2_f2.gif 2KB
rates.gif 2KB
index_r2_c13.gif 2KB
index_r7_c2.gif 2KB
index_r1_c1.gif 2KB
Tube.gif 2KB
footer2.gif 1KB
Clock.gif 1KB
index_r3_c3.gif 1KB
Cog.gif 1KB
Cylinder.gif 1KB
Perspective.gif 1KB
MacromediaFlash.gif 1KB
Dreamweaver.gif 1KB
index_r5_c4.gif 986B
Tabs.gif 883B
Save Time Stamp.gif 816B
index_r4_c6.gif 768B
Cube.gif 765B
Talking.gif 709B
FreeHand.gif 646B
Director.gif 634B
globe.gif 605B
index_r2_c12_f3.gif 499B
index_r2_c12_f2.gif 423B
index_r2_c6_f3.gif 407B
index_r2_c12.gif 388B
index_r2_c5.gif 379B
index_r2_c10_f3.gif 359B
index_r2_c6_f2.gif 340B
index_r2_c3_f3.gif 339B
index_r2_c6.gif 318B
index_r2_c10_f2.gif 296B
共 621 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
qq_24429681
- 粉丝: 13
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于matlab实现用有限元法计算电磁场的Matlab工具 .rar
- 基于matlab实现有限元算法 计算电磁场问题 边界条件包括第一类边界和第二类边界.rar
- 基于matlab实现用于计算不同车重下的电动汽车动力性和经济性.rar
- 基于matlab实现遗传算法求解多车场车辆路径问题 有多组算例可以用.rar
- 浏览器.apk
- 基于matlab实现是一个matlab中的power system 中搭建的一个模型
- 基于JSP毕业设计-教学管理系统(源代码+论文).zip
- 基于JSP毕业设计-家政管理系统-毕业设计.zip
- 基于Python实现淘宝商品评论采集(含逆向)源代码
- 基于matlab实现多目标进化算法NSGAⅡ&Matlab讲解.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论10