file

Langue: en

Autres versions - même langue

Version: 276227 (debian - 07/07/09)

Autres sections - même nom

Section: 3 (Bibliothèques de fonctions)

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