Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
fee92b77
Commit
fee92b77
authored
Aug 03, 2009
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix argv filling and comparing
parent
b8e17f1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
40 deletions
+19
-40
UniSetTypes.h
include/UniSetTypes.h
+4
-9
Configuration.cc
src/Various/Configuration.cc
+15
-31
No files found.
include/UniSetTypes.h
View file @
fee92b77
...
...
@@ -149,15 +149,10 @@ namespace UniSetTypes
int
_argc
,
char
**
_argv
,
const
std
::
string
defval
=
""
)
{
for
(
int
i
=
1
;
i
<
_argc
;
i
++
)
for
(
int
i
=
1
;
i
<
(
_argc
-
1
)
;
i
++
)
{
if
(
!
strcmp
(
_argv
[
i
],
name
.
c_str
())
)
{
int
k
=
i
+
1
;
if
(
k
<
_argc
)
return
_argv
[
k
];
break
;
}
if
(
name
==
_argv
[
i
]
)
return
_argv
[
i
+
1
];
}
return
defval
;
}
...
...
@@ -171,7 +166,7 @@ namespace UniSetTypes
{
for
(
int
i
=
1
;
i
<
_argc
;
i
++
)
{
if
(
!
strcmp
(
_argv
[
i
],
name
.
c_str
())
)
if
(
name
==
_argv
[
i
]
)
return
i
;
}
return
-
1
;
...
...
src/Various/Configuration.cc
View file @
fee92b77
...
...
@@ -307,15 +307,12 @@ void Configuration::initConfiguration( int argc, char** argv )
_argc
=
argc
+
2
*
lnodes
.
size
()
+
2
;
_argv
=
new
char
*
[
_argc
];
int
i
=
0
;
//
int
i
=
0
;
for
(
;
i
<
argc
;
i
++
)
{
_argv
[
i
]
=
new
char
[
strlen
(
argv
[
i
])
+
1
];
strcpy
(
_argv
[
i
],
argv
[
i
]);
}
for
(
;
i
<
argc
;
i
++
)
_argv
[
i
]
=
strdup
(
argv
[
i
]);
//
//
, i
for
(
UniSetTypes
::
ListOfNode
::
iterator
it
=
lnodes
.
begin
();
it
!=
lnodes
.
end
();
++
it
)
{
_argv
[
i
]
=
"-ORBInitRef"
;
...
...
@@ -323,8 +320,7 @@ void Configuration::initConfiguration( int argc, char** argv )
string
name
(
oind
->
getRealNodeName
(
it
->
id
));
ostringstream
param
;
param
<<
name
<<
"=corbaname::"
<<
it
->
host
<<
":"
<<
it
->
port
;
_argv
[
i
+
1
]
=
new
char
[
param
.
str
().
size
()
+
1
];
// +1 - \0
strcpy
(
_argv
[
i
+
1
],
param
.
str
().
c_str
());
_argv
[
i
+
1
]
=
strdup
(
param
.
str
().
c_str
());
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
unideb
[
Debug
::
INFO
]
<<
"(Configuration): "
<<
param
.
str
()
<<
endl
;
...
...
@@ -355,10 +351,7 @@ void Configuration::initConfiguration( int argc, char** argv )
ostringstream
param
;
param
<<
"NameService=corbaname::"
<<
getProp
(
nsnode
,
"host"
)
<<
":"
<<
defPort
;
//
_argv
[
i
+
1
]
=
new
char
[
param
.
str
().
size
()
+
1
];
// +1 - \0
//
strcpy
(
_argv
[
i
+
1
],
param
.
str
().
c_str
());
_argv
[
i
+
1
]
=
strdup
(
param
.
str
().
c_str
());
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
unideb
[
Debug
::
INFO
]
<<
"(Configuration): "
<<
param
.
str
()
<<
endl
;
}
...
...
@@ -771,32 +764,23 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname )
string
del_level
(
"--"
+
debname
+
"-del-levels"
);
//
for
(
int
i
=
1
;
i
<
_argc
;
i
++
)
for
(
int
i
=
1
;
i
<
(
_argc
-
1
)
;
i
++
)
{
if
(
!
strcmp
(
_argv
[
i
],
log_in
.
c_str
())
)
// "--debug-log_in_file"
if
(
log_in
==
_argv
[
i
]
)
// "--debug-log_in_file"
{
if
(
i
+
1
<
_argc
)
deb
.
logFile
(
_argv
[
i
+
1
]);
deb
.
logFile
(
_argv
[
i
+
1
]);
}
else
if
(
!
strcmp
(
_argv
[
i
],
add_level
.
c_str
())
)
// "--debug-add-levels"
else
if
(
add_level
==
_argv
[
i
]
)
// "--debug-add-levels"
{
if
(
i
+
1
<
_argc
)
{
string
val
(
_argv
[
i
+
1
]);
deb
.
addLevel
(
Debug
::
value
(
val
));
}
deb
.
addLevel
(
Debug
::
value
(
_argv
[
i
+
1
]));
}
else
if
(
!
strcmp
(
_argv
[
i
],
del_level
.
c_str
())
)
// "--debug-del-levels"
else
if
(
del_level
==
_argv
[
i
]
)
// "--debug-del-levels"
{
if
(
i
+
1
<
_argc
)
{
string
val
(
_argv
[
i
+
1
]);
deb
.
delLevel
(
Debug
::
value
(
val
));
}
deb
.
delLevel
(
Debug
::
value
(
_argv
[
i
+
1
]));
}
}
return
dnode
;
return
dnode
;
}
// -------------------------------------------------------------------------
void
Configuration
::
initRepSections
()
...
...
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