Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
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
Container registry
Model registry
Operate
Environments
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
pikelang
pike
Commits
7abd89f9
Commit
7abd89f9
authored
20 years ago
by
Henrik (Grubba) Grubbström
Browse files
Options
Downloads
Patches
Plain Diff
Added add_pike_string_constant().
Rev: src/constants.c:1.55 Rev: src/constants.h:1.33
parent
faf7fb66
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/constants.c
+10
-1
10 additions, 1 deletion
src/constants.c
src/constants.h
+2
-1
2 additions, 1 deletion
src/constants.h
with
12 additions
and
2 deletions
src/constants.c
+
10
−
1
View file @
7abd89f9
...
...
@@ -2,7 +2,7 @@
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information.
|| $Id: constants.c,v 1.5
4
2004/
09/18 20:50:48 nilsson
Exp $
|| $Id: constants.c,v 1.5
5
2004/
12/30 12:57:24 grubba
Exp $
*/
#include
"global.h"
...
...
@@ -53,6 +53,15 @@ void low_add_constant(const char *name, struct svalue *fun)
free_string
(
p
);
}
void
add_pike_string_constant
(
const
char
*
name
,
const
char
*
str
,
int
len
)
{
struct
pike_string
*
key
=
make_shared_string
(
name
);
struct
pike_string
*
val
=
make_shared_binary_string
(
str
,
len
);
mapping_string_insert_string
(
builtin_constants
,
key
,
val
);
free_string
(
val
);
free_string
(
key
);
}
PMOD_EXPORT
void
add_global_program
(
const
char
*
name
,
struct
program
*
p
)
{
struct
svalue
s
;
...
...
This diff is collapsed.
Click to expand it.
src/constants.h
+
2
−
1
View file @
7abd89f9
...
...
@@ -2,7 +2,7 @@
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information.
|| $Id: constants.h,v 1.3
2
200
3/08/20 16:31:44 mast
Exp $
|| $Id: constants.h,v 1.3
3
200
4/12/30 12:57:24 grubba
Exp $
*/
#ifndef ADD_EFUN_H
...
...
@@ -48,6 +48,7 @@ extern struct callable *first_callable;
PMOD_EXPORT
struct
mapping
*
get_builtin_constants
(
void
);
void
low_add_efun
(
struct
pike_string
*
name
,
struct
svalue
*
fun
);
void
low_add_constant
(
const
char
*
name
,
struct
svalue
*
fun
);
void
add_pike_string_constant
(
const
char
*
name
,
const
char
*
str
,
int
len
);
PMOD_EXPORT
void
add_global_program
(
const
char
*
name
,
struct
program
*
p
);
BLOCK_ALLOC_FILL_PAGES
(
callable
,
2
)
PMOD_EXPORT
struct
callable
*
low_make_callable
(
c_fun
fun
,
...
...
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