Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71468 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13230 invoked from network); 23 Jan 2014 22:42:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2014 22:42:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.173 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.173 mail-lb0-f173.google.com Received: from [209.85.217.173] ([209.85.217.173:62486] helo=mail-lb0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/AE-39789-2DA91E25 for ; Thu, 23 Jan 2014 17:42:27 -0500 Received: by mail-lb0-f173.google.com with SMTP id y6so1996883lbh.32 for ; Thu, 23 Jan 2014 14:42:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=R+3snmVV8tkdCG1t3nXe33MN64AX2L/MTMdIYNbn+Iw=; b=bG++wynwU722ygpo8ItTRA9bfhMv/bjkxG32Fo5GhcFVUsjCIFhYUEAycpIl6PhBEn zGHseuwd6axh63G/Wc3ePDeF3zouC3lGmRVFKXETKQJ9JMtEJzNHX+qhIzTYJN1dvxB6 OTObVjypKukLTgWQPSRdyf0rsbKB7mIwD/6K1DLf1d+09dlyIs1aWdKHDSkuGvjCjpUb zSIKCTd7tXuLwo8b2OKjDRi2mdBidFlGWkgIJoJhjVEDWWONzQrzjhbNtjSDBKzXQsGH 0FzPNzDTV/GMajvynHK/wmMkkk9NVZfG+Gd3Tj25gKuOj2/PTdNL3Bws791NUQX85Z5C VHxA== X-Received: by 10.112.159.69 with SMTP id xa5mr68550lbb.89.1390516943627; Thu, 23 Jan 2014 14:42:23 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.132.134 with HTTP; Thu, 23 Jan 2014 14:41:43 -0800 (PST) Date: Fri, 24 Jan 2014 07:41:43 +0900 X-Google-Sender-Auth: zigxJh0naohM4zsq49h1LMNioTA Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c2ba7e7aaa4504f0aaf43e Subject: Module function API naming conventions From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c2ba7e7aaa4504f0aaf43e Content-Type: text/plain; charset=UTF-8 Hi all, When I try to add dummy save handler functions for session module, I noticed that ps_update() etc has been defined in SOAP module. To avoid collisions, we might better to have following change in CODING_STANDARDS. [yohgaki@dev PHP-5.4]$ git diff diff --git a/CODING_STANDARDS b/CODING_STANDARDS index 7a0562e..4c67a30 100644 --- a/CODING_STANDARDS +++ b/CODING_STANDARDS @@ -82,7 +82,7 @@ Exceptions: library may need to control or free the memory, or when the memory in question needs to survive between multiple requests. -Naming Conventions +User Functions/Methods Naming Conventions ------------------ 1. Function names for user-level functions should be enclosed with in @@ -163,6 +163,19 @@ Naming Conventions 'foobar' 'foo_bar' +Internal Function Naming Conventions +---------------------- + +1. Exposed module API must have 'php_modulename_function()' to avoid + symbol collision. They should be in lowercase, with words + underscore delimited. + +2. Main module source file must be named modulename.c. + +3. Header file that are used by other sources than it's module must be + named 'php_modulename.h'. + + Syntax and indentation ---------------------- The rule should be applied to new modules, not existing one. Main source and header is named like this, since ext_skel creates files as above. Any comments? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c2ba7e7aaa4504f0aaf43e--