source: rtems/testsuites/sptests/sp13/putbuff.c @ 99de42c

5
Last change on this file since 99de42c was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 810 bytes
Line 
1/*  Put_buffer
2 *
3 *  This test routine prints the given buffer.
4 *  buffer.
5 *
6 *  Input parameters:
7 *    buffer - pointer to message buffer to be printer
8 *
9 *  Output parameters:  NONE
10 *
11 *  COPYRIGHT (c) 1989-2009.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifdef HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#include "system.h"
24
25void Put_buffer(
26  void *buffer
27)
28{
29  int i, j;
30  char c;
31  long *b = buffer;
32
33  for ( i = 0; i < (int) (MESSAGE_SIZE / sizeof(long)); i++ ) {
34    for ( j = sizeof(long) - 1; j >= 0; j-- ) {
35      if ( (c = (char)(b[i] >> (8 * j)) & 0xFF) == 0 )
36        return;
37      printf( "%c", c );
38    }
39  }
40}
Note: See TracBrowser for help on using the repository browser.