Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 3rd, 2005, 8:45 PM   #11
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
There is no "portable" way to do this in C. There has to be a hardware (and, usually, OS) specific driver that matches the input device. Many compilers provide things that are OS or platform specific, but that specificity means they aren't portable. The C standard does not address the issue (it can't, reasonably).
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Sep 3rd, 2005, 9:26 PM   #12
2roll4life7
Programmer
 
2roll4life7's Avatar
 
Join Date: Aug 2005
Location: 0x0010 * 0x0091 + 0x0004
Posts: 65
Rep Power: 4 2roll4life7 is on a distinguished road
Quote:
Originally Posted by DaWei
There is no "portable" way to do this in C. There has to be a hardware (and, usually, OS) specific driver that matches the input device. Many compilers provide things that are OS or platform specific, but that specificity means they aren't portable. The C standard does not address the issue (it can't, reasonably).
http://java.sun.com/developer/techni...ity/pwordmask/

Although that may not be the most reliable solution, it for the most part works. I don't see why the same thing can't be done in C. I just said portable, I didn't say anything about reliable. I know there are several multi-platform libraries for threading.
__________________
#if 0 /* in case someone actually tries to compile this */
- libpng version 1.2.8 (example.c)

<Jim_McNeat> Is there like a way to put a compiler in "Just trust me on that one" mode?
2roll4life7 is offline   Reply With Quote
Old Sep 3rd, 2005, 9:49 PM   #13
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
It has nothing whatsoever to do with password masking. C doesn't provide a method for getting a single character (other than the ENTER key), with or without echo. I'm not saying someone couldn't decide at some point to alter the standards and requirements, I'm telling you what there is. It's dead simple to write code to do it. It's not portable.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Sep 5th, 2005, 4:57 PM   #14
2roll4life7
Programmer
 
2roll4life7's Avatar
 
Join Date: Aug 2005
Location: 0x0010 * 0x0091 + 0x0004
Posts: 65
Rep Power: 4 2roll4life7 is on a distinguished road
Quote:
Originally Posted by DaWei
It has nothing whatsoever to do with password masking. C doesn't provide a method for getting a single character (other than the ENTER key), with or without echo. I'm not saying someone couldn't decide at some point to alter the standards and requirements, I'm telling you what there is. It's dead simple to write code to do it. It's not portable.
DaWei, I think we both misunderstood eachother. What I thought you were saying is that there's no portable way of password masking in C. I realize now the point you are trying to make about the getch() method, and you're right.
__________________
#if 0 /* in case someone actually tries to compile this */
- libpng version 1.2.8 (example.c)

<Jim_McNeat> Is there like a way to put a compiler in "Just trust me on that one" mode?
2roll4life7 is offline   Reply With Quote
Old Sep 5th, 2005, 5:03 PM   #15
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I think we probably did misconstrue each other's points. Portability, after all, has many flavors.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:27 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC