Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
packfile_password(3)		 Allegro manual 	    packfile_password(3)

NAME
     packfile_password	-  Sets the global I/O encryption password. Allegro game
     programming library.

SYNOPSIS
     #include <allegro.h>

     void packfile_password(const char *password);

DESCRIPTION
     Sets the encryption password to be used for all  read/write  operations  on
     files opened in future using Allegro's packfile functions (whether they are
     compressed or not), including all the save, load and config routines. Files
     written with an encryption password cannot be read unless the same password
     is  selected,  so	be  careful: if you forget the key, nobody can make your
     data come back again! Pass NULL or an empty string to return to the normal,
     non-encrypted mode. If you are using this function to prevent  people  get-
     ting  access  to your datafiles, be careful not to store an obvious copy of
     the password in your executable: if there are any	strings  like  "I'm  the
     password  for  the datafile", it would be fairly easy to get access to your
     data :-)

     Note #1: when writing a packfile, you can change the password  to	whatever
     you want after opening the file, without affecting the write operation.  On
     the  contrary,  when  writing a sub-chunk of a packfile, you must make sure
     that the password that was active at the time the sub-chunk was  opened  is
     still active before closing the sub-chunk. This is guaranteed to be true if
     you didn't call the packfile_password() routine in the meantime. Read oper-
     ations, either on packfiles or sub-chunks, have no such restriction.

     Note #2: as explained above, the password is used for all read/write opera-
     tions on files, including for several functions of the library that operate
     on  files without explicitly using packfiles (e.g. load_bitmap()).  The un-
     encrypted mode is mandatory in order for those functions to  work.   There-
     fore remember to call packfile_password(NULL) before using them if you pre-
     viously  changed  the  password.  As  a  rule  of	thumb, always call pack-
     file_password(NULL) when you are done with operations  on	packfiles.   The
     only    exception	  to	this	is   custom   packfiles   created   with
     pack_fopen_vtable().

SEE ALSO
     pack_fopen(3), load_datafile(3), pack_fopen_vtable(3)

Allegro 			  version 4.4.3 	    packfile_password(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=packfile_password&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help