bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* xfreopen, xnanosleep: Improve module description
@ 2021-06-15 11:18 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2021-06-15 11:18 UTC (permalink / raw)
  To: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

These two module descriptions don't really answer the questions
  "What do get by using this module?"
  "When should I use this module?"

==> xfreopen <==
Description:
a wrapper for freopen

==> xnanosleep <==
Description:
a more convenient interface to nanosleep


These patches provide a better description.


2021-06-15  Bruno Haible  <bruno@clisp.org>

	xnanosleep: Improve module description.
	* modules/xnanosleep (Description): Improve.
	* lib/xnanosleep.h: Add comment. Make includable from C++.
	* lib/xnanosleep.c: Update comment.

2021-06-15  Bruno Haible  <bruno@clisp.org>

	xfreopen: Improve module description.
	* modules/xfreopen (Description): Improve.
	* lib/xfreopen.h: Add comments. Make includable from C++.
	* lib/xfreopen.c: Update comment.


[-- Attachment #2: 0001-xfreopen-Improve-module-description.patch --]
[-- Type: text/x-patch, Size: 2368 bytes --]

From 8275fa2ec57ea275ca35b003866d62f817650961 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Tue, 15 Jun 2021 13:07:51 +0200
Subject: [PATCH 1/2] xfreopen: Improve module description.

* modules/xfreopen (Description): Improve.
* lib/xfreopen.h: Add comments. Make includable from C++.
* lib/xfreopen.c: Update comment.
---
 ChangeLog        |  7 +++++++
 lib/xfreopen.c   |  2 +-
 lib/xfreopen.h   | 13 ++++++++++++-
 modules/xfreopen |  2 +-
 4 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4e8242a..fc91284 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-06-15  Bruno Haible  <bruno@clisp.org>
+
+	xfreopen: Improve module description.
+	* modules/xfreopen (Description): Improve.
+	* lib/xfreopen.h: Add comments. Make includable from C++.
+	* lib/xfreopen.c: Update comment.
+
 2021-06-14  Paul Eggert  <eggert@cs.ucla.edu>
 
 	idx: new printf/scanf length modifier macro
diff --git a/lib/xfreopen.c b/lib/xfreopen.c
index dd60f13..b9e3883 100644
--- a/lib/xfreopen.c
+++ b/lib/xfreopen.c
@@ -1,4 +1,4 @@
-/* a wrapper for freopen
+/* Open a file, reusing a given stream, with error checking.
    Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/xfreopen.h b/lib/xfreopen.h
index 945b9b9..adfb9b9 100644
--- a/lib/xfreopen.h
+++ b/lib/xfreopen.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2009-2021 Free Software Foundation, Inc.
+/* Open a file, reusing a given stream, with error checking.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
@@ -15,4 +16,14 @@
 
 #include <stdio.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Opens the file FILENAME with mode MODE, reusing the given stream FP.
+   Upon failure, emits an error message and exits the program.  */
 void xfreopen (char const *filename, char const *mode, FILE *fp);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/xfreopen b/modules/xfreopen
index dfd3d9e..b71efde 100644
--- a/modules/xfreopen
+++ b/modules/xfreopen
@@ -1,5 +1,5 @@
 Description:
-a wrapper for freopen
+Open a file, reusing a given stream, with error checking.
 
 Files:
 lib/xfreopen.c
-- 
2.7.4


[-- Attachment #3: 0002-xnanosleep-Improve-module-description.patch --]
[-- Type: text/x-patch, Size: 2495 bytes --]

From d2d3a61961e102125f7cd4262ebdbd849033670c Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Tue, 15 Jun 2021 13:14:58 +0200
Subject: [PATCH 2/2] xnanosleep: Improve module description.

* modules/xnanosleep (Description): Improve.
* lib/xnanosleep.h: Add comment. Make includable from C++.
* lib/xnanosleep.c: Update comment.
---
 ChangeLog          |  7 +++++++
 lib/xnanosleep.c   |  2 +-
 lib/xnanosleep.h   | 11 ++++++++++-
 modules/xnanosleep |  2 +-
 4 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fc91284..b192beb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2021-06-15  Bruno Haible  <bruno@clisp.org>
 
+	xnanosleep: Improve module description.
+	* modules/xnanosleep (Description): Improve.
+	* lib/xnanosleep.h: Add comment. Make includable from C++.
+	* lib/xnanosleep.c: Update comment.
+
+2021-06-15  Bruno Haible  <bruno@clisp.org>
+
 	xfreopen: Improve module description.
 	* modules/xfreopen (Description): Improve.
 	* lib/xfreopen.h: Add comments. Make includable from C++.
diff --git a/lib/xnanosleep.c b/lib/xnanosleep.c
index 3c4443e..4a52d1a 100644
--- a/lib/xnanosleep.c
+++ b/lib/xnanosleep.c
@@ -1,4 +1,4 @@
-/* xnanosleep.c -- a more convenient interface to nanosleep
+/* A variant of nanosleep that takes a 'double' argument and handles EINTR.
 
    Copyright (C) 2002-2007, 2009-2021 Free Software Foundation, Inc.
 
diff --git a/lib/xnanosleep.h b/lib/xnanosleep.h
index 77b896b..7e38b4f 100644
--- a/lib/xnanosleep.h
+++ b/lib/xnanosleep.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2004-2021 Free Software Foundation, Inc.
+/* A variant of nanosleep that takes a 'double' argument and handles EINTR.
+   Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
@@ -13,4 +14,12 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int xnanosleep (double);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/xnanosleep b/modules/xnanosleep
index 9f12ff3..039c6d1 100644
--- a/modules/xnanosleep
+++ b/modules/xnanosleep
@@ -1,5 +1,5 @@
 Description:
-a more convenient interface to nanosleep
+A variant of nanosleep that takes a 'double' argument and handles EINTR.
 
 Files:
 lib/xnanosleep.h
-- 
2.7.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-15 11:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 11:18 xfreopen, xnanosleep: Improve module description Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).