Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
a7b23521
Commit
a7b23521
authored
Aug 22, 2010
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Conditional os i meth files
parent
919dad49
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
otherio/lib/rt/src/rt_io_otherio.meth
otherio/lib/rt/src/rt_io_otherio.meth
+2
-0
src/exe/co_merge/src/co_merge.c
src/exe/co_merge/src/co_merge.c
+34
-1
No files found.
otherio/lib/rt/src/rt_io_otherio.meth
View file @
a7b23521
...
@@ -5,8 +5,10 @@ Modbus_Module
...
@@ -5,8 +5,10 @@ Modbus_Module
Modbus_Master
Modbus_Master
Modbus_TCP_Server
Modbus_TCP_Server
Modbus_TCP_ServerModule
Modbus_TCP_ServerModule
#if OS_LINUX
GPIO
GPIO
GPIO_Module
GPIO_Module
Maxim_DS18B20
Maxim_DS18B20
USB_Agent
USB_Agent
Velleman_K8055_Board
Velleman_K8055_Board
#endif
\ No newline at end of file
src/exe/co_merge/src/co_merge.c
View file @
a7b23521
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include "pwr.h"
#include "pwr.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "co_dcli.h"
typedef
enum
{
typedef
enum
{
...
@@ -40,6 +41,25 @@ void usage()
...
@@ -40,6 +41,25 @@ void usage()
"
);
"
);
}
}
static
int
check_os
(
char
*
str
,
char
*
os
)
{
char
os_vect
[
10
][
20
];
int
nr
;
int
i
;
char
os_element
[
20
];
nr
=
dcli_parse
(
str
,
"||"
,
""
,
(
char
*
)
os_vect
,
sizeof
(
os_vect
)
/
sizeof
(
os_vect
[
0
]),
sizeof
(
os_vect
[
0
]),
0
);
for
(
i
=
0
;
i
<
nr
;
i
++
)
{
dcli_trim
(
os_element
,
os_vect
[
i
]);
if
(
cdh_NoCaseStrcmp
(
os
,
os_element
)
==
0
)
return
1
;
}
return
0
;
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
pwr_tFileName
filespec
;
pwr_tFileName
filespec
;
...
@@ -61,6 +81,7 @@ int main( int argc, char *argv[])
...
@@ -61,6 +81,7 @@ int main( int argc, char *argv[])
char
pwre_cxx
[
80
];
char
pwre_cxx
[
80
];
char
pwre_ar
[
80
];
char
pwre_ar
[
80
];
char
*
s
;
char
*
s
;
int
in_if
=
0
;
#if defined OS_LINUX
#if defined OS_LINUX
char
dos
[]
=
"OS_LINUX"
;
char
dos
[]
=
"OS_LINUX"
;
#elif defined OS_MACOS
#elif defined OS_MACOS
...
@@ -108,7 +129,19 @@ int main( int argc, char *argv[])
...
@@ -108,7 +129,19 @@ int main( int argc, char *argv[])
while
(
dcli_read_line
(
line
,
sizeof
(
line
),
fp
))
{
while
(
dcli_read_line
(
line
,
sizeof
(
line
),
fp
))
{
dcli_trim
(
line
,
line
);
dcli_trim
(
line
,
line
);
if
(
line
[
0
]
==
0
||
line
[
0
]
==
'#'
)
if
(
strncmp
(
line
,
"#if"
,
3
)
==
0
)
{
in_if
=
!
check_os
(
&
line
[
5
],
dos
);
continue
;
}
else
if
(
in_if
)
{
if
(
strncmp
(
line
,
"#endif"
,
6
)
==
0
)
{
if
(
in_if
)
in_if
=
0
;
continue
;
}
continue
;
}
else
if
(
line
[
0
]
==
0
||
line
[
0
]
==
'#'
)
continue
;
continue
;
strncpy
(
mtab
[
mtabcnt
++
],
line
,
sizeof
(
mtab
[
0
]));
strncpy
(
mtab
[
mtabcnt
++
],
line
,
sizeof
(
mtab
[
0
]));
if
(
mtabcnt
>
(
int
)
sizeof
(
mtab
)
/
sizeof
(
mtab
[
0
])
-
1
)
if
(
mtabcnt
>
(
int
)
sizeof
(
mtab
)
/
sizeof
(
mtab
[
0
])
-
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment