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
6104cbaf
Commit
6104cbaf
authored
Feb 21, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
02fd0aae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
199 additions
and
0 deletions
+199
-0
src/exe/rt_gdhget/src/os_linux/hw_x86/makefile
src/exe/rt_gdhget/src/os_linux/hw_x86/makefile
+15
-0
src/exe/rt_gdhget/src/os_linux/link_rule.mk
src/exe/rt_gdhget/src/os_linux/link_rule.mk
+11
-0
src/exe/rt_gdhget/src/rt_gdhget.c
src/exe/rt_gdhget/src/rt_gdhget.c
+173
-0
No files found.
src/exe/rt_gdhget/src/os_linux/hw_x86/makefile
0 → 100644
View file @
6104cbaf
include
$(pwre_dir_symbols)
-include
$(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq
($($(type_name)_generic_mk),)
-include
$(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq
($($(type_name)_generic_mk),)
include
$(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include
../../special.mk
-include
../special.mk
-include
special.mk
src/exe/rt_gdhget/src/os_linux/link_rule.mk
0 → 100644
View file @
6104cbaf
ifndef
link_rule_mk
link_rule_mk
:=
1
link
=
$(ldxx)
$(linkflags)
$(domap)
-o
$(export_exe)
\
$(export_obj)
$(objects)
$(rt_msg_objs)
\
$(pwr_obj)
/rt_io_user.o
\
-lpwr_rt
-lpwr_co
\
-lpwr_msg_dummy
\
-lrpcsvc
-lpthread
-lm
-lrt
endif
src/exe/rt_gdhget/src/rt_gdhget.c
0 → 100644
View file @
6104cbaf
/*
* Proview $Id: rt_gdhget.c,v 1.1 2007-02-21 10:00:48 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <math.h>
#include <float.h>
#include <stdlib.h>
#include "pwr.h"
#include "co_cdh.h"
#include "rt_gdh.h"
void
usage
()
{
printf
(
"
\n
\
rt_gdhget Print specified attribute value on stdout
\n\n
\
rg_gdhget [-c 'class'] 'attribute'
\n\n
\
-c Find the first object of the specified class and print the
\n
\
specified attribute.
\n
\
"
);
}
int
main
(
int
argc
,
char
**
argv
)
{
pwr_tStatus
sts
;
char
*
c
;
int
cidopt
=
0
;
pwr_tObjName
cidstr
;
pwr_tAName
astr
;
int
i
;
if
(
argc
<=
1
)
{
usage
();
exit
(
1
);
}
sts
=
gdh_Init
(
"rt_gdhget"
);
if
(
EVEN
(
sts
))
{
exit
(
sts
);
}
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
c
=
argv
[
i
];
if
(
*
c
==
'-'
)
{
c
++
;
switch
(
*
c
)
{
case
'h'
:
usage
();
exit
(
0
);
case
'c'
:
if
(
argc
<=
i
+
1
)
{
usage
();
exit
(
1
);
}
strncpy
(
cidstr
,
argv
[
i
+
1
],
sizeof
(
cidstr
));
cidopt
=
1
;
i
++
;
break
;
}
}
else
strcpy
(
astr
,
argv
[
i
]);
}
if
(
cidopt
)
{
// Get the first object of class cidstr, and print the value of attribute
// astr in this object
pwr_tCid
cid
;
pwr_tOid
oid
;
pwr_tAttrRef
aref
,
aaref
;
pwr_tTid
a_tid
;
unsigned
int
a_size
,
a_offs
,
a_dim
;
void
*
a_valp
;
char
str
[
256
];
sts
=
gdh_ClassNameToId
(
cidstr
,
&
cid
);
if
(
EVEN
(
sts
))
{
exit
(
sts
);
}
sts
=
gdh_GetClassList
(
cid
,
&
oid
);
if
(
EVEN
(
sts
))
{
exit
(
sts
);
}
aref
=
cdh_ObjidToAref
(
oid
);
sts
=
gdh_ArefANameToAref
(
&
aref
,
astr
,
&
aaref
);
if
(
EVEN
(
sts
))
{
exit
(
sts
);
}
sts
=
gdh_GetAttributeCharAttrref
(
&
aaref
,
&
a_tid
,
&
a_size
,
&
a_offs
,
&
a_dim
);
if
(
EVEN
(
sts
))
{
exit
(
sts
);
}
a_valp
=
calloc
(
1
,
a_size
);
sts
=
gdh_GetObjectInfoAttrref
(
&
aaref
,
a_valp
,
a_size
);
if
(
EVEN
(
sts
))
{
free
(
a_valp
);
exit
(
sts
);
}
sts
=
cdh_AttrValueToString
(
a_tid
,
a_valp
,
str
,
sizeof
(
str
));
if
(
EVEN
(
sts
))
{
free
(
a_valp
);
exit
(
sts
);
}
printf
(
"%s
\n
"
,
str
);
free
(
a_valp
);
exit
(
0
);
}
else
{
// Print the value of the attriute in astr
pwr_tTypeId
a_tid
;
pwr_tUInt32
a_size
,
a_offs
,
a_elem
;
void
*
a_valp
;
char
str
[
256
];
sts
=
gdh_GetAttributeCharacteristics
(
astr
,
&
a_tid
,
&
a_size
,
&
a_offs
,
&
a_elem
);
if
(
EVEN
(
sts
))
{
exit
(
sts
);
}
a_valp
=
calloc
(
1
,
a_size
);
sts
=
gdh_GetObjectInfo
(
astr
,
a_valp
,
a_size
);
if
(
EVEN
(
sts
))
{
free
(
a_valp
);
exit
(
sts
);
}
sts
=
cdh_AttrValueToString
(
a_tid
,
a_valp
,
str
,
sizeof
(
str
));
if
(
EVEN
(
sts
))
{
free
(
a_valp
);
exit
(
sts
);
}
printf
(
"%s
\n
"
,
str
);
free
(
a_valp
);
exit
(
0
);
}
exit
(
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