From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,92fea0e45d933ff4 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Ada sources MIME type Date: Wed, 30 Mar 2011 19:40:57 +0200 Organization: Ada @ Home Message-ID: References: NNTP-Posting-Host: raCdcWXogJxNMsDhKAp0pA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.01 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:18605 Date: 2011-03-30T19:40:57+02:00 List-Id: Le Thu, 10 Mar 2011 11:01:08 +0100, Yannick Duch=C3=AAne (Hibou57) = a =C3=A9crit: > Hello, > > Sorry, not a main target topic. I've noticed after GNAT was installed = in = > Ubuntu, it seems it added a MIME type for Ada sources (good, or may be= = > it was there before, I do not know). The MIME type is defined to be = > =E2=80=9Cx-adasrc=E2=80=9D and its parent type is defined as =E2=80=9C= text/plain=E2=80=9D. Looks nice, = > but the same way all C derived languages defines =E2=80=9Ctext/x-csrc=E2= =80=9D as their = > parent type (whose parent is in turn =E2=80=9Ctext/plain=E2=80=9D, obv= iously), I was = > thinking this may be more nice to define the parent type of =E2=80=9Cx= -adasrc=E2=80=9D = > as =E2=80=9Cx-pascal=E2=80=9D (which already exists in the default MIM= E data base). Also, C sources MIME type makes distinction between implementation and = specification (C and H files), while there is actually even not really = such a thing in C. Ada really has this, and its MIME type makes no = distinction (we can't accept this any longer [*]). So I suggest anyone = able to push, will try to push/promote/enforce this: promote a = "text/x-ada-spec" and an "text/x-ada-body" MIME types for Ada source = files. For integration in Unicies systems using a file type detection = based on the file content, we should not rely on file extension, as this= = is vendor specific (although this could be used as a fall-back, at least= = on Windows), and instead rely on this: if the file contains a "^package = = body .*$" then it is a text/x-ada-body, and if it contains a "^package = [A-Z].*$" (which should cover most of cases) then it is a text/x-ada-spe= c [*] I wanted to play the fool a bit with this post wordings. -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens. =E2=80=9C c++; /* this makes c bigger but returns the old value */ =E2=80= =9D [Anonymous]