Changing the format of PhAB generated code

Hi.

Is there a way to change the format of callback function stubs
that PhAB inserts into my code? For example, it inserts:
(the <> bits are because I can’t copy and paste from photon
to here, and can’t be bothered typing it in)

int
mycallback()

{

return( PtContinue );

}

I would prefer:

int mycallback()
{

return (PtContinue);
}

note the changes in spacing and tabbing.

Is it possible to do this, so that I don’t have to keep
modifying it by hand?

Cheers

mark-r


Infact Holdings (UK) | There’s lies, damned lies
Unit 52 Salford Uni Business Park | and Amplifier power ratings.
Leslie Hough Way,Salford M6 6AJ, UK | – Bluffers Guide to Hi-Fi.
http://www.infact-holdings.com/


Sent via Deja.com http://www.deja.com/
Before you buy.

I have always wondered too if it was customizable. At least QSSL didnt do
them this way:

int
mycallback(…) {
stuff
more stuff
}

I hate that format. At least I can live with the current format. :slight_smile:

Jim

Mark Robinson <mark@infact-holdings.com> wrote in message
news:8l6o94$eji$1@nnrp1.deja.com

Hi.

Is there a way to change the format of callback function stubs
that PhAB inserts into my code? For example, it inserts:
(the <> bits are because I can’t copy and paste from photon
to here, and can’t be bothered typing it in)

int
mycallback()

{

unreferenced warnings

return( PtContinue );

}

I would prefer:

int mycallback()
{
unreferenced warnings

return (PtContinue);
}

note the changes in spacing and tabbing.

Is it possible to do this, so that I don’t have to keep
modifying it by hand?

Cheers

mark-r


Infact Holdings (UK) | There’s lies, damned lies
Unit 52 Salford Uni Business Park | and Amplifier power ratings.
Leslie Hough Way,Salford M6 6AJ, UK | – Bluffers Guide to Hi-Fi.
http://www.infact-holdings.com/


Sent via Deja.com > http://www.deja.com/
Before you buy.

Add me to the list of those interested. I hate having to change it
by hand. I have various projects to support, and they each have
various code style guidelines. None of them are compatible with
the generated code format. While we’re at it, C++ generated code
would be good too…

-Barry

Jim Lambert wrote:

I have always wondered too if it was customizable. At least QSSL didnt do
them this way:

int
mycallback(…) {
stuff
more stuff
}

I hate that format. At least I can live with the current format. > :slight_smile:

Jim

Mark Robinson <> mark@infact-holdings.com> > wrote in message
news:8l6o94$eji$> 1@nnrp1.deja.com> …


Hi.

Is there a way to change the format of callback function stubs
that PhAB inserts into my code? For example, it inserts:
(the <> bits are because I can’t copy and paste from photon
to here, and can’t be bothered typing it in)

int
mycallback()

{

unreferenced warnings

return( PtContinue );

}

I would prefer:

int mycallback()
{
unreferenced warnings

return (PtContinue);
}

note the changes in spacing and tabbing.

Is it possible to do this, so that I don’t have to keep
modifying it by hand?

Cheers

mark-r


Infact Holdings (UK) | There’s lies, damned lies
Unit 52 Salford Uni Business Park | and Amplifier power ratings.
Leslie Hough Way,Salford M6 6AJ, UK | – Bluffers Guide to Hi-Fi.
http://www.infact-holdings.com/


Sent via Deja.com > http://www.deja.com/
Before you buy.


__| _ \ _ | Barry Robertson
_
\ | | | Software Consultant Phone: 972-758-9349
| __ < | Software Remodeling, Inc. Fax: 972-964-7524
___/ _| __| brobertson@SoftwareRemodeling.com

appbuilder/codelib directory looks tempting. I’ve never got around to
fiddling with the contents but it sure looks like the ticket.

“Mark Robinson” <mark@infact-holdings.com> wrote in message
news:8l6o94$eji$1@nnrp1.deja.com

Hi.

Is there a way to change the format of callback function stubs
that PhAB inserts into my code? For example, it inserts:
(the <> bits are because I can’t copy and paste from photon
to here, and can’t be bothered typing it in)

int
mycallback()

{

unreferenced warnings

return( PtContinue );

}

I would prefer:

int mycallback()
{
unreferenced warnings

return (PtContinue);
}

note the changes in spacing and tabbing.

Is it possible to do this, so that I don’t have to keep
modifying it by hand?

Cheers

mark-r


Infact Holdings (UK) | There’s lies, damned lies
Unit 52 Salford Uni Business Park | and Amplifier power ratings.
Leslie Hough Way,Salford M6 6AJ, UK | – Bluffers Guide to Hi-Fi.
http://www.infact-holdings.com/


Sent via Deja.com > http://www.deja.com/
Before you buy.

GNU have a utility called “indent” that will reformat C/C++ code with the output
format highly configurable. Hope this helps.

Barry Robertson wrote:

Add me to the list of those interested. I hate having to change it
by hand. I have various projects to support, and they each have
various code style guidelines. None of them are compatible with
the generated code format. While we’re at it, C++ generated code
would be good too…

-Barry

Jim Lambert wrote:

I have always wondered too if it was customizable. At least QSSL didnt do
them this way:

int
mycallback(…) {
stuff
more stuff
}

I hate that format. At least I can live with the current format. > :slight_smile:

Jim

Mark Robinson <> mark@infact-holdings.com> > wrote in message
news:8l6o94$eji$> 1@nnrp1.deja.com> …


Hi.

Is there a way to change the format of callback function stubs
that PhAB inserts into my code? For example, it inserts:
(the <> bits are because I can’t copy and paste from photon
to here, and can’t be bothered typing it in)

int
mycallback()

{

unreferenced warnings

return( PtContinue );

}

I would prefer:

int mycallback()
{
unreferenced warnings

return (PtContinue);
}

note the changes in spacing and tabbing.

Is it possible to do this, so that I don’t have to keep
modifying it by hand?

Cheers

mark-r


Infact Holdings (UK) | There’s lies, damned lies
Unit 52 Salford Uni Business Park | and Amplifier power ratings.
Leslie Hough Way,Salford M6 6AJ, UK | – Bluffers Guide to Hi-Fi.
http://www.infact-holdings.com/


Sent via Deja.com > http://www.deja.com/
Before you buy.


__| _ \ _ | Barry Robertson
_
\ | | | Software Consultant Phone: 972-758-9349
| __ < | Software Remodeling, Inc. Fax: 972-964-7524
___/ _| __| > brobertson@SoftwareRemodeling.com

Ok, just tested it. I changed the stubfun.c file to be the format I wanted.
The only caveat is the .Function and other .commands must be the first
character as I thought. Other than that though it worked like a champ.

If any QSSL’ers are reading, it would be nice if you could change it to
recognize the .Function or other .keywords other than in the first character
position.

Jim

Robert Surtees <news@surtees.com> wrote in message
news:WDFd5.35773$6y5.23866945@news2.rdc2.tx.home.com

appbuilder/codelib directory looks tempting. I’ve never got around to
fiddling with the contents but it sure looks like the ticket.

“Mark Robinson” <> mark@infact-holdings.com> > wrote in message
news:8l6o94$eji$> 1@nnrp1.deja.com> …


Hi.

Is there a way to change the format of callback function stubs
that PhAB inserts into my code? For example, it inserts:
(the <> bits are because I can’t copy and paste from photon
to here, and can’t be bothered typing it in)

int
mycallback()

{

unreferenced warnings

return( PtContinue );

}

I would prefer:

int mycallback()
{
unreferenced warnings

return (PtContinue);
}

note the changes in spacing and tabbing.

Is it possible to do this, so that I don’t have to keep
modifying it by hand?

Cheers

mark-r


Infact Holdings (UK) | There’s lies, damned lies
Unit 52 Salford Uni Business Park | and Amplifier power ratings.
Leslie Hough Way,Salford M6 6AJ, UK | – Bluffers Guide to Hi-Fi.
http://www.infact-holdings.com/


Sent via Deja.com > http://www.deja.com/
Before you buy.

Jim Lambert <jlambert@eftsolutions.com> wrote in message
news:8l75oq$ovr$1@inn.qnx.com

I have always wondered too if it was customizable. At least QSSL didnt do
them this way:

int
mycallback(…) {
stuff
more stuff
}

Thank god too, I hate reading code formatted like that.

I hate that format. At least I can live with the current format. > :slight_smile:

Jim

Mark Robinson <> mark@infact-holdings.com> > wrote in message
news:8l6o94$eji$> 1@nnrp1.deja.com> …


Hi.

Is there a way to change the format of callback function stubs
that PhAB inserts into my code? For example, it inserts:
(the <> bits are because I can’t copy and paste from photon
to here, and can’t be bothered typing it in)

int
mycallback()

{

unreferenced warnings

return( PtContinue );

}

I would prefer:

int mycallback()
{
unreferenced warnings

return (PtContinue);
}

note the changes in spacing and tabbing.

Is it possible to do this, so that I don’t have to keep
modifying it by hand?

Cheers

mark-r


Infact Holdings (UK) | There’s lies, damned lies
Unit 52 Salford Uni Business Park | and Amplifier power ratings.
Leslie Hough Way,Salford M6 6AJ, UK | – Bluffers Guide to Hi-Fi.
http://www.infact-holdings.com/


Sent via Deja.com > http://www.deja.com/
Before you buy.

Jim Lambert <jlambert@eftsolutions.com> wrote:
: If any QSSL’ers are reading, it would be nice if you could change it to
: recognize the .Function or other .keywords other than in the first character
: position.

I’ll pass this on to the Photon guys.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems Ltd.

Barry Robertson <brobertson@SoftwareRemodeling.com> writes:

Add me to the list of those interested. I hate having to change it
by hand. I have various projects to support, and they each have
various code style guidelines. None of them are compatible with
the generated code format. While we’re at it, C++ generated code
would be good too…

Mark Robinson <> mark@infact-holdings.com> > wrote in message
news:8l6o94$eji$> 1@nnrp1.deja.com> …


Hi.

Is there a way to change the format of callback function stubs
that PhAB inserts into my code? For example, it inserts:
(the <> bits are because I can’t copy and paste from photon
to here, and can’t be bothered typing it in)

Under QNX4, the callback function stubs are all held in files in
/qnx4/phtk/appbuilder/codelib
You can alter these files a little bit to more closely meet your own
coding style, though the .Options, .Functions, etc. are not really
under your control, so you only get a partial solution. Every time
you upgrade PhAB, it will over-write your changes. I don’t know about
PhAB for Photon 2.

\

Andrew Thomas, President, Cogent Real-Time Systems Inc.
2430 Meadowpine Boulevard, Suite 105, Mississauga, Ontario, Canada L5N 6S2
Email: andrew@cogent.ca WWW: http://www.cogent.ca

In article <8l7a2b$qrp$1@inn.qnx.com>,
“Jim Lambert” <jlambert@eftsolutions.com> wrote:

Ok, just tested it. I changed the stubfun.c file to be the format I
wanted.
The only caveat is the .Function and other .commands must be the first
character as I thought. Other than that though it worked like a
champ.

Yep, great stuff. the .keyword having to be the first character
is a limitation though, for instance I still have to have the
return type on a different line to the function name.

More flexibility here would be a boon, because a lot of sites
have style guides that must be adhered to - even by machine
generated code!

Cheers

mark-r


Infact Holdings (UK) | There’s lies, damned lies
Unit 52 Salford Uni Business Park | and Amplifier power ratings.
Leslie Hough Way,Salford M6 6AJ, UK | – Bluffers Guide to Hi-Fi.
http://www.infact-holdings.com/


Sent via Deja.com http://www.deja.com/
Before you buy.