C code into php

Reply

Join Date: Jul 2006
Posts: 3
Reputation: angelv is an unknown quantity at this point 
Solved Threads: 0
angelv angelv is offline Offline
Newbie Poster

C code into php

 
0
  #1
Jul 22nd, 2006
HI
I am new to php
I would like to ask how I can insert a C source code into a php file
please help
I have a C scheduling algorithm that I'd like to use for my site that I am developing using php/mysql but I don't know how.

Please help
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 19
Reputation: Rotak is an unknown quantity at this point 
Solved Threads: 0
Rotak Rotak is offline Offline
Newbie Poster

Re: C code into php

 
0
  #2
Jul 22nd, 2006
Simple answer: Your algo needs to be ported to PHP. There is no way to implement C/C++ code into a php file.

The only way this works would be writing an extension for PHP. This extension is loaded by the php engine and provides your functionality under special function names.

Have a look at http://www.php.net and the PECL or PEAR subsites.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: C code into php

 
0
  #3
Jul 22nd, 2006
WHy don't you post your c algo here. I'd bet I could port it to php.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 19
Reputation: Rotak is an unknown quantity at this point 
Solved Threads: 0
Rotak Rotak is offline Offline
Newbie Poster

Re: C code into php

 
0
  #4
Jul 22nd, 2006
http://www.devnewz.com/2002/0909.html

This is a nice "how to" for adding your own libraries using windows. Linux shouldn't be a problem as well, if you know about C/C++ programming on different platforms.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 3
Reputation: angelv is an unknown quantity at this point 
Solved Threads: 0
angelv angelv is offline Offline
Newbie Poster

Re: C code into php

 
0
  #5
Jul 23rd, 2006
That is the scheduling code,
I 'd really appreciate your help.
Actually I need to do scheduling for a number of teams in the mysql database.
Attached Files
File Type: c scheduling.c (4.5 KB, 8 views)
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: C code into php

 
0
  #6
Jul 23rd, 2006
Originally Posted by angelv
That is the scheduling code,
I 'd really appreciate your help.
Actually I need to do scheduling for a number of teams in the mysql database.
That looks simple enough. The only problem I can see is with that struct.

But I suppose you use use a class instead or take it out altogether.

Passing functions, again that should be simple to do.

And those bitwise operators, thankfully php supports that as well:

http://www.hudzilla.org/php/3_12_3.php


Have a go and see how far you get.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC