[asterisk-dev] Re: [asterisk-commits] oej: trunk r45209 - /trunk/channels/chan_sip.c

Luigi Rizzo rizzo at icir.org
Mon Oct 16 06:38:13 MST 2006


On Mon, Oct 16, 2006 at 01:20:21PM -0000, asterisk-commits at lists.digium.com wrote:
> Author: oej
> Date: Mon Oct 16 08:20:21 2006
> New Revision: 45209
> 
> URL: http://svn.digium.com/view/asterisk?rev=45209&view=rev
> Log:
> When adding new functions, please add a forward declaration.
> I *know* it is not required, but it makes navigation easier and will help
> when splitting up this large source code file. 

actually, there are several classes of [static] functions where NOT declaring
a prototype is a conscious decision:

+ functions (such as do_setnat() here) which are just to avoid a few
  repeated instances of code, but are not of general applicability
  otherwise. Their interface may also change often enough to discourage
  general use;

+ functions that are used only in one place, to split a huge function
  in more manageable blocks. Again, these may have a frequently changing
  interface, and normally cannot be used in other places.

For other functions with more general applicability (even if limited to
a single file) i have no problem in declaring a prototype, but for these
ones, i do have reasons against.

	cheers
	luigi

> Thank you!
> 
> Modified:
>     trunk/channels/chan_sip.c
> 
> Modified: trunk/channels/chan_sip.c
> URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=45209&r1=45208&r2=45209&view=diff
> ==============================================================================
> --- trunk/channels/chan_sip.c (original)
> +++ trunk/channels/chan_sip.c Mon Oct 16 08:20:21 2006
> @@ -1252,6 +1252,7 @@
>  				char **m_buf, size_t *m_size, char **a_buf, size_t *a_size,
>  				int debug);
>  static int add_sdp(struct sip_request *resp, struct sip_pvt *p);
> +static void do_setnat(struct sip_pvt *p, int natflags);
>  
>  /*--- Authentication stuff */
>  static int reply_digest(struct sip_pvt *p, struct sip_request *req, char *header, int sipmethod, char *digest, int digest_len);
> 
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> asterisk-commits mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-commits


More information about the asterisk-dev mailing list