Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
osie
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
Nikola Balog
osie
Commits
50276413
Commit
50276413
authored
May 05, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup.
parent
e05da676
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
21 deletions
+25
-21
coupler/opc-ua-server/common.h
coupler/opc-ua-server/common.h
+25
-21
No files found.
coupler/opc-ua-server/common.h
View file @
50276413
...
...
@@ -6,7 +6,6 @@
#include <stdio.h>
#include <open62541/server.h>
unsigned
long
int
getMilliSecondsSinceEpoch
()
{
/*
* Return milli seconds since epoch.
...
...
@@ -21,8 +20,7 @@ unsigned long int getMilliSecondsSinceEpoch() {
*
* @param path specifies the file name given in argv[]
* @return Returns the file content after parsing */
static
UA_INLINE
UA_ByteString
loadFile
(
const
char
*
const
path
)
{
static
UA_INLINE
UA_ByteString
loadFile
(
const
char
*
const
path
)
{
UA_ByteString
fileContents
=
UA_STRING_NULL
;
/* Open the file */
...
...
@@ -49,8 +47,10 @@ loadFile(const char *const path) {
return
fileContents
;
}
char
*
randomString
(
size_t
length
)
{
char
*
randomString
(
size_t
length
)
{
/*
* Generate a random string.
*/
static
char
charset
[]
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
;
char
*
randomString
=
NULL
;
if
(
length
)
{
...
...
@@ -67,7 +67,9 @@ char *randomString(size_t length)
}
char
*
convertInt2Str
(
int
my_int
){
/* Convert integer to string */
/*
* Convert integer to string.
*/
int
length
=
snprintf
(
NULL
,
0
,
"%d"
,
my_int
);
char
*
my_str
=
malloc
(
length
+
1
);
snprintf
(
my_str
,
length
+
1
,
"%d"
,
my_int
);
...
...
@@ -75,16 +77,18 @@ char *convertInt2Str(int my_int){
}
char
*
convertLongInt2Str
(
long
int
my_int
){
/* Convert integer to string */
/*
* Convert a long integer to string.
*/
int
length
=
snprintf
(
NULL
,
0
,
"%ld"
,
my_int
);
char
*
my_str
=
malloc
(
length
+
1
);
snprintf
(
my_str
,
length
+
1
,
"%ld"
,
my_int
);
return
my_str
;
}
// XXX: dictionary implementation based on https://gist.github.com/kylef/86784/fe97567ec9baf5c0dce3c7fcbec948e21dfcce09
/*
* dictionary implementation based on https://gist.github.com/kylef/86784/fe97567ec9baf5c0dce3c7fcbec948e21dfcce09
*/
typedef
struct
dict_t_struct
{
char
*
key
;
...
...
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