Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: Proper standards in writing library headers

Reply
Thread Tools

Re: Proper standards in writing library headers

 
 
Öö Tiib
Guest
Posts: n/a
 
      10-30-2012
On Wednesday, 31 October 2012 00:31:31 UTC+2, Jason Benjamin wrote:
> Hi everyone. I'm going to try to write a library header for a third
> party library and I wanted to change some of the function names. I was
> thinking of just wrapping the functions in new functions within the
> header file itself.


You can do it as long the functions you define in header are declared
as inline.

> I just want to know, is this an appropriate way to do this, or is there
> some better or more acceptable way to achieve the same effect? I have
> considered writing a proxy library, but I think that would be superfluous.


That is hard to tell. Usually we try to add some value not only rename
some function names (or move into namespace) by a wrapper. However if
that is all you want to do then sounds appropriate way enough for me.
 
Reply With Quote
 
 
 
 
Jason Benjamin
Guest
Posts: n/a
 
      10-31-2012
On 10/30/2012 04:46 PM, Öö Tiib wrote:
> On Wednesday, 31 October 2012 00:31:31 UTC+2, Jason Benjamin wrote:
>> Hi everyone. I'm going to try to write a library header for a third
>> party library and I wanted to change some of the function names. I was
>> thinking of just wrapping the functions in new functions within the
>> header file itself.

>
> You can do it as long the functions you define in header are declared
> as inline.


I'm sorry I forgot to mention that I'm trying to write this in ANSI C,
not C99 or C++. However, I do know that the compiler I use, gcc,
supports inlining normally. What other compilers support inlining by
default? Also, I'm trying to code portably, so would it even be safe to
use inlining?
>
>> I just want to know, is this an appropriate way to do this, or is there
>> some better or more acceptable way to achieve the same effect? I have
>> considered writing a proxy library, but I think that would be superfluous.

>
> That is hard to tell. Usually we try to add some value not only rename
> some function names (or move into namespace) by a wrapper. However if
> that is all you want to do then sounds appropriate way enough for me.
>


 
Reply With Quote
 
 
 
 
Jason Benjamin
Guest
Posts: n/a
 
      10-31-2012
I'm sorry, wrong newsgroup.

On 10/30/2012 04:46 PM, Öö Tiib wrote:
> On Wednesday, 31 October 2012 00:31:31 UTC+2, Jason Benjamin wrote:
>> Hi everyone. I'm going to try to write a library header for a third
>> party library and I wanted to change some of the function names. I was
>> thinking of just wrapping the functions in new functions within the
>> header file itself.

>
> You can do it as long the functions you define in header are declared
> as inline.
>
>> I just want to know, is this an appropriate way to do this, or is there
>> some better or more acceptable way to achieve the same effect? I have
>> considered writing a proxy library, but I think that would be superfluous.

>
> That is hard to tell. Usually we try to add some value not only rename
> some function names (or move into namespace) by a wrapper. However if
> that is all you want to do then sounds appropriate way enough for me.
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with wsgiref.headers.Headers Phil Python 4 01-17-2010 04:47 PM
Proper echoing of HTTP headers from LWP call ? still me Perl Misc 0 10-18-2007 12:51 AM
Server cannot clear headers after HTTP headers have been sent Ian ASP .Net Security 2 03-20-2007 09:00 AM
Headers within <PRE> is not standards-compliant; alternatives? J44xm HTML 12 02-18-2005 05:45 PM
Reading 'received' headers: Email Headers Parsing dont bother Python 0 03-03-2004 08:18 PM



Advertisments