Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
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
Anders Blomdell
LabComm
Commits
a8c10f92
Commit
a8c10f92
authored
11 years ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Temporary fix of examples/simple (need to fix liblabcomm)...
parent
70b290de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/simple/compile.sh
+16
-3
16 additions, 3 deletions
examples/simple/compile.sh
examples/simple/example_decoder.c
+14
-10
14 additions, 10 deletions
examples/simple/example_decoder.c
examples/simple/example_encoder.c
+1
-1
1 addition, 1 deletion
examples/simple/example_encoder.c
with
31 additions
and
14 deletions
examples/simple/compile.sh
+
16
−
3
View file @
a8c10f92
(
cd
../../lib/c
;
make
-e
LABCOMM_NO_EXPERIMENTAL
=
true
)
#
(cd ../../lib/c; make -e LABCOMM_NO_EXPERIMENTAL=true)
(
cd
../../compiler
;
ant jar
)
mkdir
-p
gen
java
-jar
../../compiler/labComm.jar
--java
=
gen
--c
=
gen/simple.c
--h
=
gen/simple.h
--python
=
gen/simple.py simple.lc
javac
-cp
../../lib/java:. gen/
*
.java Encoder.java Decoder.java
gcc
-o
example_encoder
-L
../../lib/c
-I
.
-I
../../lib/c example_encoder.c gen/simple.c
-llabcomm
gcc
-o
example_decoder
-L
../../lib/c
-I
.
-I
../../lib/c example_decoder.c gen/simple.c
-llabcomm
gcc
-Wall
-Werror
-I
.
-I
../../lib/c
\
-DLABCOMM_FD_OMIT_VERSION
\
-DLABCOMM_ENCODER_LINEAR_SEARCH
\
gen/simple.c ../../lib/c/labcomm.c
\
../../lib/c/labcomm_dynamic_buffer_writer.c
\
../../lib/c/labcomm_fd_writer.c
\
-o
example_encoder example_encoder.c
gcc
-Wall
-Werror
-I
.
-I
../../lib/c
\
-DLABCOMM_FD_OMIT_VERSION
\
-DLABCOMM_ENCODER_LINEAR_SEARCH
\
gen/simple.c ../../lib/c/labcomm.c
\
../../lib/c/labcomm_dynamic_buffer_writer.c
\
../../lib/c/labcomm_fd_reader.c
\
-o
example_decoder example_decoder.c
#gcc -o example_encoder -I . -I ../../lib/c example_encoder.c gen/simple.c ../../lib/c/labcomm.c ../../lib/c/labcomm_fd_reader_writer.c
...
...
This diff is collapsed.
Click to expand it.
examples/simple/example_decoder.c
+
14
−
10
View file @
a8c10f92
...
...
@@ -19,37 +19,39 @@ static void handle_simple_IntString(simple_IntString *v,void *context) {
static
void
handle_simple_TwoArrays
(
simple_TwoArrays
*
d
,
void
*
context
)
{
printf
(
"Got TwoArrays:"
);
int
i
;
int
i
,
j
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
printf
(
"%d "
,
d
->
fixed
.
a
[
i
]);
}
printf
(
"
\n
"
);
for
(
i
=
0
;
i
<
d
->
variable
.
n_1
;
i
++
)
{
printf
(
"%d "
,
d
->
variable
.
a
[
0
+
2
*
i
]);
printf
(
"%d "
,
d
->
variable
.
a
[
1
+
2
*
i
]);
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
j
=
0
;
j
<
d
->
variable
.
n_1
;
j
++
)
{
printf
(
"%d "
,
d
->
variable
.
a
[
i
*
d
->
variable
.
n_1
+
j
]);
}
printf
(
"
\n
"
);
}
printf
(
"
\n
"
);
}
static
void
handle_simple_TwoFixedArrays
(
simple_TwoFixedArrays
*
d
,
void
*
context
)
{
printf
(
"Got TwoFixedArrays:"
);
int
i
;
int
i
,
j
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
printf
(
"%d "
,
d
->
a
.
a
[
i
]);
}
printf
(
"
\n
"
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
printf
(
"%d "
,
d
->
b
.
a
[
0
+
2
*
i
]);
printf
(
"%d "
,
d
->
b
.
a
[
1
+
2
*
i
]);
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
j
=
0
;
j
<
3
;
j
++
)
{
printf
(
"%d "
,
d
->
b
.
a
[
i
][
j
]);
}
printf
(
"
\n
"
);
}
printf
(
"
\n
"
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
fd
;
struct
labcomm_decoder
*
decoder
;
void
*
context
=
NULL
;
int
i
,
j
;
char
*
filename
=
argv
[
1
];
printf
(
"C decoder reading from %s
\n
"
,
filename
);
...
...
@@ -70,4 +72,6 @@ int main(int argc, char *argv[]) {
labcomm_decoder_run
(
decoder
);
printf
(
"--- End Of File ---:
\n
"
);
labcomm_decoder_free
(
decoder
);
return
0
;
}
This diff is collapsed.
Click to expand it.
examples/simple/example_encoder.c
+
1
−
1
View file @
a8c10f92
...
...
@@ -8,7 +8,6 @@
int
main
(
int
argc
,
char
*
argv
[])
{
int
fd
;
struct
labcomm_encoder
*
encoder
;
int
i
,
j
;
char
*
filename
=
argv
[
1
];
printf
(
"C encoder writing to %s
\n
"
,
filename
);
...
...
@@ -65,4 +64,5 @@ int main(int argc, char *argv[]) {
labcomm_encoder_register_simple_TwoFixedArrays
(
encoder
);
labcomm_encode_simple_TwoFixedArrays
(
encoder
,
&
tfa
);
return
0
;
}
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