Poster of Linux kernelThe best gift for a Linux geek
General purpose

General purpose

Section: C Library Functions (3) Updated: 13 Mar 2003
Local index Up
 

NAME

General purpose -  

Functions


char * htmlentities (const char *str)
Transforms HTML special chars.
char ** file (const char *filename, unsigned int *total)
Reads entire file into an array.
char * md5 (const char *str)
Converts a string to MD5 format.  

Function Documentation

 

char** file (const char * filename, unsigned int * total)

Reads entire file into an array.Parameters:

filename Filename to open
total Integer variable passed as reference, which will store the total of items

Returns:

Returns the file in an array. Each element of the array corresponds to a line in the file.


 char **lines;
 unsigned int total, i;
  
 lines = file('filename.ext', &total);
    
 printf('Total of lines: %u, total);
    
 for (i = 0; i < total; i++)
        printf('[%u] %s, i, lines[i]);
     
 for (i = 0; i < total; i++) {
        if (lines[i])
                 free(lines[i]);
 }
 


 

char* htmlentities (const char * str)

Transforms HTML special chars.Transforms chars like '<', '>' and others in HTML form, like '&lt' and '&gt'

Parameters:

str String containing code to parse

Returns:

The new string

Author:

Robert Csok <rcsok@gmx.de>

 

char* md5 (const char * str)

Converts a string to MD5 format.Author:

Diogo Gonzaga

Parameters:

str String to convert to MD5 hash

Returns:

MD5 hash code


 

Index

NAME
Functions
Function Documentation
char** file (const char * filename, unsigned int * total)
char* htmlentities (const char * str)
char* md5 (const char * str)

This document was created by man2html, using the manual pages.
Time: 21:46:06 GMT, April 16, 2011