EXE and DLX functions

These functions opens different file formats with their associated applications or libraries. The file formats and their applications are listed in the "seal.ini" file in the "[extension_runners]" structure.


run_file ()
     Description:
       Runs the application associated with a file format.

     Syntax:
       l_int  run_file ( l_char *args );

     Parameters:
       args        The file format to run the application for.

     Returns:
       True if successfully run. False if not. 
      
     Example:

       In the "seal.ini" file:

          ...
          [extension_runners]
          "exe" = "libos-x"
          "dlx" = "libos-x"
          "bmp" = "imager.exe"
          ...

          run_file("hello.bmp");

       This run "./programs/imager.exe" and ap_args set to "hello.bmp"

          run_file("hello.exe");

       Only run "hello.exe" and set ap_args to NULL



run_file_args ()
     Description:
       Runs the application associated with a file format with
       the defined arguments.

     Syntax:
       l_int    run_file_args ( l_text file, l_char *args );

     Parameters:
       file        The file format to run the application for.
       args        Arguments to send to the application.

     Returns:
       True if successfully run. False if not. 



put_into_runners ()
     Description:
       Associates an extension with an application.

     Syntax:
       void  put_into_runners ( l_char *ext, l_char *program );

     Parameters:
       ext         The extension.
       program     The program to open the extension with.

     Returns:
       -



get_from_runners ()
     Description:
       Gets the name of the application associated with a
       file format extension.

     Syntax:
       l_char*  get_from_runners ( l_char *ext );

     Parameters:
       ext         The extension.

     Returns:
       The name of the program.



get_icon_for_file ()
     Description:
       Gets the icon (bitmap) associated with a file/directory.

     Syntax:
       BITMAP*  get_icon_for_file ( l_text filename, l_int attrib, 
                                    l_int *ownmem );

     Parameters:
       filename    The file/directory to get icon for.
       attrib      Attributes of the file.
       ownmem      Is set to true if the icon has to be released
                   by freeing memory with Allegros function
                   "destroy_bitmap()".

     Returns:
       Bitmap containing the associated icon.



get_icon_for_file_ex ()
     Description:
       Gets the icon (bitmap) with the defined size associated 
       with a file/directory.

     Syntax:
       BITMAP*  get_icon_for_file_ex ( l_text filename, l_int attrib, 
                                       l_int *ownmem, l_int size );

     Parameters:
       filename    The file/directory to get icon for.
       attrib      Attributes of the file.
       ownmem      Is set to true if the icon has to be released
                   by freeing memory with Allegros function
                   "destroy_bitmap()".
       size        Size of the icon to get. May be one of:

                      ICON_16  - Size is 16 x 16 pixels.
                      ICON_32  - Size is 32 x 32 pixels.

     Returns:
       Bitmap containing the associated icon.       



get_args ()
     Description:
       Extracts argument from a string and puts them in a list
       object. Argumens must be separated with spaces (" ").

     Syntax:
       p_list  get_args ( l_char *args );

     Parameters:
       args        The string containing the arguments.

     Returns:
       A p_list structure containing the arguments.



dos_command ()
     Description:
       Runs a DOS program/command and changes current path.

     Syntax:
       extern void  (*dos_command) ( l_text newpath, l_text command );

     Parameters:
       newpath     New path to set.
       command     Name of program or command to run.

     Returns:
       -



read_set_file ()
     Description:
       Runs all the files listed in a "*.set" file. Files
       to be run are defined between after function "call". 
       (see the "app.set" file)

     Syntax:
       extern l_int (*read_set_file)(l_char *_filename);

     Parameters:
       _filename   Name of the "*.set" file containing
                   the list of filenames.

     Returns:
       1 if successfully run. Otherwise zero.