From owner-freebsd-bugs@FreeBSD.ORG Fri May 28 13:10:13 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E60B16A4CE for ; Fri, 28 May 2004 13:10:13 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 918BC43D48 for ; Fri, 28 May 2004 13:10:13 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i4SKA4JX009649 for ; Fri, 28 May 2004 13:10:04 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i4SKA41W009644; Fri, 28 May 2004 13:10:04 -0700 (PDT) (envelope-from gnats) Resent-Date: Fri, 28 May 2004 13:10:04 -0700 (PDT) Resent-Message-Id: <200405282010.i4SKA41W009644@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Cyrille Lefevre Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55E2716A4CE for ; Fri, 28 May 2004 13:09:46 -0700 (PDT) Received: from ioskeha.hittite.isp.9tel.net (ioskeha.hittite.isp.9tel.net [62.62.156.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9716343D31 for ; Fri, 28 May 2004 13:09:45 -0700 (PDT) (envelope-from cyrille.lefevre@laposte.net) Received: from mail.gits.dyndns.org (unknown [80.119.167.76]) by ioskeha.hittite.isp.9tel.net (Postfix) with ESMTP id 26CC117B521 for ; Fri, 28 May 2004 22:10:24 +0200 (CEST) Received: from gits.gits.fr.invalid (IDENT:pygvb4ypng2cr5tb@localhost [127.0.0.1])i4SK7n6s046964 for ; Fri, 28 May 2004 22:09:06 +0200 (CEST) (envelope-from cyrille.lefevre@laposte.net) Received: by gits.gits.fr.invalid (tmda-sendmail, from uid 0); Fri, 28 May 2004 22:07:42 +0200 (CEST) Message-Id: <20040528200735.GA18621@gits.dyndns.org> Date: Fri, 28 May 2004 22:07:36 +0200 From: Cyrille Lefevre To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/67307: ready to import bootstrap_cmds/decomment from Darwin X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Cyrille Lefevre List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2004 20:10:13 -0000 >Number: 67307 >Category: bin >Synopsis: ready to import bootstrap_cmds/decomment from Darwin >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri May 28 13:10:04 PDT 2004 >Closed-Date: >Last-Modified: >Originator: Cyrille Lefevre >Release: FreeBSD 5.2-CURRENT i386 >Organization: ACME >Environment: System: FreeBSD gits 5.2-CURRENT FreeBSD 5.2-CURRENT #28: Thu May 13 00:19:50 CEST 2004 root@gits:/disk3/freebsd/current/obj/disk3/freebsd/current/src/sys/CUSTOM i386 >Description: decomment strip off C/C++ comments from a file. >How-To-Repeat: n/a >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # usr.bin/decomment/Makefile # usr.bin/decomment/decomment.c # echo x - usr.bin/decomment/Makefile sed 's/^X//' >usr.bin/decomment/Makefile << 'END-of-usr.bin/decomment/Makefile' X# $FreeBSD$ X XPROG= decomment XWARNS?= 6 XNO_MAN= yes X X.include END-of-usr.bin/decomment/Makefile echo x - usr.bin/decomment/decomment.c sed 's/^X//' >usr.bin/decomment/decomment.c << 'END-of-usr.bin/decomment/decomment.c' X/* X * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. X * X * @APPLE_LICENSE_HEADER_START@ X * X * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. X * X * This file contains Original Code and/or Modifications of Original Code X * as defined in and that are subject to the Apple Public Source License X * Version 2.0 (the 'License'). You may not use this file except in X * compliance with the License. Please obtain a copy of the License at X * http://www.opensource.apple.com/apsl/ and read it before using this X * file. X * X * The Original Code and all software distributed under the License are X * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER X * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, X * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, X * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. X * Please see the License for the specific language governing rights and X * limitations under the License. X * X * @APPLE_LICENSE_HEADER_END@ X */ X/* X * decomment.c X * X * Removes all comments and (optionally) whitespace from an input file. X * Writes result on stdout. X */ X/* X ********************************************************************** X * HISTORY X * 27-May-04 Cyrille Lefevre at laposte.net X * Make it compile under FreeBSD. modifications are __FreeBSD__ #ifdef'ed. X ********************************************************************** X */ X#include X#ifdef __FreeBSD__ X#include X#include X#include X#include X#else X#include X#endif X X/* X * State of input scanner. X */ Xtypedef enum { X IS_NORMAL, X IS_SLASH, // encountered opening '/' X IS_IN_COMMENT, // within / * * / comment X IS_STAR, // encountered closing '*' X IS_IN_END_COMMENT // within / / comment X} input_state_t; X Xstatic volatile void usage(char **argv); X Xint main(int argc, char **argv) X{ X int fd; X char bufchar; X int bytes_read; X input_state_t input_state = IS_NORMAL; X int exit_code = 0; X int remove_whitespace = 0; X int arg; X X if(argc < 2) X usage(argv); X for(arg=2; argRelease-Note: >Audit-Trail: >Unformatted: