Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: OXFInit arguments
Topic Summary:
Created On: 27-Jul-2004 16:58
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 27-Jul-2004 16:58
User is offline View Users Profile Print this message


Ricardo Camacho

Posts: 34
Joined: 30-Jun-2004

Hi Support,

Is there a property to change the arguments for the call to
OXFInit(argc, argv, 6423) ?
I need to change the argc and argv to different names.

Thanks,
Ricardo
Report this to a Moderator Report this to a Moderator
 27-Jul-2004 16:58
User is offline View Users Profile Print this message


Scott Niemann

Posts: 109
Joined: 30-Jun-2004

I think this is something that needs to be addressed. There is a workaround
for this, which is below, but I tried this with 4.0 and it doesn't work.
With 3.0.1 it works. We had to come up with this at Motorola, probably for
the same reasons that Ricardo needs it. But the workaround doesn't work in
4.0, because there is an auto generated extra comment before the main which
mucks things up. We actually had to change the number of parameters in the
main.

You can use the implementationprolog property of the Configuration metaclass
to rewrite this line, then put a comment (//) on the next line without a
carriage return, which will comment out the generate OXFInit line. (Only
for 3.0.1 releases and below).

Scott
Report this to a Moderator Report this to a Moderator
 27-Jul-2004 16:58
User is offline View Users Profile Print this message


Amos Ortal

Posts: 120
Joined: 22-Jul-2004

You can use the CG::Configuration:reFrameworkInitCode property to reset the argc/argv arguments.
Report this to a Moderator Report this to a Moderator
 27-Jul-2004 16:59
User is offline View Users Profile Print this message


Scott Niemann

Posts: 109
Joined: 30-Jun-2004

You still need a case where you change number of parameters in the main. This is what we do now with 3.0.1 via implementation prolog. Each Rhapsody project is built as a task to the system. There is a centralizing task which goes through and runs each task in the system. The centralizing task is not done with Rhapsody and has certain stringent requirements to invoke each Rhapsody application task, so we have to modify the main line generated. This is different than Ricardo's requirement. How can we do this in 4.0, since our trick won't work anymore. The only way I know of is to create a configuration file representing the main, but this will null out auto code generation.
Report this to a Moderator Report this to a Moderator
 27-Jul-2004 17:00
User is offline View Users Profile Print this message


Amos Ortal

Posts: 120
Joined: 22-Jul-2004

The 3.0.1 model show a way to disable the automatic initialization (and the call to OXFInit()) that will work in 4.0
Note The configuration CG::Configuration:reFrameworkInitCode property and the initialization code (in the configuration initialization tab).
Report this to a Moderator Report this to a Moderator
 27-Jul-2004 17:00
User is offline View Users Profile Print this message


Ricardo Camacho

Posts: 34
Joined: 30-Jun-2004

Scott and Amos,

I also needed to change the code generated for main, so I used the property:
- CPP_CG as the Subject,
- Microsoft as the Meta Class but choose your needed environment (e.g. VxWorks, pSOS...)
- Select the property "EntryPoint"
- I rewrote the main and its arguments here.
(Note: At the end of the string enter a comment "//" without a carriage return to comment out the extra generated code for the arguments of main)

I believe there should be a clean way to modify the entry point main( ) and the call arguments to OXFInit( ).
This example looks/is a workaround for customers.

Ricardo

P.S. Thanks for the workaround.
Report this to a Moderator Report this to a Moderator
 27-Jul-2004 17:00
User is offline View Users Profile Print this message


Amos Ortal

Posts: 120
Joined: 22-Jul-2004

We actually have a way to modify the main() signature that is implemented in the OSE adaptor.
Here is what you should do:
- add to your environment properties a new property EntryPointDeclarationModifier and set in to the main return value and name (say "int main")
- set the EntryPoint property to the main arguments (say "int a, long b, char** ")
- generate code

You will get the following main() declaration:
int main(int a, long b, char** c) {
...
}

Amos
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.