niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
__P(()) Macro
Post new topic   Reply to topic Page 4 of 68 [1016 Posts] View previous topic :: View next topic
Goto page:  Previous  1, 2, 3, 4, 5, 6, ..., 66, 67, 68 Next
Author Message
Bill Fenner
*nix forums beginner


Joined: 21 Apr 2002
Posts: 13

PostPosted: Sat May 04, 2002 6:52 pm    Post subject: Re: patch for savecore Reply with quote

If I get rid of phk's copyright, should I update the dates on the
UCB one or should I leave the latest copyright 1993? Should we
worry about these copyrights expiring?...

Bill

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Poul-Henning Kamp
*nix forums Guru


Joined: 21 Mar 2002
Posts: 436

PostPosted: Sat May 04, 2002 6:53 pm    Post subject: Re: patch for savecore Reply with quote

In message <200205042052.NAA20568@windsor.research.att.com>, Bill Fenner write
s:
Quote:

If I get rid of phk's copyright, should I update the dates on the
UCB one or should I leave the latest copyright 1993? Should we
worry about these copyrights expiring?...

You should add 2002 to the copyright.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
David O'Brien
*nix forums beginner


Joined: 04 May 2002
Posts: 1

PostPosted: Sat May 04, 2002 8:29 pm    Post subject: Re: patch for savecore Reply with quote

On Sat, May 04, 2002 at 01:52:23PM -0700, Bill Fenner wrote:
Quote:

If I get rid of phk's copyright, should I update the dates on the
UCB one or should I leave the latest copyright 1993? Should we
worry about these copyrights expiring?...

You cannot change the dates - UCB has not exserted their copyright for
2002. Either just use the last UCB savecore.c copyright before PHK's
rewrite, or put both UCB and PHK's copyright in the file. Verbosity
really isn't much we can do anything about.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Peter Wemm
*nix forums Guru Wannabe


Joined: 11 Apr 2002
Posts: 113

PostPosted: Sat May 04, 2002 10:47 pm    Post subject: Re: patch for savecore Reply with quote

"David O'Brien" wrote:
Quote:
On Sat, May 04, 2002 at 01:52:23PM -0700, Bill Fenner wrote:

If I get rid of phk's copyright, should I update the dates on the
UCB one or should I leave the latest copyright 1993? Should we
worry about these copyrights expiring?...

You cannot change the dates - UCB has not exserted their copyright for
2002. Either just use the last UCB savecore.c copyright before PHK's
rewrite, or put both UCB and PHK's copyright in the file. Verbosity
really isn't much we can do anything about.

Copyright 1993 UCB
Copyright 2002 phk

Cheers,
-Peter
--
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Bruce Evans
*nix forums Guru Wannabe


Joined: 22 Mar 2002
Posts: 190

PostPosted: Sun May 05, 2002 12:48 am    Post subject: Re: patch for savecore Reply with quote

On Sat, 4 May 2002, David O'Brien wrote:

Quote:
On Sat, May 04, 2002 at 01:52:23PM -0700, Bill Fenner wrote:

If I get rid of phk's copyright, should I update the dates on the
UCB one or should I leave the latest copyright 1993? Should we
worry about these copyrights expiring?...

You cannot change the dates - UCB has not exserted their copyright for
2002. Either just use the last UCB savecore.c copyright before PHK's
rewrite, or put both UCB and PHK's copyright in the file. Verbosity
really isn't much we can do anything about.

We haven't added our own copyrights or changed dates in copyrights for
approximately 30000 of 30000+ files in /usr/src.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Brian F. Feldman
*nix forums beginner


Joined: 22 Mar 2002
Posts: 27

PostPosted: Wed May 08, 2002 1:04 am    Post subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Reply with quote

"J. Mallett" <jmallett@FreeBSD.ORG> wrote:
Quote:
On Tue, May 07, 2002 at 06:27:50PM -0700, David O'Brien wrote:
On Wed, May 08, 2002 at 12:59:58AM +0000, J. Mallett wrote:
If a user can not be bothered to use '-I .blah' instead of
'-i.blah', then they can continue to use perl for all I care.
...
I like your logic better than the logic I've been using.
If one or two more people will agree to this, I'll happily make
the necessary changes.

I do not agree, I WILL not agree. I will commit -i[ext] later if anyone
takes it away (or fails to add it). The ENTIRE PURPOSE HERE is to add
"perl -i" functionality. NOT find how many different ways things can be
proposed.

But unless people will shut the hell up about allowing -i with no argument,
we cannot achieve that without adding another option one way or the other.

[...]

Trying to move this to arch:
Another option would be to extend getopt(3) in what could simply be a very
reasonable way. Here's my proposition for making a "clean" version that
acts like Perl:

Index: Makefile
===================================================================
RCS file: /usr2/ncvs/src/usr.bin/sed/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile 8 Feb 2002 23:07:35 -0000 1.4
+++ Makefile 8 May 2002 02:49:35 -0000
@@ -3,6 +3,7 @@

PROG= sed
SRCS= compile.c main.c misc.c process.c
+SRCS+= getopt.c


.include <bsd.prog.mk>
Index: main.c
===================================================================
RCS file: /usr2/ncvs/src/usr.bin/sed/main.c,v
retrieving revision 1.19
diff -u -r1.19 main.c
--- main.c 7 May 2002 23:33:44 -0000 1.19
+++ main.c 8 May 2002 02:58:58 -0000
@@ -124,7 +124,7 @@
fflag = 0;
inplace = NULL;

- while ((c = getopt(argc, argv, "Eae:f:i:n")) != -1)
+ while ((c = getopt(argc, argv, "Eae:f:i;n")) != -1)
switch (c) {
case 'E':
rflags = REG_EXTENDED;
@@ -146,6 +146,8 @@
break;
case 'i':
inplace = optarg;
+ if (inplace == NULL)
+ inplace = "";
break;
case 'n':
nflag = 1;
@@ -182,8 +184,8 @@
usage()
{
(void)fprintf(stderr, "%s\n%s\n",
- "usage: sed script [-Ean] [-i extension] [file ...]",
- " sed [-an] [-i extension] [-e script] ... [-f script_file] ... [file ...]");
+ "usage: sed script [-Ean] [-i[extension]] [file ...]",
+ " sed [-an] [-i[extension]] [-e script] ... [-f script_file] ... [file ...]");
exit(1);
}

@@ -434,20 +436,21 @@
if (*inplace == '\0') {
char template[] = "/tmp/sed.XXXXXXXXXX";

- if (mktemp(template) == NULL)
- err(1, "mktemp");
+ output = mkstemp(template);
+ if (output == -1)
+ err(1, "mkstemp");
strlcpy(backup, template, MAXPATHLEN);
} else {
strlcpy(backup, *filename, MAXPATHLEN);
strlcat(backup, inplace, MAXPATHLEN);
+ output = open(backup, O_WRONLY|O_CREAT);
+ if (output == -1)
+ err(1, "open(%s)", backup);
}

input = open(*filename, O_RDONLY);
if (input == -1)
err(1, "open(%s)", *filename);
- output = open(backup, O_WRONLY|O_CREAT);
- if (output == -1)
- err(1, "open(%s)", backup);
if (fchmod(output, orig.st_mode & ~S_IFMT) == -1)
err(1, "chmod");
buffer = malloc(orig.st_size);
--- ../../lib/libc/stdlib/getopt.c Thu Sep 6 02:47:20 2001
+++ getopt.c Tue May 7 22:49:22 2002
@@ -93,12 +93,8 @@
"%s: illegal option -- %c\n", __progname, optopt);
return (BADCH);
}
- if (*++oli != ':') { /* don't need argument */
- optarg = NULL;
- if (!*place)
- ++optind;
- }
- else { /* need an argument */
+ switch (*++oli) {
+ case ':': /* need an argument */
if (*place) /* no white space */
optarg = place;
else if (nargc <= ++optind) { /* no arg */
@@ -115,6 +111,19 @@
optarg = nargv[optind];
place = EMSG;
++optind;
+ break;
+ case ';': /* argument optional */
+ if (*place)
+ optarg = place;
+ else
+ optarg = NULL;
+ place = EMSG;
+ optind++;
+ break;
+ default: /* don't need argument */
+ optarg = NULL;
+ if (!*place)
+ ++optind;
}
return (optopt); /* dump back option letter */
}


--
Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\
<> green@FreeBSD.org <> bfeldman@tislabs.com \ The Power to Serve! \
Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Dag-Erling Smorgrav
*nix forums Guru Wannabe


Joined: 23 Mar 2002
Posts: 110

PostPosted: Wed May 08, 2002 1:46 pm    Post subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Reply with quote

"Brian F. Feldman" <green@FreeBSD.ORG> writes:
Quote:
Index: Makefile
===================================================================
RCS file: /usr2/ncvs/src/usr.bin/sed/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile 8 Feb 2002 23:07:35 -0000 1.4
+++ Makefile 8 May 2002 02:49:35 -0000
@@ -3,6 +3,7 @@

PROG= sed
SRCS= compile.c main.c misc.c process.c
+SRCS+= getopt.c


.include <bsd.prog.mk

What's this for? Leftovers from testing?

DES
--
Dag-Erling Smorgrav - des@ofug.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Dag-Erling Smorgrav
*nix forums Guru Wannabe


Joined: 23 Mar 2002
Posts: 110

PostPosted: Wed May 08, 2002 1:49 pm    Post subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Reply with quote

John Baldwin <jhb@FreeBSD.org> writes:
Quote:
I think green was implying that sed would have its own getopt instead
of changing the system getopt.

Ugh. Nasty. Especially if the modified getopt() could be useful to
other programs as well (do we have any programs with options that take
optional arguments?)

DES
--
Dag-Erling Smorgrav - des@ofug.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Mark Murray
*nix forums beginner


Joined: 24 Mar 2002
Posts: 49

PostPosted: Wed May 08, 2002 2:03 pm    Post subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Reply with quote

[ CC: list assaulted with a machete ]

Quote:
John Baldwin <jhb@FreeBSD.org> writes:
I think green was implying that sed would have its own getopt instead
of changing the system getopt.

Ugh. Nasty. Especially if the modified getopt() could be useful to
other programs as well (do we have any programs with options that take
optional arguments?)

At the risk of detracting from the matter at hand, this would be a
useful extension to getopt(3), as would the ability to have numeric-only
options (a' la "tail -123"), that is not just single digits, but whole
numbers.

I'm not going to write it, I'm not going argue about it, and I'm not
going to say any more about it, so if this is utterly ridiculous, then
ignore me and this branch of the thread will die Smile.

M
--
o Mark Murray
\_
O.\_ Warning: this .sig is umop ap!sdn

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Brian F. Feldman
*nix forums beginner


Joined: 22 Mar 2002
Posts: 27

PostPosted: Wed May 08, 2002 3:28 pm    Post subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Reply with quote

Dag-Erling Smorgrav <des@ofug.org> wrote:
Quote:
John Baldwin <jhb@FreeBSD.org> writes:
I think green was implying that sed would have its own getopt instead
of changing the system getopt.

Ugh. Nasty. Especially if the modified getopt() could be useful to
other programs as well (do we have any programs with options that take
optional arguments?)

Okay, fine, assume we'd just do the same thing to the system's getopt()
instead of a special getopt(). So then...?


--
Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\
<> green@FreeBSD.org <> bfeldman@tislabs.com \ The Power to Serve! \
Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
John Baldwin
*nix forums Guru Wannabe


Joined: 27 Mar 2002
Posts: 278

PostPosted: Wed May 08, 2002 3:47 pm    Post subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Reply with quote

On 08-May-2002 Dag-Erling Smorgrav wrote:
Quote:
"Brian F. Feldman" <green@FreeBSD.ORG> writes:
Index: Makefile
===================================================================
RCS file: /usr2/ncvs/src/usr.bin/sed/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile 8 Feb 2002 23:07:35 -0000 1.4
+++ Makefile 8 May 2002 02:49:35 -0000
@@ -3,6 +3,7 @@

PROG= sed
SRCS= compile.c main.c misc.c process.c
+SRCS+= getopt.c


.include <bsd.prog.mk

What's this for? Leftovers from testing?

I think green was implying that sed would have its own getopt instead
of changing the system getopt.

--

John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!" - http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Garance A Drosihn
*nix forums Guru Wannabe


Joined: 21 Mar 2002
Posts: 190

PostPosted: Wed May 08, 2002 4:32 pm    Post subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Reply with quote

At 11:04 PM -0400 5/7/02, Brian F. Feldman wrote:
Quote:
Trying to move this to arch:

....certainly a good idea.

Quote:
Another option would be to extend getopt(3) in what could
simply be a very reasonable way. Here's my proposition
for making a "clean" version that acts like Perl:

I must admit that I kind of like the idea of modifying
getopt(3) so that it has the ability to process optional
attached-arguments to a command flag. There are older
programs which have such options, and it would be nice
if those programs could use a common routine for all
their processing. I expect that I shouldn't like that, as
it means we've deviated getopt(3) from how it is defined
in the standards, but I'll admit I like the idea. Your
idea of using ';' for the flag (to getopt) that indicates
an optional argument seems like a very good choice, too.

On the other hand, when it comes to any brand new option
for some command, then I (personally) think there is no
need to have flags which take optional arguments. The
recent standards committees are definitely not fond of
optional arguments, and as a user (including a user of
perl) I find them more of a hassle than they are worth. By
"standards", I am referring to Utility Syntax Guidelines
in Single Unix Spec v2, guideline 7, which says:
"Option-arguments should not be optional".
[which reminds me, I still haven't received the copy of
SUS-v3 that I ordered...]

This then suggests we need two command-flags, one which
always takes an argument and one which never takes one.
As to which-is-which, or what the implied argument is
for the flag which never takes an argument, I like -i
for the flag which never takes an argument, and having
-i mean the same as '-I ""', but I'd be equally happy
with any other combination just as long as we are not
adding a command-flag that takes an optional argument.

I think this -i/-I idea is good enough that many others
would pick up on it when they see it, and it makes
sense to define it in a way that doesn't conflict with
what standards-groups have already said about options.

--
Garance Alistair Drosehn = gad@gilead.netel.rpi.edu
Senior Systems Programmer or gad@freebsd.org
Rensselaer Polytechnic Institute or drosih@rpi.edu

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
John Baldwin
*nix forums Guru Wannabe


Joined: 27 Mar 2002
Posts: 278

PostPosted: Wed May 08, 2002 5:41 pm    Post subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Reply with quote

On 08-May-2002 Dag-Erling Smorgrav wrote:
Quote:
John Baldwin <jhb@FreeBSD.org> writes:
I think green was implying that sed would have its own getopt instead
of changing the system getopt.

Ugh. Nasty. Especially if the modified getopt() could be useful to
other programs as well (do we have any programs with options that take
optional arguments?)

Most people consider optional arguments a bad thing, and apparently they
are forbidden by some standards. I think the intent was to discourage
other programs from using this "bad" practice by not changing the getopt
in libc.

--

John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!" - http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
David O'Brien
*nix forums beginner


Joined: 08 May 2002
Posts: 1

PostPosted: Wed May 08, 2002 6:04 pm    Post subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Reply with quote

[Bogus From: address, because people cannot be bothered to respect
Reply-To:]

On Wed, May 08, 2002 at 02:32:28PM -0400, Garance A Drosihn wrote:
Quote:
This then suggests we need two command-flags, one which
always takes an argument and one which never takes one.
As to which-is-which, or what the implied argument is
for the flag which never takes an argument, I like -i
for the flag which never takes an argument, and having
-i mean the same as '-I ""', but I'd be equally happy
with any other combination just as long as we are not
adding a command-flag that takes an optional argument.

Why do we need to waste two flags on this functionality?
IF we are not going to accurately follow perl, then require "-i" to have
an argument. The reason for allowing -i to not have an argument is
because Perl does not require it. I have been shot down at having `sed'
accurately reimplement this Perl functionality, so others can relax their
optionless "-i" requirement. If ``sed -i"" foo'' works properly, people
can just live with it.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
J. Mallett
*nix forums beginner


Joined: 08 May 2002
Posts: 4

PostPosted: Wed May 08, 2002 6:15 pm    Post subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Reply with quote

On Wed, May 08, 2002 at 11:47:39AM -0400, John Baldwin wrote:
Quote:

On 08-May-2002 Dag-Erling Smorgrav wrote:
"Brian F. Feldman" <green@FreeBSD.ORG> writes:
Index: Makefile
===================================================================
RCS file: /usr2/ncvs/src/usr.bin/sed/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile 8 Feb 2002 23:07:35 -0000 1.4
+++ Makefile 8 May 2002 02:49:35 -0000
@@ -3,6 +3,7 @@

PROG= sed
SRCS= compile.c main.c misc.c process.c
+SRCS+= getopt.c


.include <bsd.prog.mk

What's this for? Leftovers from testing?

I think green was implying that sed would have its own getopt instead
of changing the system getopt.

Which, by the way, should be called 'egetopt' probably.
--
jmallett@FreeBSD.org | C, MIPS, POSIX, UNIX, BSD, IRC Geek.
http://www.FreeBSD.org | The Power to Serve
"I've never tried to give my life meaning by demeaning you."

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 4 of 68 [1016 Posts] Goto page:  Previous  1, 2, 3, 4, 5, 6, ..., 66, 67, 68 Next
View previous topic :: View next topic
The time now is Thu Jan 08, 2009 5:55 am | All times are GMT
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts C macro sgurminder@gmail.com C 11 Wed Jul 12, 2006 6:09 pm
No new posts Macro expansion in armcc srinu.fsl@gmail.com C 2 Tue Jul 11, 2006 10:37 am
No new posts Variable Number of Arguments in Macro Praveen.Kumar.SP@gmail.co C++ 10 Thu Jun 29, 2006 2:05 pm
No new posts String macro as wchar_t pointer? Heiner C 2 Fri Jun 23, 2006 9:11 pm
No new posts Keyboard macro in Linux Daniel Webb Debian 0 Tue Jun 13, 2006 3:40 am

Credit Cards | Credit Cards | Myspace Layouts | Bankruptcy | Babb Fest
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1952s ][ Queries: 16 (0.0415s) ][ GZIP on - Debug on ]