~ubuntu-branches/ubuntu/trusty/libcdk5/trusty

« back to all changes in this revision

Viewing changes to cli/cdklabel.c

  • Committer: Bazaar Package Importer
  • Author(s): John Goerzen
  • Date: 2007-06-06 03:54:31 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070606035431-ba4gdvw0h6ybffsu
Tags: 5.0.20060507-1
* New upstream release.
* Fixed header patching.  Patch from Robert Schiele.
  Closes: #402978, #416336.
* Update widget count in description.  Closes: #294709.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: cdklabel.c,v 1.8 2005/03/08 19:52:01 tom Exp $ */
 
1
/* $Id: cdklabel.c,v 1.10 2005/12/27 16:06:34 tom Exp $ */
2
2
 
3
 
#include <cdk.h>
 
3
#include <cdk_test.h>
4
4
 
5
5
#ifdef XCURSES
6
6
char *XCursesProgramName="cdklabel";
26
26
   int messageLines             = -1;
27
27
   char **messageList           = 0;
28
28
   char tempCommand[1000];
29
 
   int x, j1, j2;
 
29
   int j1, j2;
30
30
 
31
31
   CDK_PARAMS params;
32
32
   boolean boxWidget;
67
67
         if (messageLines == -1)
68
68
         {
69
69
            fprintf (stderr, "Error: Could not open the file %s\n", filename);
70
 
            exit (-1);
 
70
            ExitProgram (CLI_ERROR);
71
71
         }
72
72
      }
73
73
      else
74
74
      {
75
75
         /* No message, no file, it's an error. */
76
76
         fprintf (stderr, "Usage: %s %s\n", argv[0], FPUsage);
77
 
         exit (-1);
 
77
         ExitProgram (CLI_ERROR);
78
78
      }
79
79
   }
80
80
   else
114
114
   /* Make sure we could create the widget. */
115
115
   if (widget == 0)
116
116
   {
117
 
      /* Clean up some memory. */
118
 
      for (x=0; x < messageLines; x++)
119
 
      {
120
 
         freeChar (messageList[x]);
121
 
      }
 
117
      CDKfreeStrings (messageList);
122
118
 
123
 
      /* Shut down curses and CDK. */
124
119
      destroyCDKScreen (cdkScreen);
125
120
      endCDK();
126
121
 
127
 
      /* Spit out the message. */
128
122
      fprintf (stderr, "Error: Could not create the label. Is the window too small?\n");
129
123
 
130
 
      /* Exit with an error. */
131
 
      exit (-1);
 
124
      ExitProgram (CLI_ERROR);
132
125
   }
133
126
 
134
127
   /* Check if the user wants to set the background of the widget. */
157
150
      sleep (sleepLength);
158
151
   }
159
152
 
160
 
   /* Clean up. */
161
 
   for (x=0; x < messageLines; x++)
162
 
   {
163
 
      freeChar (messageList[x]);
164
 
   }
 
153
   CDKfreeStrings (messageList);
 
154
 
165
155
   destroyCDKLabel (widget);
166
156
   destroyCDKScreen (cdkScreen);
167
157
   endCDK();
168
158
 
169
159
   /* Exit cleanly. */
170
 
   exit (0);
 
160
   ExitProgram (0);
171
161
}