Urgent Help

Hi all,

Click on the link to view the question...

http://www.experts-exchange.com/Programming/Programming_Languages/C/Q_20541475.html

I have posted a complete code.

1. My first requirement is to convert that program into database (MySQL) (Now the data's are stored in a flat file).
Instead of that i would like to store it into a table. So where should i modify that part. Now values are getting as a string and writing in the file.

2. My second requirement is to convert the entire code into Linux (Now it's run under Windows NT 3.51 or later.
For this job i am getting valueable help from expert Kdo.

Hope experts can help me to solve this problem.
Regards  
LVL 1
sureshpAsked:
Who is Participating?
 
fridomConnect With a Mentor Commented:
Ok, initial steps.
- replace all the Windows specific call to Unix specifics, do not change anything else, make it work as it is at the moment
Things which probabyl will work with not much hassle is the socket stuff, and the ANSI C stuff.

Unfortunatly was the code written with very less modulariziation. You have to split the main function for e.g to drop the System dependant parts and the system indepent parts. I suggest just have a look on what main all does:
it just some points:
- it initializes some string
- parses the command line
- opens a config file
- initialized the socket libraray and and an

Why the hell isn't it dividded into functions, This would be easy to modify and adopt....

- check if threads are necessary if yes check out the pthread  libraries on Linux, you can drop all the codes about threads in the source. (fortunatly they have put that in different functions this time)

Unfortunatly again Thread Func is again an overly compley function, but it does not help you have to replace it with a unix specifiv version (there is code in it which is just for Windows...)

Issue Read is easy to rewrite for Unix
CheckOSVersion can probably be dropped.
FatalError can b used as ist (well it should not be stdout to which you write errors.
GetConfigInfo is easy to re-write
convert_CDR can be used as is


- make youself comfortable with the Mysql DB it's C-API and Database Design
- replace the parts you need with MySQL stuff.


I would argue the code is written was written by a lazy programmer. He/she had not cared about structuring the code all make a very ad-hoc impression.

If I had to port it I would just take the base functionality out of it (what really makes the task) and re-write the rest. To do that one need to see how it works at the moment, how the format looks and think about how to make it into a Database Design, my impression is that the Structur is easy and that making just one table is probably all you need. What one needs is if a GUI is intended or not.

Now that is all I'm willing to say about it for getting a few points.

Regards
Friedirch
0
 
gj62Commented:
Sureshp,

You might want to check out http://www.rentacoder.com/RentACoder/default.asp

Of course, I can't speak for the other experts, and 500 pts is sure worth the attempt, but Sureshp might really need someone who they can contact after the initial effort, etc.  This is much more a consulting project rather than a specific question/answer issue.

Just a thought...
0
 
fridomCommented:
I disagree, this is not a question on can answer within a decent time. And sorry if he has problems with it than he should be prepared to pay really prices for that work. I have read over the code you
a) have to be fluent in the Win stuff
b) have to be fluent in Database design and the C-API for it
c) have to br fluent in Linux programming

Well I could help myself in ever area, but than I want to get paid for it decently.

Well just my 2 cents
Friedrich


0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
grg99Commented:
I'm pretty sure $5000 would NOT be enough to convert this program to SQL and Linux!  

Not to mention that since this seems to be a real-time server, one needs a heck of a lot more info about system load ansd respnse times to even begin designig a port.



0
 
fridomCommented:
I agree with grg99. I have a ungut feeling that there is someone really asking for "really" jobs, without "really" paying...

Regards
Friedrich
0
 
sureshpAuthor Commented:
Hi gj62,fridom,grg99

Anyway thanks for your comment.

gj62,
" Sureshp might really need someone who they can contact after the initial effort, "

Could you please help me to solve this problem (initail steps). As you said , after that i should approach someone for this work. Could you please tell me some hint to start this problem?

Thanks in advance.
Regards,
Sur  
0
 
gj62Commented:
You indicate Kdo is helping with #2.  For #1, you might want to post in the MySQL area - if you haven't worked with the MySQL API, you've got some effort ahead of you.  I am not familiar enough with it to assist :-(
0
 
sureshpAuthor Commented:
gj62,

Thanks for your immediate response.
could you please help me to provide some hints to convert it into Linux. Hope Kdo may help to solve this problem.

Thanks
Sur
0
 
sureshpAuthor Commented:
fridom,
Thanks for your well explained note.
I will go through carefully ..

"replace all the Windows specific call to Unix specifics, do not change anything else, make it work as it is at the moment "

Can you please suggest some site for Windows - Linux comparision?

Thanks in advance.
Regards,
Sur

0
 
fridomCommented:
Have you googled? Just one of the many hits:
http://www.codeweavers.com/about/news/talks/borcon2000/borcon2000.htm

We too have ported a non trivial Software from Windows to Unix, look for lcc-win32 and Qide

Regards
Friedrich
0
 
sureshpAuthor Commented:
fridom,
I am expressing my sincere thanks to you for your immediate response and for your kind help.
Hope you can assist for this problem if i face some doubt regarding this.

Thanks
Sur
0
 
sureshpAuthor Commented:
fridom ,

"To do that one need to see how it works at the moment, how the format looks and think about how to make it into a Database Design, "

Now the file writing format is as follows:

1,60592554550,9,20030119005008,20030119005029,20030119005038,-,202.9.64.199,219.93.0.21,-,1,1,2,1,-,-,-,0,0,0,-,-,1,2,
2,60592554500,19,20030119005053,20030119005124,20030119005143,-,202.9.64.199,219.93.0.21,-,1,1,2,1,-,-,-,0,1,0,-,-,2,3,
3,60389,2,20030119005903,20030119005904,20030119005906,-,202.9.64.199,219.93.0.21,-,1,1,-,-,2,1,-,0,0,0,-,-,3,4,
4,60390162234283,94,20030119010358,20030119010402,20030119010536,-,202.9.64.199,219.93.0.21,-,1,1,-,-,2,1,-,0,0,0,-,-,4,5,
5,-,0,20030119012001,-,20030119012022,28,202.9.64.199,-,-,1,0,2,1,-,-,-,0,0,0,-,-,5,-,
6,60592554500,318,20030119012101,20030119012131,20030119012649,-,202.9.64.199,219.93.0.21,-,1,1,2,1,-,-,-,0,0,0,-,-,6,6,
7,60390173075841,20,20030119012722,20030119012726,20030119012746,-,202.9.64.199,219.93.0.21,-,1,1,-,-,2,1,-,0,0,0,-,-,7,7,
8,60390173075841,15,20030119012811,20030119012815,20030119012830,-,202.9.64.199,219.93.0.21,-,1,1,-,-,2,1,-,0,0,0,-,-,8,8,
9,-,0,20030119013338,-,20030119013342,16,202.9.64.199,-,-,1,0,2,1,-,-,-,0,0,0,-,-,9,-,
10,60592554500,204,20030119013353,20030119013414,20030119013738,-,202.9.64.199,219.93.0.21,-,1,1,2,1,-,-,-,0,3,0,-,-,10,9,
11,60594599,17,20030119014449,20030119014505,20030119014522,-,202.9.64.199,219.93.0.21,-,1,1,2,1,-,-,-,0,0,0,-,-,11,10,
12,6030196115575,2,20030119014943,20030119014946,20030119014948,-,202.9.64.199,219.93.0.21,-,1,1,-,-,2,1,-,0,0,0,-,-,12,11,
13,60390196115575,3,20030119015024,20030119015027,20030119015030,-,202.9.64.199,219.93.0.21,-,1,1,-,-,2,1,-,0,0,0,-,-,13,12,
14,603901622342586,11,20030119015059,20030119015102,20030119015113,-,202.9.64.199,219.93.0.21,-,1,1,-,-,2,1,-,0,0,0,-,-,14,13,

---------------
"Unfortunatly again Thread Func is again an overly compley function, but it does not help you have to replace it with a unix specifiv version "

Is it possible to re-write in Linux?
Waiting for your comment
0
 
fridomCommented:
that is a CSV format this is totally easy to parse, what is not so easy is to come up with a decent Database design for it I do not have any clue what the fields are standing for.

Thread func can probably be rewritten using pthreads. If that is a wise idea is still another question.

Regards
Friedrich

0
 
sureshpAuthor Commented:
fridom,
Thanks for your reply.
May i post it as a separate question (pthread).
Hope you can help me to solve that problem...

regards
Sur
0
 
fridomCommented:
you can of course post a a question about pthread, but why don't you do yourself a favour and start reading about it first. I wrote before that the thing you want to do is "real work" and so you better be prepared to pay "real prices"

Regard
Friedrich
0
 
sureshpAuthor Commented:
I had posted the same....
0
All Courses

From novice to tech pro — start learning today.