ports/149725: [patch] devel/cdk: Errors in examples of cdk_display(3) man page

Loic Pefferkorn loic-freebsd at loicp.eu
Mon Aug 16 22:40:01 UTC 2010


>Number:         149725
>Category:       ports
>Synopsis:       [patch] devel/cdk: Errors in examples of cdk_display(3) man page
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 16 22:40:00 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Loic Pefferkorn
>Release:        8.0-RELEASE
>Organization:
>Environment:
FreeBSD bsd8vm.local 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009     root at almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
Hello,

The examples in the cdk_display(3) man page are incorrect and don't work as expected (wrong colors, segfault, ...).

The attached patch make them work properly.

>How-To-Repeat:
copy/paste the examples from cdk_display(3) man page, try to compile them and examine their behaviour
>Fix:
Attached patch

Patch attached with submission follows:

--- cdk_display.3.orig	2006-04-17 12:45:02.000000000 +0200
+++ cdk_display.3	2010-08-16 23:27:03.487327228 +0200
@@ -54,7 +54,7 @@
 .nf
 .ce
 \fI----------------------------------------\fR
-#include <cdk.h>
+#include <cdk/cdk.h>
 
 void main()
 {
@@ -67,10 +67,13 @@
    screen = initscr();
    cdkscreen = initCDKScreen (screen);
 
+   /* Start CDK Colors */
+   initCDKColor();
+
    /* Set the labels up.		*/
-   mesg[0] = "</1>This line should have a yellow foreground and a blue background.<!1>";
-   mesg[1] = "</2>This line should have a white  foreground and a blue background.<!2>";
-   mesg[2] = "</3>This line should have a yellow foreground and a red  background.<!3>";
+   mesg[0] = "</31>This line should have a yellow foreground and a blue background.<!31>";
+   mesg[1] = "</05>This line should have a white  foreground and a blue background.<!05>";
+   mesg[2] = "</26>This line should have a yellow foreground and a red  background.<!26>";
    mesg[3] = "<C>This line should be set to whatever the screen default is.";
 
    /* Declare the labels.	*/
@@ -121,7 +124,7 @@
 .nf
 .ce
 \fI----------------------------------------\fR
-#include <cdk.h>
+#include <cdk/cdk.h>
 
 void main()
 {
@@ -134,10 +137,13 @@
    screen = initscr();
    cdkscreen = initCDKScreen (screen);
 
+   /* Start CDK Colors */
+   initCDKColor();
+
    /* Set the labels up.  */
-   mesg[0] = "</B/1>Bold text            yellow foreground / blue background.<!1>";
-   mesg[1] = "</U/2>Underlined text      white  foreground / blue background.<!2>";
-   mesg[2] = "</K/3>Blinking text        yellow foreground / red  background.<!3>";
+   mesg[0] = "</B/31>Bold text            yellow foreground / blue background.<!31>";
+   mesg[1] = "</U/05>Underlined text      white  foreground / blue background.<!05>";
+   mesg[2] = "</K/26>Blinking text        yellow foreground / red  background.<!26>";
    mesg[3] = "<C>This line uses the screen default colors.";
 
    /* Declare the labels.  */
@@ -190,22 +196,25 @@
 .ce
 \fI----------------------------------------\fR
 .nf
-#include <cdk.h>
+#include <cdk/cdk.h>
 
 void main()
 {
    CDKSCREEN    *cdkscreen;
    CDKLABEL     *demo;
    WINDOW       *screen;
-   char         *mesg[4];
+   char         *mesg[5];
 
    /* Initialize the Cdk screen.  */
    screen = initscr();
    cdkscreen = initCDKScreen (screen);
 
+   /* Start CDK Colors */
+   initCDKColor();
+
    /* Set the labels up.  */
-   mesg[0] = "<R></B/1>This line should have a yellow foreground and a blue background.<!1>";
-   mesg[1] = "</U/2>This line should have a white  foreground and a blue background.<!2>";
+   mesg[0] = "<R></B/31>This line should have a yellow foreground and a blue background.<!31>";
+   mesg[1] = "</U/05>This line should have a white  foreground and a blue background.<!05>";
    mesg[2] = "<B=+>This is a bullet.";
    mesg[3] = "<I=10>This is indented 10 characters.";
    mesg[4] = "<C>This line should be set to whatever the screen default is.";
@@ -295,7 +304,7 @@
 .ce
 \fI----------------------------------------\fR
 .nf
-#include "cdk.h"
+#include <cdk/cdk.h>
 
 void main()
 {
@@ -313,9 +322,9 @@
    initCDKColor();
 
    /* Set the labels up.  */
-   mesg[0] = "<C><#UL><#HL(25)><#UR>";
+   mesg[0] = "<C><#UL><#HL(26)><#UR>";
    mesg[1] = "<C><#VL></R>This text should be boxed.<!R><#VL>";
-   mesg[2] = "<C><#LL><#HL(25)><#LR>";
+   mesg[2] = "<C><#LL><#HL(26)><#LR>";
    mesg[3] = "<C>While this is not.";
 
    /* Declare the labels.  */


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list