in reply to How to Add MD5 C program using Inline::C to a perl program???

My probelm is that in C MD5 there is a main program and which use diffrent header file

That shouldn't be a problem. If the C program contains:
#include <some_header.h>
then you just need to start the Inline::C section of your script with:
use Inline C => <<'EOC'; #include <some_header.h> . .
or perhaps:
use Inline C => <<'EOC'; #include "full/path/to/some_header.h" . .
Other than that, you just need to rewrite your main() program as a C function that returns the string you're after.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: How to Add MD5 C program using Inline::C to a perl program???
by samirpatry (Acolyte) on Oct 19, 2006 at 14:06 UTC

    I agree with your point and already worked on that .But the MD5 is a written in C and it has a workspace which i want to add in to my perl program.so that i just pass the argument like pszAlg, pszUser, pszRealm, pszPass, pszNonce,pszCNonce, HA1 from my perl program and obtain the value return from the C MD5.
      I agree with your point and already worked on that .But the MD5 is a written in C and it has a workspace which i want to add in to my perl program.

      I apologize since I've not touched C in quite a lot of years, but sincerely I can't remember "workspaces" in C. So, what is a workspace? What is the corresponding Perl structure/concept/whatever it should be translated into?

      so that i just pass the argument like pszAlg, pszUser, pszRealm, pszPass, pszNonce,pszCNonce, HA1 from my perl program and obtain the value return from the C MD5.

      I'm not really sure if I understand what you mean:

      pszAlg, pszUser, pszRealm, pszPass, pszNonce,pszCNonce, HA1

      these are not valid Perl identifiers or values, unless you mean them to be subs, so I don't see how you can pass them "from your perl program", and if they are subs, then what's the problem with

      my $md5=MD5_XS_sub(pszAlg, pszUser, pszRealm, pszPass, pszNonce,pszCNo +nce, HA1); # ?!?