Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
6e092180
Commit
6e092180
authored
18 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Created global function: file_compare(file1, file2)
parent
2df8e5a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/js_global.c
+23
-0
23 additions, 0 deletions
src/sbbs3/js_global.c
with
23 additions
and
0 deletions
src/sbbs3/js_global.c
+
23
−
0
View file @
6e092180
...
@@ -2480,6 +2480,25 @@ js_fcopy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
...
@@ -2480,6 +2480,25 @@ js_fcopy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return
(
JS_TRUE
);
return
(
JS_TRUE
);
}
}
static
JSBool
js_fcompare
(
JSContext
*
cx
,
JSObject
*
obj
,
uintN
argc
,
jsval
*
argv
,
jsval
*
rval
)
{
char
*
fn1
;
char
*
fn2
;
if
(
JSVAL_IS_VOID
(
argv
[
0
]))
return
(
JS_TRUE
);
*
rval
=
BOOLEAN_TO_JSVAL
(
JS_FALSE
);
if
((
fn1
=
js_ValueToStringBytes
(
cx
,
argv
[
0
],
NULL
))
==
NULL
)
return
(
JS_TRUE
);
if
((
fn2
=
js_ValueToStringBytes
(
cx
,
argv
[
1
],
NULL
))
==
NULL
)
return
(
JS_TRUE
);
*
rval
=
BOOLEAN_TO_JSVAL
(
fcompare
(
fn1
,
fn2
));
return
(
JS_TRUE
);
}
static
JSBool
static
JSBool
js_backup
(
JSContext
*
cx
,
JSObject
*
obj
,
uintN
argc
,
jsval
*
argv
,
jsval
*
rval
)
js_backup
(
JSContext
*
cx
,
JSObject
*
obj
,
uintN
argc
,
jsval
*
argv
,
jsval
*
rval
)
{
{
...
@@ -3213,6 +3232,10 @@ static jsSyncMethodSpec js_global_functions[] = {
...
@@ -3213,6 +3232,10 @@ static jsSyncMethodSpec js_global_functions[] = {
"it is presumed stale and removed/over-written"
)
"it is presumed stale and removed/over-written"
)
,
312
,
312
},
},
{
"file_compare"
,
js_fcompare
,
2
,
JSTYPE_BOOLEAN
,
JSDOCSTR
(
"path/file1, path/file2"
)
,
JSDOCSTR
(
"compare 2 files, returning <i>true</i> if they are identical, <i>false</i> otherwise"
)
,
314
},
{
"directory"
,
js_directory
,
1
,
JSTYPE_ARRAY
,
JSDOCSTR
(
"path/pattern [,flags=<tt>GLOB_MARK</tt>]"
)
{
"directory"
,
js_directory
,
1
,
JSTYPE_ARRAY
,
JSDOCSTR
(
"path/pattern [,flags=<tt>GLOB_MARK</tt>]"
)
,
JSDOCSTR
(
"returns an array of directory entries, "
,
JSDOCSTR
(
"returns an array of directory entries, "
"<i>pattern</i> is the path and filename or wildcards to search for (e.g. '/subdir/*.txt'), "
"<i>pattern</i> is the path and filename or wildcards to search for (e.g. '/subdir/*.txt'), "
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment