?
Solved

Urgent Help

Posted on 2003-03-08
16
Medium Priority
?
224 Views
Last Modified: 2012-03-15
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  
0
Comment
Question by:sureshp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 2
  • +1
16 Comments
 
LVL 6

Expert Comment

by:gj62
ID: 8096594
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
 
LVL 24

Expert Comment

by:fridom
ID: 8097135
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
 
LVL 22

Expert Comment

by:grg99
ID: 8099703
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 24

Expert Comment

by:fridom
ID: 8101098
I agree with grg99. I have a ungut feeling that there is someone really asking for "really" jobs, without "really" paying...

Regards
Friedrich
0
 
LVL 1

Author Comment

by:sureshp
ID: 8104700
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
 
LVL 6

Expert Comment

by:gj62
ID: 8104743
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
 
LVL 1

Author Comment

by:sureshp
ID: 8104839
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
 
LVL 24

Accepted Solution

by:
fridom earned 2000 total points
ID: 8109145
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
 
LVL 1

Author Comment

by:sureshp
ID: 8109810
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
 
LVL 24

Expert Comment

by:fridom
ID: 8109908
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
 
LVL 1

Author Comment

by:sureshp
ID: 8112099
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
 
LVL 1

Author Comment

by:sureshp
ID: 8125348
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
 
LVL 24

Expert Comment

by:fridom
ID: 8125769
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
 
LVL 1

Author Comment

by:sureshp
ID: 8125807
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
 
LVL 24

Expert Comment

by:fridom
ID: 8126032
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
 
LVL 1

Author Comment

by:sureshp
ID: 8129950
I had posted the same....
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question