ex_hello.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* EX_HELLO.C - Example of a trivial OpenDoors program. Demonstrates */
  2. /* just how simple a fully functional door program can be. Also */
  3. /* shows all the basic elements required by any program using */
  4. /* OpenDoors. See manual for instructions on how to compile */
  5. /* this program. */
  6. /* */
  7. /* This program shows how to do the following: */
  8. /* */
  9. /* - #include the OpenDoors header file, opendoor.h. */
  10. /* - Create a mainline function that can be compiled under */
  11. /* both DOS and Windows versions of OpenDoors. */
  12. /* - How to display text on multiple lines. */
  13. /* - How to wait for a single key to be pressed. */
  14. /* - How to properly exit a program that uses OpenDoors. */
  15. /* The opendoor.h file must be included by any program using OpenDoors. */
  16. #include "OpenDoor.h"
  17. /* The main() or WinMain() function: program execution begins here. */
  18. #ifdef ODPLAT_WIN32
  19. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  20. LPSTR lpszCmdLine, int nCmdShow)
  21. #else
  22. int main(int argc, char *argv[])
  23. #endif
  24. {
  25. /* Display a message. */
  26. od_printf("Hello world! This is a very simple OpenDoors program.\n\r");
  27. od_printf("Press any key to return to the BBS!\n\r");
  28. /* Wait for user to press a key. */
  29. od_get_key(TRUE);
  30. /* Exit door program, returning to the BBS. */
  31. od_exit(0, FALSE);
  32. return(0);
  33. }