changed beep to use stdlib instead of c++ lib

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1588 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty 2002-10-21 21:53:52 +00:00
parent dea47e9bad
commit 1bb3424fce
2 changed files with 29 additions and 41 deletions

View File

@ -2,6 +2,7 @@ SubDir OBOS_TOP src apps bin ;
StdBinCommands StdBinCommands
alert.cpp alert.cpp
beep.cpp
clipboard.cpp clipboard.cpp
shutdown.cpp shutdown.cpp
clipboard.cpp clipboard.cpp
@ -16,7 +17,6 @@ StdBinCommands
StdBinCommands StdBinCommands
roster.cpp roster.cpp
beep.cpp
catattr.cpp catattr.cpp
: be stdc++.r4 ; : be stdc++.r4 ;

View File

@ -1,51 +1,39 @@
//=========================================================================== // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
// ABOUT //////////////////////////////////////////////////////////////////// //
//=========================================================================== // Copyright (c) 2001-2002, OpenBeOS
//
// DESCRIPTION: BeOS' command line "beep" command // This software is part of the OpenBeOS distribution and is covered
// AUTHOR: Mahmoud Al Gammal // by the OpenBeOS license.
// STARTED: MON, SPT 23th, 2002 //
// LAST MODIFIED: MON, SPT 23th, 2002 //
// File: beep.cpp
//=========================================================================== // Author: Mahmoud Al Gammal
// END ABOUT //////////////////////////////////////////////////////////////// // Description: BeOS' command line "beep" command
//=========================================================================== // Created : Monday, September 23, 2002
//
//====================// // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
//===========================================================================
// INCLUDE //////////////////////////////////////////////////////////////////
//===========================================================================
#include <Beep.h> #include <Beep.h>
#include <iostream> #include <stdio.h>
//=========================================================================== int
// END INCLUDE ////////////////////////////////////////////////////////////// main( int argc, char* argv[] )
//=========================================================================== {
//====================//
//===========================================================================
// MAIN /////////////////////////////////////////////////////////////////////
//===========================================================================
int main( int argc, char* argv[] ) {
// "beep" can only take a single optional event name // "beep" can only take a single optional event name
if( argc > 2 ) { if (argc > 2) {
cout << "usage: beep [ eventname ]\n" fprintf(stdout,"usage: beep [ eventname ]\n");
"Event names are found in the Sounds preferences panel." fprintf(stdout,"Event names are found in the Sounds preferences panel.\n");
<< std::endl; fflush(stdout);
return B_OK; return B_OK;
} }
// if no event name is specified, play the default "Beep" event // if no event name is specified, play the default "Beep" event
if( argc == 1 ) return beep(); if (argc == 1) {
else return system_beep( argv[1] ); return beep();
} else {
return system_beep(argv[1]);
}
} }
//=========================================================================== // beep.c
// END MAIN /////////////////////////////////////////////////////////////////
//===========================================================================