source: rtems/cpukit/libmisc/shell/cat_file.c @ 9a77af8

4.104.115
Last change on this file since 9a77af8 was e41eaa88, checked in by Joel Sherrill <joel.sherrill@…>, on 12/18/08 at 15:25:27

2008-12-18 Sebastian Huber <sebastian.huber@…>

  • libmisc/serdbg/termios_printk.c, libmisc/serdbg/termios_printk.h: Fixed incompatible return value.
  • libmisc/cpuuse/cpuusagereport.c: Changed output format.
  • libmisc/Makefile.am, libmisc/monitor/mon-editor.c: New file.
  • libmisc/capture/capture-cli.c, libmisc/monitor/mon-command.c, libmisc/monitor/mon-monitor.c, libmisc/monitor/mon-object.c, libmisc/monitor/mon-prmisc.c, libmisc/monitor/mon-symbols.c, libmisc/monitor/monitor.h, libmisc/shell/cat_file.c, libmisc/shell/cmds.c, libmisc/shell/internal.h, libmisc/shell/main_help.c, libmisc/shell/shell.c, libmisc/shell/shell.h, libmisc/shell/shell_cmdset.c, libmisc/shell/shell_getchar.c, libmisc/shell/str2int.c: Various global data is now read only. Added 'const' qualifier to many pointer parameters. It is no longer possible to remove monitor commands. Moved monitor line editor into a separate file to avoid unnecessary dependencies.
  • Property mode set to 100644
File size: 609 bytes
Line 
1/*
2 *  CAT Command Implementation
3 *
4 *  Author:
5 *   WORK: fernando.ruiz@ctv.es
6 *   HOME: correo@fernando-ruiz.com
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#ifdef HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <stdio.h>
20
21int rtems_shell_cat_file(FILE * out,const char * name) {
22  FILE * fd;
23  int c;
24
25  if (out) {
26    fd = fopen(name,"r");
27    if (!fd) {
28      return -1;
29    }
30    while ((c=fgetc(fd))!=EOF)
31      fputc(c,out);
32    fclose(fd);
33  }
34  return 0;
35}
36
37
Note: See TracBrowser for help on using the repository browser.