From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G9bcJ-0007wF-BS for qemu-devel@nongnu.org; Sun, 06 Aug 2006 01:56:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G9bcI-0007vq-6d for qemu-devel@nongnu.org; Sun, 06 Aug 2006 01:56:03 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G9bcI-0007vn-3P for qemu-devel@nongnu.org; Sun, 06 Aug 2006 01:56:02 -0400 Received: from [195.228.240.51] (helo=mta01.mail.t-online.hu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G9bgE-00020n-JW for qemu-devel@nongnu.org; Sun, 06 Aug 2006 02:00:06 -0400 Received: from mail.chello.hu (dsl51B667AA.pool.t-online.hu [81.182.103.170]) by mail.t-online.hu (Postfix) with ESMTP for ; Sun, 6 Aug 2006 07:56:00 +0200 (CEST) Date: Sun, 06 Aug 2006 07:55:59 +0200 Subject: Re: [Qemu-devel] ?off? ide/code editor under linux From: NyOS Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-2 MIME-Version: 1.0 References: <20060805.215246.-399283022.imp@bsdimp.com> Content-Transfer-Encoding: Quoted-Printable Message-ID: In-Reply-To: <20060805.215246.-399283022.imp@bsdimp.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" On Sun, 06 Aug 2006 05:52:46 +0200, M. Warner Losh wrot= e: > In message: > NyOS writes: > : #ifndef _FOO_H //capitals! > : #define _FOO_H //capitals! > > You sould avoid using _FOO_H for the define here. That's in the > implementation space and strictly speaking off limits to programmers > that merely use the system. FOO_H is better, and likely sufficiently > unambiguous. > > Warner Ok, that's true.. corrected.. But defines have full capital names traditionally (as you wrote FOO_H an= d = not foo_h).. Files/modules are lowercase.. AFAIK, even the most complex (I think) IDE I tried, kdevelop supports on= ly = a simple substitution, it cannot capitalize module name, neither allows = to = concatenate with "_H". (Or does it an undocumented way) nyos@nyos:~$ cat bin/newmodule #!/bin/bash #newmodule foo #creates foo.cpp and foo.h if [ "$1" =3D=3D "--help" ];then echo "usage: newmodule " exit 0 fi MODULENAME=3D$1 DEFINENAME=3D`toupper $1` HFILE=3D${MODULENAME}.h CPPFILE=3D${MODULENAME}.cpp DIR=3D~/src/nyfiletemplates/ NEWCPP=3D${DIR}/cpp NEWH=3D${DIR}/h if [ -f ${CPPFILE} ]; then mv -f ${CPPFILE} /tmp/${CPPFILE}.old fi if [ -f ${HFILE} ]; then mv -f ${HFILE} /tmp/${HFILE}.old fi sed -e "s/newfile/${MODULENAME}/g" -e "s/NEWFILE/${DEFINENAME}/g" = <${NEWCPP} >${CPPFILE} sed -e "s/newfile/${MODULENAME}/g" -e "s/NEWFILE/${DEFINENAME}/g" <${NEW= H} = >${HFILE} nyos@nyos:~/src/nyfiletemplates$ cat h /* description of newfile */ #ifndef NEWFILE_H #define NEWFILE_H //newfile class class newfile { protected: //attributes public: //default constructor of newfile newfile(); //destructor of newfile ~newfile(); //methods }; #endif nyos@nyos:~/src/nyfiletemplates$ cat cpp #include "headers.h" #include "newfile.h" newfile::newfile() { } newfile::~newfile() { } //methods Sorry for typos.. I've translated variable names and comments in this = letter to English (and removed unnecessary parts).. I think You can understand its point.. toupper makes uppercase letters (ok, it could be done with tr), sed = substitutes.. ugly, but works.. I've got similar scripts for creating = methods and putting in the code, adding attributes (and inserting defaul= t = getter/setter methods).. But I'd like to get rid of them.. (Or at least call them a bit cultivate= d = way, use a hotkey and give parameters on an X/curses form) So? What is Your advise? I'm open for new programs. Nyos