Back to index

plt-scheme  4.2.1
Functions
WrFFrBuf.c File Reference
#include "xpmP.h"
#include <strings.h>

Go to the source code of this file.

Functions

int XpmWriteFileFromBuffer (char *filename, char *buffer)

Function Documentation

int XpmWriteFileFromBuffer ( char *  filename,
char *  buffer 
)

Definition at line 43 of file WrFFrBuf.c.

{
    int fcheck, len;
    FILE *fp = fopen(filename, "w");

    if (!fp)
       return XpmOpenFailed;

    len = strlen(buffer);
    fcheck = fwrite(buffer, len, 1, fp);
    fclose(fp);
    if (fcheck != 1)
       return XpmOpenFailed;

    return XpmSuccess;
}