File: view_file.c

package info (click to toggle)
libcdk5 5.0.20060507-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,556 kB
  • ctags: 2,808
  • sloc: ansic: 31,202; sh: 4,391; makefile: 661; sed: 43; cpp: 42
file content (33 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <cdk_int.h>

/*
 * $Author: tom $
 * $Date: 2005/12/27 01:05:44 $
 * $Revision: 1.3 $
 */

/*
 * This allows the user to view a file.
 */
int viewFile (CDKSCREEN *screen, char *title, char *filename, char **buttons, int buttonCount)
{
   int result;
   int lines		= 0;
   char **info		= 0;

   /* Open the file and read the contents. */
   lines = CDKreadFile (filename, &info);

   /* If we couldn't read the file, return an error. */
   if (lines == -1)
   {
      result = lines;
   }
   else
   {

      result = viewInfo(screen, title, info, lines, buttons, buttonCount, TRUE);
      CDKfreeStrings (info);
   }
   return result;
}