Important information: this site is currently scheduled to go offline indefinitely by end of the year.

PROJECT: MultiEx Plugin Support

Coders and would-be coders alike, this is the place to talk about programming.
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

all i need to do is mpImportFileByFile, and fix up the manager
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post by Mr.Mouse »

Great!! :D
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

should it default to overwritable, or not?
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post by Mr.Mouse »

Yes.
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

New Plugin Manager and Test Plugin,

documentation to follow
Last edited by Rahly on Tue Jul 26, 2005 2:53 am, edited 1 time in total.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

Manager function list

GetManagerVersion,
GetSupportedInterfaceVersion,
SetPluginDirectory,
RefreshPluginList,
PluginCount,
PluginInfo,
FreeCache,
SetCacheSize,

mpGetFormatCount,
mpGetFormatInfo,
mpGetOptions,
mpSetOption,
mpOpenArchive,
mpOpenArchiveBindStream,
mpCloseArchive,
mpIndexCount,
mpIndexedInfo,
mpFindInfo,
mpFindFirstFile,
mpFindNextFile,
mpFindClose,
mpIsFileAnArchive,
mpIsStreamAnArchive,
mpExportFileByNameToFile,
mpExportFileByIndexToFile,
mpExportFileByNameToStream,
mpExportFileByIndexToStream,
mpImportFileFromFile,
mpImportFileFromStream,
mpRemoveFileByName,
mpRemoveFileByIndex,
mpGetLastError,
mpGetErrorText
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

New functions

mpSetOption,
mpIndexedInfo,
mpFindInfo,
mpRemoveFileByName,
mpRemoveFileByIndex,
mpGetLastError,
mpGetErrorText

Changed functions
mpOpenArchive,
mpOpenArchiveBindStream,
mpFindFirstFile,
mpFindNextFile,
mpFindClose,
mpImportFileByNameFromFile, // Name changed to mpImportFileFromFile
mpImportFileByNameFromStream // Name changed to mpImportFileFromStream,

Removed functions
mpImportFileByIndexFromFile,
mpImportFileByIndexFromStream
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post by Mr.Mouse »

Thanks, have go it! w00t!
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

New Functions

Code: Select all

function mpSetOption(FormatIndex: LongInt; OptionType: LongInt; Name: PChar; Value: PChar): LongBool; stdcall;
function mpIndexedInfo(FormatIndex: LongInt; ArchiveHandle: LongInt; Index: LongInt; Item: PChar): PChar; stdcall;
function mpFindInfo(FormatIndex: LongInt; Handle: LongInt; Field: PChar): PChar; stdcall;

Code: Select all

function mpOpenArchive(var ArchiveHandle: LongInt; FormatIndex: LongInt; ArchiveName: PChar; Flags: Cardinal): LongBool; stdcall;
function mpOpenArchiveBindStream(var ArchiveHandle: LongInt; FormatIndex: LongInt; Stream: IStream; Flags: Cardinal): LongBool; stdcall;
function mpFindFirstFile(FormatIndex: LongInt; ArchiveHandle: LongInt; FileMask: PChar): LongInt; stdcall;
function mpFindNextFile(FormatIndex: LongInt; FindHandle: LongInt): LongBool; stdcall;
function mpFindClose(FormatIndex: LongInt; FindHandle: LongInt): LongBool; stdcall;
You'll notice in the open functions I've removed CreateParams, I opted to let mpSetOption() to handle this, so there was no need for it to be here.
mpFind's have been changed with the removal of the TFindFileInfo structure
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post by Mr.Mouse »

Do you have a complete docs as to all functions and syntax etc?
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

no, but i could write something up in the WIKI, just not sure where to put it
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post by Mr.Mouse »

Hmm, I would like to add some docs with the next release on how people should write their plugins for the Manager. Not necessarily how the Manager talks to MexCom. So the plugin-->Manager bit.
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

Well, i removed things like TFileFindInfo, because it wasn't generic enough, so i put it on par with index viewing, because not all archives have file names.

For Example though, the test pluging, gives you.

FILENAME=STRING;FILESIZE=UINT64;FILEDATE=DATE;ARCHIVEDATE=DATE
when you mpGetOptions with the OPTIONTYPE_FILEINFO.

updated common unit

Code: Select all

unit Common;

interface

type
  TManagerPluginInfo = packed record
    // Version 1.0
    Size: LongInt;
    PluginName: PChar;
    PluginAuthor: PChar;
    PluginURL: PChar;
    PluginEmail: PChar;
    PluginFullPath: PChar;
    VersionMajor, VersionMinor: LongInt;
    InterfaceMajor, InterfaceMinor: LongInt;
    Supported: LongBool;
  end;

  TPluginInfo = packed record
    // Version 1.0
    Size: LongInt;
    Name: PChar;
    Author: PChar;
    URL: PChar;
    Email: PChar;
    Major: LongInt;
    Minor: LongInt;
  end;

  TFormatInfo = packed record
    // Version 1.0
    Size: LongInt;
    FileMask: PChar; // This is better than an Interface
    GameName: PChar; // This is the name of the game it supports
    Flags: Int64;    // Support flags
  end;

const
  SUPPORTFLAG_CREATE        = $0000000000000001;
  SUPPORTFLAG_IMPORT        = $0000000000000002;
  SUPPORTFLAG_EXPORT        = $0000000000000004;
  SUPPORTFLAG_DELETE        = $0000000000000008;
  SUPPORTFLAG_REPLACE       = $0000000000000010;
  SUPPORTFLAG_BYINDEX       = $0000000000000020;
  SUPPORTFLAG_BYNAME        = $0000000000000040;
  SUPPORTFLAG_HANDLEISTREAM = $0000000000000080;
  SUPPORTFLAG_HANDLEFILE    = $0000000000000100;
  SUPPORTFLAG_TESTARCHIVE   = $0000000000000200;
  SUPPORTFLAG_EXPORTNAMEWILD= $0000000000000400;
  SUPPORTFLAG_IMPORTNAMEWILD= $0000000000000800;

  OPTIONTYPE_CREATE   = $00000001;
  OPTIONTYPE_EXPORT   = $00000002;
  OPTIONTYPE_IMPORT   = $00000003;
  OPTIONTYPE_FILEINFO = $00000004;

  OPENFLAG_CREATENEW      = $00000001;
  OPENFLAG_OPENALWAYS     = $00000002;
  OPENFLAG_FOREXPORT      = $00000004;
  OPENFLAG_FORIMPORT      = $00000008;

  pERROR_OK              = $00000000;
  pERROR_INVALID_PARM_1  = $00000001;
  pERROR_INVALID_PARM_2  = $00000002;
  pERROR_INVALID_PARM_3  = $00000003;
  pERROR_INVALID_PARM_4  = $00000004;
  pERROR_INVALID_PARM_5  = $00000005;
  pERROR_INVALID_PARM_6  = $00000006;
  pERROR_INVALID_PARM_7  = $00000007;
  pERROR_INVALID_PARM_8  = $00000008;
  pERROR_INVALID_PARM_9  = $00000009;
  pERROR_FILE_NOT_EXISTS = $0000000A;
  pERROR_FILE_CANT_OPEN  = $0000000B;
  pERROR_INVALID_FORMAT  = $0000000C;
  pERROR_STREAM_READ     = $0000000D;
  pERROR_INVALID_HANDLE  = $0000000E;
  pERROR_INVALID_INDEX   = $0000000F;
  pERROR_CREATE_ERROR    = $00000010;
  pERROR_ARCHIVE_READ_ERROR = $00000011;
  pERROR_NO_MATCHES      = $00000012;
  pERROR_ARCHIVE_CLOSED  = $00000013;
  pERROR_INVALID_OPTION  = $00000014;
  pERROR_WILDCARDS_NOT_ALLOWED = $00000015;
  pERROR_INVALID_ARCHIVE = $00000016; 
  pERROR_FILE_EXISTS     = $00000017;

  pERROR_SPECIFICPLUGIN  = $80000000;

  InterfaceVersionMajor = 1;
  InterfaceVersionMinor = 0;

implementation

end.
I'll also write up a C header later.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post by Mr.Mouse »

Can you email me a complete, working test app Delphi source code that uses the manager functions? Along with all new .pas files (such as "common" etc).
So I can read them and implement the same stuff in MexCom? For instance, the testplugin is not detected by the manager. But I need to see how you have it in mind, and how each function is declared.

Yes, of course I have a lot of docs. But not all, and I need ALL. :)

Edit: Also, after a firstfile find, then I should do a mpFindInfo to get know what the file is about eh? But, the "working" BF plugin doesn't return the mpGetOptions FILEFIND options, just an emtpy string. So I have no way to get the fields, are do you have default fields to give in mpFindInfo?

Edit2: OpenArchive crashes the whole IDE now. Perhaps due to the Cardinal there? Or the LongBool return? Please check your PM.
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

Mr.Mouse wrote:Can you email me a complete, working test app Delphi source code that uses the manager functions? Along with all new .pas files (such as "common" etc).
So I can read them and implement the same stuff in MexCom? For instance, the testplugin is not detected by the manager. But I need to see how you have it in mind, and how each function is declared.
sure
Mr.Mouse wrote:Edit: Also, after a firstfile find, then I should do a mpFindInfo to get know what the file is about eh? But, the "working" BF plugin doesn't return the mpGetOptions FILEFIND options, just an emtpy string. So I have no way to get the fields, are do you have default fields to give in mpFindInfo?
of course, remember that i change a WHOLE LOT OF STUFF with the new manager, when you made me write a plugin that tested about 99% of the functionality. So the BF plugin does need to be updated
Mr.Mouse wrote:Edit2: OpenArchive crashes the whole IDE now. Perhaps due to the Cardinal there? Or the LongBool return? Please check your PM.
shouldn't perhaps you forgot to take out the CreateParams value?
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Post Reply