LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-28-2010, 04:25 AM   #1
jeremy28
Member
 
Registered: Sep 2009
Posts: 48

Rep: Reputation: 15
I need some win32 API alternatives in linux please?!


Hi all,

I'm porting a Win32 program into linux.
The program's name is "Serial Wrapper" that is intended to open a handle to a device in COM port and read or write some data to it by functions and structures such:

DCB
CreateFile
GetCommState
SetCommState
SetCommMask
WriteFile
ReadFile
SetCommTimeouts
...

but I have problem in replacing them by the appropriate alternatives in linux, because I'm new to linux APIs!

I've searched and found that the related header files are "sys/select.h" and " termios.h", I saw them but they didn't help me so much!!

Please share your experiences with me in this issue...

TIA.
 
Old 06-28-2010, 04:29 AM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by jeremy28 View Post
Hi all,

I'm porting a Win32 program into linux.
The program's name is "Serial Wrapper" that is intended to open a handle to a device in COM port and read or write some data to it by functions and structures such:

DCB
CreateFile
GetCommState
SetCommState
SetCommMask
WriteFile
ReadFile
SetCommTimeouts
...

but I have problem in replacing them by the appropriate alternatives in linux, because I'm new to linux APIs!

I've searched and found that the related header files are "sys/select.h" and " termios.h", I saw them but they didn't help me so much!!

Please share your experiences with me in this issue...

TIA.
Start from here: http://en.wikipedia.org/wiki/C_standard_library . You will need stdio.h.
 
Old 06-28-2010, 05:10 AM   #3
jeremy28
Member
 
Registered: Sep 2009
Posts: 48

Original Poster
Rep: Reputation: 15
Hi and thanks for the reply!

I saw that wiki, but unfortunately it didn't help me!

What did you mean exactly of introducing that please?

THX.
 
Old 06-28-2010, 05:20 AM   #4
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by jeremy28 View Post
Hi and thanks for the reply!

I saw that wiki, but unfortunately it didn't help me!

What did you mean exactly of introducing that please?

THX.
What ? You didn't find any file related functions in the Wiki article on stdio.h ? I.e. you didn't find anything related to file creation, reading, writing ?
 
Old 06-28-2010, 05:28 AM   #5
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
You know what, I'll formalize my questions - please answer all of them according to their grammatical form, i.e. with YES or NO:
  1. Did I give an exact link to the Wiki article on "C" standard library ?
  2. Did I say you would need stdio.h ?
  3. Does the Wiki article on "C" standard library contain the "stdio.h" string ?
  4. Is there in the Wiki article on "C" standard library a link to another Wiki page, the visible name of the link being "stdio.h" ?
  5. Does that second Wiki page on "stdio.h" contain names of file creation, read and write functions among others ?
 
Old 06-28-2010, 05:55 AM   #6
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Also, try

linux serial port

in Yahoo - second link, PDF file.
 
Old 06-28-2010, 05:58 AM   #7
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
And if you enter

linux windows serial port

into Yahoo, the match becomes the first one.
 
Old 06-28-2010, 08:32 AM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by Sergei Steshenko View Post
And if you enter

linux windows serial port

into Yahoo, the match becomes the first one.
Works quite well in Google too.
 
Old 06-28-2010, 04:02 PM   #9
gbaxtin
LQ Newbie
 
Registered: May 2010
Location: US
Posts: 3

Rep: Reputation: 0
yeah man google linux serial port. lots of good info.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
porting Win32 API calls to Linux integer Programming 3 03-30-2005 10:41 PM
If Win32 is for WIndows than What is the API for Linux ? indian Programming 14 01-07-2005 02:28 PM
cross platform C or C++ API for linux and Win32 tcma Linux - Software 1 12-09-2004 11:05 PM
Stupid win32 API question.... pld Programming 12 04-02-2004 03:46 PM
ASSEMBLY: Win32 API errors mandrake_linux Programming 1 06-19-2001 11:38 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration