| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

stropen

#include "sflstr.h"
char *
stropen (
    char *string,
    Bool  align)

Synopsis

Inserts a character at string, and places a blank in the gap. If align is TRUE, makes room by reducing the size of the next gap of 2 or more spaces. If align is FALSE, extends the size of the string. Returns string.

Source Code - (sflstr.c)

{
    char *gap;
    int  length;

    ASSERT (string);
    length = strlen (string) + 1;       /*  By default, move string + NULL   */
    if (align)                          /*  If align is TRUE, find gap       */
      {
        gap = strstr (string, "  ");
        if (gap)
            length = (int) (gap - string);
      }
    memmove (string + 1, string, length);
    string [0] = ' ';                   /*  Stick a space into string        */
    return (string);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation