Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
pub
frama-c
Commits
a12dd4df
Commit
a12dd4df
authored
5 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[server] (projectified) states & values
parent
18d891e0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/server/Makefile.in
+2
-1
2 additions, 1 deletion
src/plugins/server/Makefile.in
src/plugins/server/states.ml
+58
-0
58 additions, 0 deletions
src/plugins/server/states.ml
src/plugins/server/states.mli
+42
-0
42 additions, 0 deletions
src/plugins/server/states.mli
with
102 additions
and
1 deletion
src/plugins/server/Makefile.in
+
2
−
1
View file @
a12dd4df
...
...
@@ -39,7 +39,8 @@ PLUGIN_NAME:=Server
PLUGIN_CMO
:=
\
server_parameters
\
jbuffer
\
doc syntax data main request
\
doc syntax data
\
main request states
\
server_batch
\
kernel_main
\
kernel_project
\
...
...
This diff is collapsed.
Click to expand it.
src/plugins/server/states.ml
0 → 100644
+
58
−
0
View file @
a12dd4df
(**************************************************************************)
(* *)
(* This file is part of Frama-C. *)
(* *)
(* Copyright (C) 2007-2019 *)
(* CEA (Commissariat à l'énergie atomique et aux énergies *)
(* alternatives) *)
(* *)
(* you can redistribute it and/or modify it under the terms of the GNU *)
(* Lesser General Public License as published by the Free Software *)
(* Foundation, version 2.1. *)
(* *)
(* It is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU Lesser General Public License for more details. *)
(* *)
(* See the GNU Lesser General Public License version 2.1 *)
(* for more details (enclosed in the file licenses/LGPLv2.1). *)
(* *)
(**************************************************************************)
(* -------------------------------------------------------------------------- *)
(* --- Values & States --- *)
(* -------------------------------------------------------------------------- *)
let
register_value
(
type
a
)
~
page
~
name
~
descr
?
(
details
=
[]
)
~
(
output
:
a
Request
.
output
)
~
get
=
let
open
Markdown
in
let
title
=
Printf
.
sprintf
"`VALUE` %s"
name
in
let
index
=
[
Printf
.
sprintf
"%s (`VALUE`)"
name
]
in
let
description
=
[
Block
[
Text
descr
]
;
Block
details
]
in
let
h
=
Doc
.
publish
~
page
~
name
~
title
~
index
description
[]
in
let
signal
=
Request
.
signal
~
page
~
name
:
(
name
^
".sig"
)
~
descr
:
(
plain
"Signal for value "
@
href
h
)
()
in
Request
.
register
~
page
~
kind
:
`GET
~
name
:
(
name
^
".get"
)
~
descr
:
(
plain
"Getter for value "
@
href
h
)
~
input
:
(
module
Data
.
Junit
)
~
output
get
;
signal
let
register_state
(
type
a
)
~
page
~
name
~
descr
?
(
details
=
[]
)
~
(
data
:
a
Data
.
data
)
~
get
~
set
=
let
open
Markdown
in
let
title
=
Printf
.
sprintf
"`STATE` %s"
name
in
let
index
=
[
Printf
.
sprintf
"%s (`STATE`)"
name
]
in
let
description
=
[
Block
[
Text
descr
]
;
Block
details
]
in
let
h
=
Doc
.
publish
~
page
~
name
~
title
~
index
description
[]
in
let
signal
=
Request
.
signal
~
page
~
name
:
(
name
^
".sig"
)
~
descr
:
(
plain
"Signal for state "
@
href
h
)
()
in
Request
.
register
~
page
~
kind
:
`GET
~
name
:
(
name
^
".get"
)
~
descr
:
(
plain
"Getter for state "
@
href
h
)
~
input
:
(
module
Data
.
Junit
)
~
output
:
(
module
(
val
data
))
get
;
Request
.
register
~
page
~
kind
:
`SET
~
name
:
(
name
^
".set"
)
~
descr
:
(
plain
"Setter for state "
@
href
h
)
~
input
:
(
module
(
val
data
))
~
output
:
(
module
Data
.
Junit
)
set
;
signal
(* -------------------------------------------------------------------------- *)
This diff is collapsed.
Click to expand it.
src/plugins/server/states.mli
0 → 100644
+
42
−
0
View file @
a12dd4df
(**************************************************************************)
(* *)
(* This file is part of Frama-C. *)
(* *)
(* Copyright (C) 2007-2019 *)
(* CEA (Commissariat à l'énergie atomique et aux énergies *)
(* alternatives) *)
(* *)
(* you can redistribute it and/or modify it under the terms of the GNU *)
(* Lesser General Public License as published by the Free Software *)
(* Foundation, version 2.1. *)
(* *)
(* It is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU Lesser General Public License for more details. *)
(* *)
(* See the GNU Lesser General Public License version 2.1 *)
(* for more details (enclosed in the file licenses/LGPLv2.1). *)
(* *)
(**************************************************************************)
val
register_value
:
page
:
Doc
.
page
->
name
:
string
->
descr
:
Markdown
.
text
->
?
details
:
Markdown
.
block
->
output
:
'
a
Request
.
output
->
get
:
(
unit
->
'
a
)
->
Request
.
signal
val
register_state
:
page
:
Doc
.
page
->
name
:
string
->
descr
:
Markdown
.
text
->
?
details
:
Markdown
.
block
->
data
:
'
a
Data
.
data
->
get
:
(
unit
->
'
a
)
->
set
:
(
'
a
->
unit
)
->
Request
.
signal
(* -------------------------------------------------------------------------- *)
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