OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [newlib/] [libc/] [stdio/] [fputs.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/*
2
 * Copyright (c) 1990 The Regents of the University of California.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms are permitted
6
 * provided that the above copyright notice and this paragraph are
7
 * duplicated in all such forms and that any documentation,
8
 * advertising materials, and other materials related to such
9
 * distribution and use acknowledge that the software was developed
10
 * by the University of California, Berkeley.  The name of the
11
 * University may not be used to endorse or promote products derived
12
 * from this software without specific prior written permission.
13
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16
 */
17
 
18
/*
19
FUNCTION
20
<<fputs>>---write a character string in a file or stream
21
 
22
INDEX
23
        fputs
24
 
25
ANSI_SYNOPSIS
26
        #include <stdio.h>
27
        int fputs(const char *<[s]>, FILE *<[fp]>);
28
 
29
TRAD_SYNOPSIS
30
        #include <stdio.h>
31
        int fputs(<[s]>, <[fp]>)
32
        char *<[s]>;
33
        FILE *<[fp]>;
34
 
35
DESCRIPTION
36
<<fputs>> writes the string at <[s]> (but without the trailing null)
37
to the file or stream identified by <[fp]>.
38
 
39
RETURNS
40
If successful, the result is <<0>>; otherwise, the result is <<EOF>>.
41
 
42
PORTABILITY
43
ANSI C requires <<fputs>>, but does not specify that the result on
44
success must be <<0>>; any non-negative value is permitted.
45
 
46
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
47
<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
48
*/
49
 
50
#include <stdio.h>
51
#include <string.h>
52
#include "fvwrite.h"
53
 
54
/*
55
 * Write the given string to the given file.
56
 */
57
 
58
int
59
_DEFUN (fputs, (s, fp),
60
        char _CONST * s _AND
61
        FILE * fp)
62
{
63
  struct __suio uio;
64
  struct __siov iov;
65
 
66
  iov.iov_base = s;
67
  iov.iov_len = uio.uio_resid = strlen (s);
68
  uio.uio_iov = &iov;
69
  uio.uio_iovcnt = 1;
70
  return __sfvwrite (fp, &uio);
71
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.