Back to index

cell-binutils  2.17cvs20070401
Functions
spaces.c File Reference
#include "ansidecl.h"
#include "libiberty.h"

Go to the source code of this file.

Functions

PTR malloc (size_t)
void free (PTR)
const char * spaces (int count)

Function Documentation

void free ( PTR  )
PTR malloc ( size_t  )
const char* spaces ( int  count)

Definition at line 48 of file spaces.c.

{
  register char *t;
  static char *buf;
  static int maxsize;

  if (count > maxsize)
    {
      if (buf)
       {
         free (buf);
       }
      buf = (char *) malloc (count + 1);
      if (buf == (char *) 0)
       return 0;
      for (t = buf + count ; t != buf ; )
       {
         *--t = ' ';
       }
      maxsize = count;
      buf[count] = '\0';
    }
  return (const char *) (buf + maxsize - count);
}

Here is the call graph for this function: