realbasic-plugins
[Top] [All Lists]

Appending _ to internal function names

To: plugins REALbasic <realbasic-plugins at lists dot realsoftware dot com>
Subject: Appending _ to internal function names
From: "Theodore H. Smith" <delete at elfdata dot com>
Date: Mon, 29 May 2006 22:26:55 +0100
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
Hi list,

I've decided that some functions in my ElfData plugin's .cpp files, should not be available from other .cpp files. This doesn't affect the plugin's compiled form in any way, it's just an internal housekeeping matter.

Previously, I was using the convention of prefixing all functions that should only be used by the .cpp file that implements it, with local_ , and making it static of course. This has an advantage that I don't need to prepend my plugin or class name, because the function can only be used by the file that calls it.

For example, normally I might have a function ED_FS_InternalUtility. Now I can use local_InternalUtility.

But I was thinking actually I didn't like the look of the local_ prefix. It just looks dumb to me.

Maybe I could do the same convention by appending _? So I'll get "InternalUtility_" as the function name. Already it does look better to me.

Is there any harm that could come by appending this _ ? I remember that linkers sometimes reserve _ as a special character, although I understand that it's only reserved for the first letter of a function name, not the last.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>