Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-02

help with synapse mime routines...

21 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

waldo kitty

i'm trying to work with the synapse mime library but am running into a bit of a problem... i'm an old procedural type coder from the TP3 to TP6 days... it has been a long time since i've done much of anything with objects and i've forgotten a lot more than i remember... i've not done any delphi coding at all...

so, i'm starting with source\demo\FreePascal\testmime.pas because it reads an email message from a text file, processes it a bit and then saves a new copy to another text file... what i'm trying to add to this, so as to understand how the library works and can be used, is how to step thru the parts of a multipart message and work with each individual part...

currently i have something that determines that we are working with a multipart message and branches to another routine... in this other routine, we create another object for the part, process it just like in the main part, then destroy the object as we loop back for the next part... i'm able to see what each part is (text, html, etc) and display some info on them BUT when we drop back out of the multipart routine and get back to the main section, we get an access violation on destroying the initial object at the end of the program execution... if i do not destroy the secondary objects in the multipart routine, this access violation does not occur...

attached is the mess i'm working with... yes, it is peppered with writeln's so as to try to see what's going on where and when since there is no debugger support in the fpc i'm working with so i cannot see the contents of the variables like i'm so extremely used to doing in the TP/BP IDEs...

Reply by email

waldo kitty
to waldo kitty

so i take it, from the dearth of replies, that no one on this list uses synapse or its mime library?

i've reduced/stripped the code to produce the attached .pas file... while i now do not get a line number any more (which i also do not understand), at least i can more easily see now that the problem is associated with freeing the second (last??) instance of the created m1 var... i'm working with an email message that is multipart with a text/plain part first and a text/html part second... i don't currently have a three part multipart message to work with and for this application, it is doubtful that one will appear but it would be best to code for the possibility i think... my goal is to extract only the text/plain portion and decode any mime'd characters to CP850 ascii equivalents... no, not 7-bit but 8-bit if necessary... an example is decoding = 9 9 (that's equal nine nine without the spaces) to "(tm)" (that's open parens, Tee, Emm, close parens)...

can anyone assist with the reason for the exception?? i'm using the last release code of synapse (download zip archive) with FPC 2.4.3... currently on win32...

here's the screen output for the attached code...

C:\freepascal\projects\arnews>tstmime1 arnews4.req

   entering ProcessParts...
     allocate m1 for part 1
     assign m1.OnWalkPart for part 1
     pulling part 1 into m1-1
     ** WE HAVE A TEXT/PLAIN SECTION **
     finally
       free m1 for part 1...
         m1  NIL... Destroying... done!
     done!

allocate m1 for part 2
assign m1.OnWalkPart for part 2
pulling part 2 into m1-2
This part is not TEXT/PLAIN... DELETING...
firing m.DeleteSubPart(1
back from m.DeleteSubPart...
Done!

     finally
       free m1 for part 2...
         m1  NIL... Destroying... An unhandled exception occurred at $6275736E

:
EAccessViolation : Access violation
$6275736E

Reply by email

Kevin Jesshope
to waldo kitty

Hi Waldo,

I don't have the mimepart or synaser units available at the moment so without actually compiling the code I am not certain the following observations are the cause of your trouble. They are however somewhere to start.

1 In line 63 you are checking to see if m1 is nil to see if the object has already been freed. This will not work as Free does not set the var to nil. Use FreeAndNil(m1) instead to acheive that. 2 In line 49 you are assigning m1 := m.GetSubPart(MyPart - 1) so when you go to free m1, expecting to free the m1 created in line 44, you are in fact freeing the result from the GetSubPart function. You have lost the reference you had to the original TMimePart created at line
44. Declare and use say m2 to fix this one.

Regards

Kevin Jesshope - In Touch Computer Support

can anyone assist with the reason for the exception?? i'm using the last release code of synapse (download zip archive) with FPC 2.4.3... currently on win32...

Reply by email

Kevin Jesshope
to Kevin Jesshope

Hi Waldo,

I have now got the units so I can build and test your code properly.

The reason you are getting the exception is that when you free m1 at line 66 you are not freeing the m1 you created at line 44, but the subpart belonging to m. This means that when you finally free m it is trying to free all the objects (mime parts) that it owns including the one you already freed at line 66.

If you declare an m2 and use it at line 49 and 50 instead of the m1 all will be well.

You have to watch out for objects that are owned by other objects or horrible things will happen!

Regards

Kevin Jesshope - In Touch Computer Support

Show quoted text 5 lines
> can anyone assist with the reason for the exception?? i'm using the last > release code of synapse (download zip archive) with FPC 2.4.3... currently > on win32... >

Reply by email

waldo kitty
to Kevin Jesshope: I don't have the mimepart or synaser units available at the moment so without actually…
Kevin Jesshope wrote 10 lines
Hi Waldo, I don't have the mimepart or synaser units available at the moment so without actually compiling the code I am not certain the following observations are the cause of your trouble. They are however somewhere to start. 1 In line 63 you are checking to see if m1 is nil to see if the object has already been freed. This will not work as Free does not set the var to nil. Use FreeAndNil(m1) instead to acheive that.

yes, that was a flailing attempt to try to bypass the free that apparently shouldn't be... i'll remove that... or, i think i see what you are saying... if i use freeandnil instead of the current m1.free, then the nil test might work and show me that the object is really already gone... i'll try that in addition to the below...

2 In line 49 you are assigning m1 := m.GetSubPart(MyPart - 1) so when you go to free m1, expecting to free the m1 created in line 44, you are in fact freeing the result from the GetSubPart function.

right... i'm thinking that m1 should contain only the indicated MIME part from m... ahhh! so what you are saying is that i do not need to explicitly create m1 before assigning m.GetSubPart to it... hummm...

but then i have to wonder why it works the first time and not the second? the process does show the proper mime parts, one text/plain and the other text/html... i think i'll manually add a third part to the test message i'm processing and see if i still get the failure on the second one or if it then moves to the third one... i'll do this in addition to testing the above possibility...

You have lost the reference you had to the original TMimePart created at line 44. Declare and use say m2 to fix this one.

i think the above is one of the main clues... i'll try it out and see what happens...

Show quoted text 13 lines
Regards Kevin Jesshope - In Touch Computer Support > can anyone assist with the reason for the exception?? i'm using the last > release code of synapse (download zip archive) with FPC 2.4.3... currently > on win32... > _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

waldo kitty
to Kevin Jesshope: I have now got the units so I can build and test your code properly. The reason you are…
Kevin Jesshope wrote 12 lines
Hi Waldo, I have now got the units so I can build and test your code properly. The reason you are getting the exception is that when you free m1 at line 66 you are not freeing the m1 you created at line 44, but the subpart belonging to m. This means that when you finally free m it is trying to free all the objects (mime parts) that it owns including the one you already freed at line 66. If you declare an m2 and use it at line 49 and 50 instead of the m1 all will be well.

i will follow along with this and see what happens... thanks!!

You have to watch out for objects that are owned by other objects or horrible things will happen!

so i'm finding out! thanks for the assist... and to think, i'm wading into this thinking that it would be easier than what i was trying to develop to extract the text/plain mime section :)

Reply by email

Kevin Jesshope
to waldo kitty: yes, that was a flailing attempt to try to bypass the free that apparently shouldn't…

Waldo,

You are assigning an OnWalkPart hook procedure to the m1 mimepart you have created, not the mimepart you actually end up freeing. It does not look like the tc.ph procedure is called from the m1 mimeparts (which is what I would expect). If you do need to use the tc.ph on the individual m1 parts, it will need to be setup after m1 := m.GetSubPart(MyPart - 1);

The code does not actually use the first m1 so it could be removed including the try finally and the free code. You will also need to remove the m1 := m.GetSubPart(MyPart - 1) line too.

The reason that it works the first time is that when you enter the loop m1 is valid. you then set the hook proc up even though this is not the m1 you actually end up using. You then assign a new mimepart to m1, use it and free it at the end of the loop. Second time through, m1 refers to the mimepart for the first sub part which you just freed at the end of the loop and you attempt to use that mimpart to set the hook again but as it has already been freed you get the exception.

I think I have that right. I am working from memory now as I do not have the code before me.

Regards

Kevin Jesshope - In Touch Computer Support

Show quoted text 14 lines
>> can anyone assist with the reason for the exception?? i'm using the last >> release code of synapse (download zip archive) with FPC 2.4.3... >> currently >> on win32... >> > _______________________________________________ > fpc-pascal maillist  -   > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > _______________________________________________ fpc-pascal maillist  -   http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

waldo kitty
to Kevin Jesshope

On 2/17/2011 18:16, Kevin Jesshope wrote:
[TRIM]

I think I have that right. I am working from memory now as I do not have the code before me.

i wanted to thank you again.. you gave me some hints that enabled me to propel myself much further than i've gone in the last week of floundering... in fact, i've reverse my flow process somewhat and now have a working win32 tool... YAY! but the real destination platform is OS/2, OS/2 EMX or "pure" DOS on OS/2...

my next problem is to get it compiling on my OS/2 box with FPC 2.4.2 and so far, that is not working... complaints of missing units and include files that i just don't know where to tell the compiler to look for... my development has been on a winXP box with the FPC 2.4.3 code pulled from SVN along with Lazarus code... however, i've not been working in the Lazarus environment at all... i pulled this and compiled it by following the instructions on the FPC wiki...

on my OS/2 box, i've tried targets of OS2 and OS2 with EMX but both have failed all kinds of ways... i suspect that it is simply to do with the paths to the units and include files... i have been able to get something going somewhat but then run into masses of "duplicate identifier" errors...

i'm just not sure where to turn now so out of frustration, i'm now pulling down the dos242full.zip of FPC and will be installing that to another directory on the OS/2 box... then it should be a simple matter of copying the project to another directory in there and giving it a kick in the arse to see what happens... hopefully i'll end up with a workable executable and my project with be, basically, at the end :)

Reply by email

Kevin Jesshope
to waldo kitty

Good luck with the other OSs. At this time I am only doing Win32 but I am sure there are others here who can help if you ask.

Regards

Kevin Jesshope - In Touch Computer Support

Show quoted text 11 lines
on my OS/2 box, i've tried targets of OS2 and OS2 with EMX but both have failed all kinds of ways... i suspect that it is simply to do with the paths to the units and include files... i have been able to get something going somewhat but then run into masses of "duplicate identifier" errors... i'm just not sure where to turn now so out of frustration, i'm now pulling down the dos242full.zip of FPC and will be installing that to another directory on the OS/2 box... then it should be a simple matter of copying the project to another directory in there and giving it a kick in the arse to see what happens... hopefully i'll end up with a workable executable and my project with be, basically, at the end :)

Reply by email

Tomas Hajny
to waldo kitty: [TRIM] i wanted to thank you again.. you gave me some hints that enabled me to propel…
waldo kitty wrote
On 2/17/2011 18:16, Kevin Jesshope wrote:

.
.

Show quoted text 5 lines
my next problem is to get it compiling on my OS/2 box with FPC 2.4.2 and so far, that is not working... complaints of missing units and include files that i just don't know where to tell the compiler to look for... my development has

.
.

Show quoted text 7 lines
on my OS/2 box, i've tried targets of OS2 and OS2 with EMX but both have failed all kinds of ways... i suspect that it is simply to do with the paths to the units and include files... i have been able to get something going somewhat but then run into masses of "duplicate identifier" errors...

I'm willing to have a look at your current version if you can upload it somewhere. Synapse has probably not been ported to the OS/2 target and it possibly uses various platform specific APIs but it should be possible to port it with reasonable effort (especially stuff like processing MIME messages should be fairly generic). First of all, you should check whether the missing units are supposed to be platform independent or not. If not, it is surely not just the matter of paths, etc. Also, if you mention concrete error messages, people may be able to advise.

Show quoted text 10 lines
i'm just not sure where to turn now so out of frustration, i'm now pulling down the dos242full.zip of FPC and will be installing that to another directory on the OS/2 box... then it should be a simple matter of copying the project to another directory in there and giving it a kick in the arse to see what happens... hopefully i'll end up with a workable executable and my project with be, basically, at the end :)

I'd recommend using the OS/2 target directly in your case; there are surely areas / functionalities which are better supported on the GO32v2 target (unit graph coming to my mind as one particular example), but I don't think that your project should really need those.

Tomas

Reply by email

waldo kitty
to Tomas Hajny
Tomas Hajny wrote 8 lines
On Fri, February 18, 2011 02:24, waldo kitty wrote: > on my OS/2 box, i've tried targets of OS2 and OS2 with EMX but both have > failed all kinds of ways... i suspect that it is simply to do with the > paths to the units and include files... i have been able to get something > going somewhat but then run into masses of "duplicate identifier" errors... I'm willing to have a look at your current version if you can upload it somewhere.

my code is pretty small... it should easily fit the attachment limitations of this list :)

i still have a few more tweaks to add to it as a few things are still specific to certain types of messages but overall, it is pretty straight forward ;)

Synapse has probably not been ported to the OS/2 target and it possibly uses various platform specific APIs but it should be possible to port it with reasonable effort (especially stuff like processing MIME messages should be fairly generic).

that is/was my thinking as well...

First of all, you should check whether the missing units are supposed to be platform independent or not.

yes, part of what i'm running into is platform dependency problems... i forget which unit it is that's triggering the platform stuff but where it is failing is when trying to bring in platform stuff like loading libraries and there's nothing in my code that needs any libraries to be loaded for any reason that i'm aware of... it is possible that "WalkParts" might want something loaded from a lib but i do not need anything like that for my immediate purposes since i'm only looking for the text/plain section(s) and extracting them to an ASCII text file...

If not, it is surely not just the matter of paths, etc. Also, if you mention concrete error messages, people may be able to advise.

i shall try to grab these in the future... one thing that may also be causing waves is that my OS/2 and DOS FPCs are 2.4.2 releases whereas on my development machine(s), i'm pulling FPC and lazarus from their SVNs and building them from the ground up... both of my development machines started with nothing on them until i pulled the code from SVN and the bootstrap compiler to kick it in the arse and build working environments...

Show quoted text 6 lines
> i'm just not sure where to turn now so out of frustration, i'm now pulling > down the dos242full.zip of FPC and will be installing that to another > directory on the OS/2 box... then it should be a simple matter of copying > the project to another directory in there and giving it a kick in the arse > to see what happens... hopefully i'll end up with a workable executable and > my project with be, basically, at the end :)

yeah, the above failed miserably... i didn't realize that LFNs were necessary and the DOS version on OS/2 simply cannot access OS/2 LFNs in any way shape or fashion at all...

I'd recommend using the OS/2 target directly in your case;

OS/2 straight? not the OS/2 w/ EMX?? it really doesn't matter to me as long as i end up with a working executable for the task at hand...

there are surely areas / functionalities which are better supported on the GO32v2 target (unit graph coming to my mind as one particular example), but I don't think that your project should really need those.

you are absolutely 100000000000+% correct on that... there's nothing visual... the tool is fired from a console command line... there's little to no output (unless i decide to add some for logging purposes)... and, lastly, the tool is doing nothing more than extracting a/the text/plain MIME section(s) from messages saved as text files... the only other thing the tool is doing is converting "characters" like the trademark symbol from their unicode(???) character back to the old DOS 8bit/7bit old school alternative... ie: the trademark symbol is located as the "= 9 9" (spaced to prevent conversion) MIME text in the message body and converted to "(tm)" which any old DOS 3.x can understand :)

let me fix up a few things and i'll post another message, in the list or privately, containing my current code... i'll also try to bang up the error messages from the attempts to compile to the OS/2 (native) target...

thanks for your interest and assistance!

Reply by email

waldo kitty
to Tomas Hajny: . . . . I'm willing to have a look at your current version if you can upload it…
Tomas Hajny wrote 9 lines
On Fri, February 18, 2011 02:24, waldo kitty wrote: I'm willing to have a look at your current version if you can upload it somewhere. Synapse has probably not been ported to the OS/2 target and it possibly uses various platform specific APIs but it should be possible to port it with reasonable effort (especially stuff like processing MIME messages should be fairly generic). First of all, you should check whether the missing units are supposed to be platform independent or not. If not, it is surely not just the matter of paths, etc. Also, if you mention concrete error messages, people may be able to advise.

ok, as i wrote before, i would attempt to provide more information... here's what i'm getting with the attached source code when attempting to compile a GO32V2 (native) target on my win2k development box... this environment is from the DOS242FULL.ZIP archive with the same last synapse public release code as previously used in my i386-win32 console compilations... this is the same/only public release code available from the synapse site... i have NOT (yet) attempted to pull the SVN synapse code... yes, this synapse code appears to be "ancient" in that it is dated 2009 (IIRC!)...

Fatal: Can't find unit dynlibs used by synafpc

my sources, yet unmodified for more general processing, are attached... yes, it is "ugly" and i need to move at least one section to another procedure or two but here it is in all its ugliness ;)

i /THINK/ this is the same initial error i get when attempting to compile on OS/2 from the OS2242FULL.ZIP archive... on each, they are set up as a separate and distinct entity and the exact same synapse sources are copied to each distinct base installation's projects directory... the only thing i've done in each case is to add the synapse sources' directory to the unit and include files sections in the FPC IDE...

i hope this is clear and understandable... i will provide another post with the necessary information for the OS/2 native side if necessary... just let me know, eh? :P

Reply by email

Marco van de Voort
to waldo kitty

In our previous episode, waldo kitty said:

Fatal: Can't find unit dynlibs used by synafpc

Odd. Dos doesn't support a common dll/shared library format (though some toolchains do on their own, FPC doesn't atm).

But OS/2 does have dlls, and afaik has unit dynlibs, so that is a bit strange.

Reply by email

Tomas Hajny
to waldo kitty: my code is pretty small... it should easily fit the attachment limitations of this list :)
waldo kitty wrote 19 lines
On 2/18/2011 04:47, Tomas Hajny wrote: > On Fri, February 18, 2011 02:24, waldo kitty wrote: > First of all, you should check whether > the missing units are supposed to be platform independent or not. yes, part of what i'm running into is platform dependency problems... i forget which unit it is that's triggering the platform stuff but where it is failing is when trying to bring in platform stuff like loading libraries and there's nothing in my code that needs any libraries to be loaded for any reason that i'm aware of... it is possible that "WalkParts" might want something loaded from a lib but i do not need anything like that for my immediate purposes since i'm only looking for the text/plain section(s) and extracting them to an ASCII text file...

If I should speculate, I'd guess for character set conversions.

.
.

Show quoted text 11 lines
i shall try to grab these in the future... one thing that may also be causing waves is that my OS/2 and DOS FPCs are 2.4.2 releases whereas on my development machine(s), i'm pulling FPC and lazarus from their SVNs and building them from the ground up... both of my development machines started with nothing on them until i pulled the code from SVN and the bootstrap compiler to kick it in the arse and build working environments...

I don't think that this should be a major problem in your case (you don't need any recent features probably ;-) ).

Show quoted text 16 lines
>> i'm just not sure where to turn now so out of frustration, i'm now >> pulling >> down the dos242full.zip of FPC and will be installing that to another >> directory on the OS/2 box... then it should be a simple matter of >> copying >> the project to another directory in there and giving it a kick in the >> arse >> to see what happens... hopefully i'll end up with a workable executable >> and >> my project with be, basically, at the end :) yeah, the above failed miserably... i didn't realize that LFNs were necessary and the DOS version on OS/2 simply cannot access OS/2 LFNs in any way shape or fashion at all...

Yes, that's a "feature" of the OS/2 virtual DOS machine (partly because this emulation is at MS DOS 5.00 level, long before W95 LFN API for DOS).

Show quoted text 5 lines
> I'd recommend using the OS/2 target directly in your case; OS/2 straight? not the OS/2 w/ EMX?? it really doesn't matter to me as long as i end up with a working executable for the task at hand...

.
.

I mean the target 'OS2' (default with the OS/2 version of FPC 2.4.2). It still uses EMX binary format which also implies dependency on EMX.DLL, but it is based on native OS/2 APIs (as opposed to target EMX aka 'OS/2 via EMX' which is based on EMX runtime and allows building single executables running under both OS/2 and DOS natively as long as you restrict yourself to basic stuff like units System and DOS). However, target EMX does not really work at the moment, it would need some effort to make it up and running again.

Tomas

Reply by email

Tomas Hajny
to waldo kitty: ok, as i wrote before, i would attempt to provide more information... here's what i'm…
waldo kitty wrote
On 2/18/2011 04:47, Tomas Hajny wrote: > On Fri, February 18, 2011 02:24, waldo kitty wrote:

.
.

Show quoted text 16 lines
ok, as i wrote before, i would attempt to provide more information... here's what i'm getting with the attached source code when attempting to compile a GO32V2 (native) target on my win2k development box... this environment is from the DOS242FULL.ZIP archive with the same last synapse public release code as previously used in my i386-win32 console compilations... this is the same/only public release code available from the synapse site... i have NOT (yet) attempted to pull the SVN synapse code... yes, this synapse code appears to be "ancient" in that it is dated 2009 (IIRC!)... Fatal: Can't find unit dynlibs used by synafpc

Yes - unit dynlibs (loading of DLLs on demand) is not supported under GO32v2 for obvious reasons...

Show quoted text 16 lines
my sources, yet unmodified for more general processing, are attached... yes, it is "ugly" and i need to move at least one section to another procedure or two but here it is in all its ugliness ;) i /THINK/ this is the same initial error i get when attempting to compile on OS/2 from the OS2242FULL.ZIP archive... on each, they are set up as a separate and distinct entity and the exact same synapse sources are copied to each distinct base installation's projects directory... the only thing i've done in each case is to add the synapse sources' directory to the unit and include files sections in the FPC IDE...

Unit dynlibs is perfectly supported by the OS2 target, i.e. the error should not be the same. However, it's well possible that it fails at runtime at the same spot because it probably tries to load a library not available under OS/2.

Show quoted text 5 lines
i hope this is clear and understandable... i will provide another post with the necessary information for the OS/2 native side if necessary... just let me know, eh? :P

I'll have a look at your sources once I get home. Having Synapse supporting the OS/2 target would be a nice side-effect. ;-)

Tomas

Reply by email

waldo kitty
to Marco van de Voort: In our previous episode, waldo kitty said: Odd. Dos doesn't support a common dll/shared…
Marco van de Voort wrote 6 lines
In our previous episode, waldo kitty said: > > Fatal: Can't find unit dynlibs used by synafpc Odd. Dos doesn't support a common dll/shared library format (though some toolchains do on their own,

right... the closest would be the old OVR/OVL (overlay) files but their use is quite different...

FPC doesn't atm).

i can understand that ;)

But OS/2 does have dlls, and afaik has unit dynlibs, so that is a bit strange.

right... the above error is from the DOS242FULL install i have on my w2k dev box... had to put it on there for the LFN support so that i could install /all/ available library code ;)

Reply by email

waldo kitty
to Tomas Hajny: . . Yes - unit dynlibs (loading of DLLs on demand) is not supported under GO32v2 for…
Tomas Hajny wrote 6 lines
On Sat, February 19, 2011 06:36, waldo kitty wrote: > > Fatal: Can't find unit dynlibs used by synafpc Yes - unit dynlibs (loading of DLLs on demand) is not supported under GO32v2 for obvious reasons...

yep! i was also incorrect... on the OS/2 box, in Mode: DEBUG with Target: OS/2, it is giving the following...

Fatal: Can't find unit UnixUtil used by synautil

i'm using synautil for the space trimming functions and the replacestring function...

[TRIM]

Show quoted text 8 lines
> i hope this is clear and understandable... i will provide another post > with the > necessary information for the OS/2 native side if necessary... just let me > know, > eh? :P I'll have a look at your sources once I get home. Having Synapse supporting the OS/2 target would be a nice side-effect. ;-)

:)

Reply by email

Tomas Hajny
to waldo kitty
waldo kitty wrote 15 lines
On 2/19/2011 08:45, Tomas Hajny wrote: > On Sat, February 19, 2011 06:36, waldo kitty wrote: >> >> Fatal: Can't find unit dynlibs used by synafpc > > Yes - unit dynlibs (loading of DLLs on demand) is not supported under > GO32v2 for obvious reasons... yep! i was also incorrect... on the OS/2 box, in Mode: DEBUG with Target: OS/2, it is giving the following... Fatal: Can't find unit UnixUtil used by synautil i'm using synautil for the space trimming functions and the replacestring function...

Yes. As it happens quite often, someone assumed that everything non- Windows must be Unix and thus tried to load some Unix specific unit. I'll see what would be possible alternatives. However, I guess that space trimming functions should be also available directly in platform independent parts of FPC RTL (strutils maybe)?

Tomas

Reply by email

waldo kitty
to Tomas Hajny
Tomas Hajny wrote 12 lines
On 19 Feb 11, at 14:53, waldo kitty wrote: > i was also incorrect... on the OS/2 box, in Mode: DEBUG with Target: OS/2, > it is giving the following... > > Fatal: Can't find unit UnixUtil used by synautil > > i'm using synautil for the space trimming functions and the replacestring > function... Yes. As it happens quite often, someone assumed that everything non- Windows must be Unix and thus tried to load some Unix specific unit. I'll see what would be possible alternatives.

sounds good to me :)

However, I guess that space trimming functions should be also available directly in platform independent parts of FPC RTL (strutils maybe)?

yes, i went digging in there and have changed my code a bit more to use the FPC routines... i don't know if it is faster or not but it has reduced the complexity of my code somewhat... i removed a loop and three vars, altogether, as well as reducing two functions to one and use another routine to handle something i was doing via the character replacement arrays... for this i had to add sysutils and strutils... however, i still need to use synapse's synautil for the StringsTrim routine which removes empty lines from the end of the stringlist...

of course none of this helps with the need for the UnixUtil unit on OS/2 because synautil is still used internally in the messpart stuff i'm using from synapse...

Reply by email

Tomas Hajny
to waldo kitty
waldo kitty wrote 15 lines
On 2/19/2011 15:27, Tomas Hajny wrote: > On 19 Feb 11, at 14:53, waldo kitty wrote: >> i was also incorrect... on the OS/2 box, in Mode: DEBUG with Target: OS/2, >> it is giving the following... >> >> Fatal: Can't find unit UnixUtil used by synautil >> >> i'm using synautil for the space trimming functions and the replacestring >> function... > > Yes. As it happens quite often, someone assumed that everything non- > Windows must be Unix and thus tried to load some Unix specific unit. > I'll see what would be possible alternatives. sounds good to me :)

.
.

For information for the list - I managed to fix/hack the necessary Synapse units to allow building under OS/2. Some functionalities impose certain limitations (mostly due to stuff not available for the OS/2 target), but those should be no problem for the original poster considering his needs. The package (updated Synapse units) is too big for the list so I only sent it to the original poster privately.

Tomas

Reply by email

waldo kitty
Tomas Hajny wrote 5 lines
Alright. It's just a hack, but probably sufficient for your current needs. ;-) The attached files "fix" Synapse (the released version) for the OS/2 target. There are limitations related to character set conversions and time handling (timezones and daylight saving time), but I believe that it would have no impact on you.

initial testing seems to show it working for my current project needs... i get the same results in my output files from the OS/2 native flavor of the exe as i get from the win32 native flavor of the exe... thanks!

Reply by email