Codewarrior® MSL C Reference

Total Page:16

File Type:pdf, Size:1020Kb

Codewarrior® MSL C Reference CodeWarrior® MSL C Reference Because of last-minute changes to CodeWarrior, some of the information in this manual may be inaccurate. Please read the Release Notes on the CodeWarrior CD for the latest up-to-date information. Revised: 991202 rdl Metrowerks CodeWarrior copyright ©1993–1999 by Metrowerks Inc. and its licensors. All rights reserved. Documentation stored on the compact disk(s) may be printed by licensee for personal use. Except for the foregoing, no part of this documentation may be reproduced or transmitted in any form by any means, electronic or mechanical, including photocopying, recording, or any information storage and retrieval system, without permission in writing from Metrowerks Inc. Metrowerks, the Metrowerks logo, CodeWarrior, and Software at Work are registered trademarks of Metrowerks Inc. PowerPlant and PowerPlant Constructor are trademarks of Metrowerks Inc. All other trademarks and registered trademarks are the property of their respective owners. ALL SOFTWARE AND DOCUMENTATION ON THE COMPACT DISK(S) ARE SUBJECT TO THE LICENSE AGREEMENT IN THE CD BOOKLET. How to Contact Metrowerks: U.S.A. and international Metrowerks Corporation P.O. Box 334 Austin, TX 78758 U.S.A. Canada Metrowerks Inc. 1500 du College, Suite 300 Ville St-Laurent, QC Canada H4L 5G6 Ordering Voice: (800) 377–5416 Fax: (512) 873–4901 World Wide Web http://www.metrowerks.com Registration information [email protected] Technical support [email protected] Sales, marketing, & licensing [email protected] CompuServe goto Metrowerks Table of Contents 1 Introduction 19 CodeWarrior Year 2000 Compliance . 19 For additional information, visit: http:// www.metrowerks.com/about/y2k.html. 19 Organization of Files . 19 ANSI C Standard . 22 The ANSI C Library and Apple Macintosh . 22 Console I/O and the Macintosh . 22 Console I/O and Windows . 23 Compatibility . 23 2 alloca.h 25 Overview of alloca.h . 25 alloca . 25 3 assert.h 27 Overview of assert.h . 27 assert . 27 4 console.h 29 Overview of console.h. 29 ccommand . 30 clrscr . 33 getch . 33 InstallConsole . 34 kbhit . 34 ReadCharsFromConsole . 35 RemoveConsole . 35 __ttyname . 36 WriteCharsToConsole. 36 5 crtl.h 39 Overview of crtl.h . 39 Argc . 39 Argv . 40 _DllTerminate . 40 MSL C Reference MCR–3 environ . 40 _HandleTable . 40 _CRTStartup. 41 _RunInit . 41 _SetupArgs . 42 6 ctype.h 43 Overview of ctype.h . 43 Character testing and case conversion. 43 Character Sets Supported . 44 isalnum . 44 isalpha . 46 iscntrl. 47 isdigit. 47 isgraph . 48 islower . 48 isprint . 49 ispunct . 50 isspace . 50 isupper . 51 isxdigit . 51 tolower . 52 toupper . 53 7 div_t.h 55 Overview of div_t.h. 55 div_t . 55 ldiv_t . 55 8 errno.h 57 Overview of errno.h. 57 errno . 57 9 fcntl.h 61 Overview of fcntl.h . 61 fcntl.h and UNIX Compatibility . 61 creat . 61 fcntl . 63 MCR–4 MSL C Reference open . 64 umask . 68 10 float.h 69 Overview of float.h . 69 Floating point number characteristics . 69 11 FSp_fopen.h 71 Overview of FSp_fopen.h . 71 FSp_fopen. 71 12 io.h 73 Overview of io.h . 73 _chdir . 73 _chdrive . 74 _fileno . 74 _get_osfhandle. 75 _getcwd. 75 GetHandle . 76 _heapmin . 76 _isatty . 77 _makepath . 77 _open_osfhandle . 78 _searchenv . 78 13 limits.h 81 Overview of limits.h . 81 Integral type limits . 81 14 locale.h 83 Overview of locale.h . 83 Locale specification . 83 localeconv. 84 setlocale. 84 15 malloc.h 87 Overview of malloc.h . 87 alloca . 87 MSL C Reference MCR–5 16 math.h 89 Overview of math.h. 89 Floating point mathematics . 92 NaN Not a Number . 92 Floating point error testing. 93 Inlined Intrinsics Option . 93 Floating Point Classification Macros. 93 Enumerated Constants . 93 fpclassify . 94 isfinite . 95 isnan . 95 isnormal . 96 signbit . 96 Floating Point Math Facilities. 97 acos . 97 acosf . 98 acosl . 98 asin. 98 asinf . 99 asinl . 99 atan . 99 atanf . 100 atanl . 100 atan2 . 100 atan2f. 101 atan2l. 101 ceil . 101 ceilf . 102 ceill. 103 cos . 103 cosf. 104 cosl. 104 cosh . 104 coshf . 105 coshl . 105 exp . 105 expf . 106 MCR–6 MSL C Reference expl . 106 fabs . 106 fabsf . 107 fabsl . 108 floor . 108 floorf . 109 floorl . 109 fmod . 109 fmodf. 110 fmodl . 110 frexp . 110 frexpf . 111 frexpl . 112 isgreater . 112 isgreaterless . 112 isless . 113 islessequal. ..
Recommended publications
  • Palm Security WP.Qxd
    Palm® Mobility Series: Security Smartphone and handheld security for mobile business. Mobile computing: Opportunities and risk By providing professionals with convenient mobile access to email, business applications, customer information and critical corporate data, businesses can become more productive, streamline business processes and enable better decision making. With the new ease of access to information comes a responsibility to protect the organization's data as well as the investment in mobile devices. In many ways, security risks for mobile computing are similar to those for other computing platforms. There are the usual concerns of protecting data, authenticating users, and shielding against viruses and other malicious Contents code. But because of their mobility and compact size, smartphones and handhelds present some additional challenges: Mobile computing: Opportunities and risk...................................................... 1 Know thy enemy: Security risks...................................................................... 2 • Smartphones and handhelds are more easily lost or stolen than Theft and loss ............................................................................................ 2 laptop or desktop computers. Password cracking .................................................................................... 2 Data interception ...................................................................................... 2 • Users often treat smartphones and handhelds as personal devices Malicious code
    [Show full text]
  • The Symbian OS Architecture Sourcebook
    The Symbian OS Architecture Sourcebook The Symbian OS Architecture Sourcebook Design and Evolution of a Mobile Phone OS By Ben Morris Reviewed by Chris Davies, Warren Day, Martin de Jode, Roy Hayun, Simon Higginson, Mark Jacobs, Andrew Langstaff, David Mery, Matthew O’Donnell, Kal Patel, Dominic Pinkman, Alan Robinson, Matthew Reynolds, Mark Shackman, Jo Stichbury, Jan van Bergen Symbian Press Head of Symbian Press Freddie Gjertsen Managing Editor Satu McNabb Copyright 2007 Symbian Software, Ltd John Wiley & Sons, Ltd The Atrium, Southern Gate, Chichester, West Sussex PO19 8SQ, England Telephone (+44) 1243 779777 Email (for orders and customer service enquiries): [email protected] Visit our Home Page on www.wileyeurope.com or www.wiley.com All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except under the terms of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court Road, London W1T 4LP, UK, without the permission in writing of the Publisher. Requests to the Publisher should be addressed to the Permissions Department, John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex PO19 8SQ, England, or emailed to [email protected], or faxed to (+44) 1243 770620. Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book are trade names, service marks, trademarks or registered trademarks of their respective owners.
    [Show full text]
  • Symbian Phone Security
    Symbian phone Security Job de Haas ITSX Symbian phone Job de Haas BlackHat Security ITSX BV Amsterdam 2005 Overview • Symbian OS. • Security Risks and Features. • Taking it apart. • Conclusions. Symbian phone Job de Haas BlackHat Security ITSX BV Amsterdam 2005 Symbian History • Psion owner of EPOC OS, originally from 1989, released EPOC32 in 1996 • EPOC32 was designed with OO in C++ • 1998: Symbian Ltd. formed by Ericsson, Nokia, Motorola and Psion. • EPOC renamed to Symbian OS • Currently ~30 phones with Symbian and 15 licensees. Symbian phone Job de Haas BlackHat Security ITSX BV Amsterdam 2005 Symbian Organization • Symbian licenses the main OS • Two GUI’s on top of Symbian: – Series 60, led by Nokia – UIQ, subsidiary of Symbian • Ownership: – Nokia 47.5% Panasonic 10.5% – Ericsson 15.6% Siemens 8.4% – SonyEricsson 13.1% Samsung 4.5% Symbian phone Job de Haas BlackHat Security ITSX BV Amsterdam 2005 Symbian Versions • EPOC32 • EPOC R5 • Symbian v6.0 • Symbian v7.0 • Symbian v8.0 • Symbian v9.0 announced for Q3 ‘05 Symbian phone Job de Haas BlackHat Security ITSX BV Amsterdam 2005 Series60 versions • 1st edition • 2nd edition • 3rd edition, announced feb. 2005 Symbian phone Job de Haas BlackHat Security ITSX BV Amsterdam 2005 UIQ versions • UIQ 1.0 • UIQ 2.1 • UIQ 3.0 released feb 2005 Symbian phone Job de Haas BlackHat Security ITSX BV Amsterdam 2005 Symbian OS Symbian phone Job de Haas BlackHat Security ITSX BV Amsterdam 2005 Symbian OS • Multitasking, preemptive kernel. • MMU protection of kernel and process spaces. • Strong Client – Server architecture • Plug-in patterns • Filesystem in ROM, Flash, RAM and on SD-card Symbian phone Job de Haas BlackHat Security ITSX BV Amsterdam 2005 Symbian development • Symbian v6 and v7 are compiled with a modified GCC.
    [Show full text]
  • Using Codewarrior for Macintosh
    CS106B Handout #5M Winter 04-05 January 7, 2005 Using CodeWarrior for Macintosh In CS106, you have the option of writing your programs on the Mac or PC. For the Macintosh environment, you will write your programs using the C++ compiler by Metrowerks called CodeWarrior Professional. The current version of CodeWarrior, Pro 8, has been site-licensed to Stanford and can be downloaded from the Software page on the course web site. CodeWarrior provides a very nice editing environment and debugger, and it is the state-of-the-art C++ compiler for the Mac. One of the consequences of using a state-of-the-art compiler is that the system requirements for CodeWarrior Pro 8 are somewhat high – it requires Mac OS 9.2.2 or later, 700MB of hard drive space, and at least 64 MB of RAM. You also have to have CarbonLib 1.5, since Pro 8 is written for Mac OS X as well. If you have OS X, then you need 128MB of RAM to run CodeWarrior Pro 8, and you don’t need CarbonLib as this is already part of OS X. You can download CarbonLib from Apple—more on this later. Using CodeWarrior at a cluster CodeWarrior is available for use in the Lair (the Tresidder Macintosh cluster), on the Macs in Meyer library, and in the residential computer clusters. Often it will already be in the Applications folder on the machine’s hard disk. If there is a folder there named something like Metrowerks CodeWarrior 8, then the application can be found within that folder.
    [Show full text]
  • This Introduction to the Metrowerks Codewarrior Software Development Tools
    Tutorial Introduction PURPOSE: - Provides an overview of the Metrowerks CodeWarrior toolset and explains how the toolset is organized and operates OBJECTIVES - Describe the CodeWarrior integrated development environment (IDE) - Identify the components of the CodeWarrior build system. - Identify the hosts on which the IDE executes. - Define a target. CONTENT: - 14 pages - 3 questions LEARNING TIME: - 20 minutes Welcome to this introduction to the Metrowerks CodeWarrior software development tools. This tutorial explains how CodeWarrior combines the programs required to write software into one seamless, integrated work environment. CodeWarrior tools run on several different platforms and can generate machine code for a variety of desktop and embedded systems. Upon completion of this tutorial, you’ll be able to describe the components of the CodeWarrior build system and the general organization of the software package. You’ll also be able to define a target and describe the operating systems that will host the software. 1 What is an IDE? • The IDE consists of tools that are used throughout the software development process. Project Manager Compiler Editor Assembler Search engine Linker Source code browser Debugger GUI designer • The tools are integrated fully and seamlessly. • A single environment is provided for software development. -- consistent operation -- move among all the tools freely -- a non-modal design In the CodeWarrior toolset, the Editor, Compiler, Linker, Debugger, and other software modules operate within an Integrated Development Environment, or IDE. The IDE oversees the control and execution of the tools. It provides an interface to the tools that is consistent and predictable. The operation of the development tools is seamless.
    [Show full text]
  • Nathan Miller (Final)
    Nathan Miller 5300 Parkview Drive #2062 Lake Oswego, OR 97035 541.954.0531 [email protected] SKILLS Overview I have extensive experience in all stages of the application development process, including requirement gathering and translation, functional specification compilation, technology evaluation, architecture\design, implementation, and maintenance\quality assurance. Languages\Frameworks • 8 years C\C++, designing and implementing all manner of desktop and network- communicating applications on Windows-based desktops (Windows SDK, MFC, ATL servers, COM objects and NT Services); handhelds (MS Embedded Visual C++ for Windows CE\Smartphone OS devices); and the embedded architecture found on Palm OS-based handheld devices. I also have experience designing and implementing cross platform ANSI-C compliant architectures • 8 years designing and implementing all manner of desktop applications in C#\ .NET Framework (versions 1.1\2.0\3.0) including interop via COM and InteropServices • 4 years Java, primarily made of modifying and enhancing the user interface of 3D vertebrate-modeling and animation software • Experience leveraging and modifying open source technologies to suit specific application needs. I have integrated third-party and open source technologies such as the OpenSSL encrypted network communication library, the log4NET logging framework, and the Xerces-c++ xml parsing framework, as well as modified the expat C++ xml parsing library to run on the memory- and processing performance-constrained embedded micro-architectures found
    [Show full text]
  • Mobile Operating Systems, the New Generation V1.01 FINAL
    Executive Summary Much has changed from the world of open operating Contents systems of 2003. The mobile software market has Chapter A: Mobile Software Today: Open OSs, Linux grown into a landscape of 100s of vendors where and other Misperceptions understanding the roles, functionality, lines of A.1. The New Generation of Operating Systems partnership and competition across software products A.2. Linux: Myth and Reality is a complex endeavour, even for a seasoned industry A.3. Java: A False Start, But Efforts Continue observer. This paper aims to help change that. A.4. Nokia against Symbian A.5. Conclusions and Market Trends The paper firstly presents the key software layers for mobile phones today and explains the importance of Chapter B: Making Sense of Operating Systems, UI application execution environments and UI frameworks. Frameworks and Application Environments Section A then examines common misperceptions in Chapter C: Product reviews the software market of 2006; the flexible OS genre as In-Depth reviews of A la Mobile, Access Linux the successor to the open OSs, the myth and reality Platform, Adobe Flash Lite, GTK+, MiniGUI, Mizi behind Linux for mobile phones, and the false start but Prizm, Montavista Mobilinux, Nokia S60, Obigo, continued efforts around J2ME. Chapter B compares Openwave Midas, Qualcomm Brew, SavaJe, several software platforms for product functionality, Symbian OS, Trolltech Qtopia, UIQ And Windows licensees and speed of market penetration. Mobile. A reference section follows, consisting of 2-page Chapter D: Trends in the Mobile Software Market reviews of 16 key software products, covering historical Open OSes are out; Flexible OSs are in product background, positioning, technology, strategy, Commoditisation of the core OS technology and including the author’s critical viewpoint.
    [Show full text]
  • Downloaded in Jan 2004; "How Smartphones Work" Symbian Press and Wiley (2006); "Digerati Gliterati" John Wiley and Sons (2001)
    HOW OPEN SHOULD AN OPEN SYSTEM BE? Essays on Mobile Computing by Kevin J. Boudreau B.A.Sc., University of Waterloo M.A. Economics, University of Toronto Submitted to the Sloan School of Management in partial fulfillment of the requirements for the degree of MASSACHUBMMIBE OF TECHNOLOGY Doctor of Philosophy at the AUG 2 5 2006 MASSACHUSETTS INSTITUTE OF TECHNOLOGY LIBRARIES June 2006 @ 2006 Massachusetts Institute of Technology. All Rights Reserved. The author hereby grn Institute of Technology permission to and to distribute olo whole or in part. 1 Signature ot Author.. Sloan School of Management 3 May 2006 Certified by. .............................. ............................................ Rebecca Henderson Eastman Kodak LFM Professor of Management Thesis Supervisor Certified by ............. ................ .V . .-.. ' . ................ .... ...... Michael Cusumano Sloan Management Review Professor of Management Thesis Supervisor Certified by ................ Marc Rysman Assistant Professor of Economics, Boston University Thesis Supervisor A ccepted by ........................................... •: °/ Birger Wernerfelt J. C. Penney Professor of Management Science and Chair of PhD Committee ARCHIVES HOW OPEN SHOULD AN OPEN SYSTEM BE? Essays on Mobile Computing by Kevin J. Boudreau Submitted to the Sloan School of Management on 3 May 2006, in partial fulfillment of the requirements for the degree of Doctor of Philosophy Abstract "Systems" goods-such as computers, telecom networks, and automobiles-are made up of mul- tiple components. This dissertation comprises three esssays that study the decisions of system innovators in mobile computing to "open" development of their systems to outside suppliers and the implications of doing so. The first essay considers this issue from the perspective of which components are retained under the control of the original innovator to act as a "platform" in the system.
    [Show full text]
  • MC9328MX1 I.MX1 Processor
    Applications Processors MC9328MX1 i.MX1 Processor Overview Freescale Semiconductor’s advanced i.MX family of applications processors helps you quickly harness the power of wireless, broadband, multimedia and the Internet. Designed for use in smartphones, wireless PDAs, mobile gaming, GPS systems and many other mobile wireless applications, Freescale’s i.MX applications processors are a leading solution in today’s smartphone environment, providing power performance to our Innovative Convergence™ platforms. Increasingly, handheld users are demanding converging wireless and multimedia applications. Enter the i.MX1 applications processor, or MC9328MX1. This member of the i.MX Family provides the first Bluetooth™ wireless technology-ready platform announced from a major worldwide semiconductor supplier. i.MX1’s Bluetooth wireless technology is part of a suite of peripherals designed to enhance rich multimedia experiences. The Bluetooth accelerator combines with the on-chip universal serial bus (USB), multimedia accelerator (MMA), The i.MX1 supports major > SDRAM controller (SDRAMC) color LCD controller, A/D converter with touch OSes and RTOSes including ® ® > Clock generation module (CGM) and panel control, multimedia card/secure digital Palm OS handhelds, Windows CE and ® power control module (MMC/SD), and Memory Stick® expansion card Pocket PC , Symbian™ and embedded ® controllers, to replace six ICs with a single-chip Linux operating systems. Mobile > Two universal asynchronous optimal multimedia platform. This system-on-chip computing products can leverage the receiver/transmitters (UART 1 and (SoC) integration enables efficient MP3, JPEG ARM920T core in the i.MX1 with UART 2) speeds up to 200 MHz. encode and decode, and MPEG-4 media > Two serial peripheral interfaces (SPIs) processing, as well as offers extremely low Features power consumption and low overall system costs.
    [Show full text]
  • For Smartphones?
    15.912 TECHNOLOGY STRATEGY SPRING SEMESTER 2005 FINAL PAPER SHOULD MOTOROLA EMBRACE 100% THE LINUX OPERATING SYSTEM (OS) FOR SMARTPHONES? Silvia Battigelli Alberto Farronato Carlos Mazariegos 15.912 - Technology Strategy Final Paper 1. Introduction In a period when the market for mobile devices is changing and moving towards convergence of multiple products into one single device, it is time for the big players in all related industries to reconsider their strategy to capture more of the value that convergence will create. Motorola, the second largest manufacturer of mobile handsets, recently adopted a new open source OS in a completely new market, such as the one of smartphones in China, and the question is: should they strongly adopt the new standard in all of the new products and in all of the markets? We believe that the answer is yes, and in this paper we will explain why. 2. An Overview of Motorola Motorola was originally founded as the Galvin Manufacturing Corporation in 1928 by Paul V. Galvin and his brother Joseph E. Galvin in Chicago, Illinois. Galvin Manufacturing Corporation's first product was a battery eliminator, a device that allows battery-powered radios to run on standard household electric current. In the 1930’s the company introduced one of the first commercially successful car radios and a single-frequency mobile radio receiver for police broadcasts. The company had just entered into the new field of mobile radio communications with net annual sales of $287,256. In the 1940’s, after Galvin Manufacturing Corporation becomes Motorola and offers first public stock, and into the 1950’s Motorola kept growing with new technological and commercial innovations in radio devices, television and personal pagers.
    [Show full text]
  • Ambient Networks Mobile Phone Integration
    Ambient Networks Mobile phone integration Carlos Rocha, Rui Botelho PSTFC FEUP – DEEC 2004 Ambient network - Mobile phone integration Supervisor professor: Prof. Manuel Alberto Pereira Ricardo Project supervisor: Prof. Mário Jorge Moreira Leitão Department: Department of Electrical and Computer Engineering Institutions: Faculty of Engineering at University of Oporto Institute of Engineering and Computer Systems of Oporto i About the authors Carlos Rocha Carlos is a student at FEUP since 1999. Carlos first experience on Symbian came with the acknowledgment of the project in the end of 2003. The work on this subject continues at the time of this writing. Student number: 990503145 E-mail: [email protected] Telephone: 961818010 Rui Botelho Rui is also student at FEUP since 1999. As with Carlos, Rui Botelho heard about Symbian in late 2003 as it was a project proposal of Prof. Manuel Ricardo. Since then, this area has been one of his main interests. Student number: 990503146 E-mail: [email protected] Telephone: 963379295 ii We would like to thank Professor Manuel Pereira Ricardo for believing in this work and helping us to overcome the problems that we met along the semester. We also would like to thank our colleagues, Filipe Abrantes, Ricardo Duarte and António Madureira for all the work done in the integration of our projects. A special thank you note goes to Filipe Sousa from INESC for all the help and support given. iii Contents 1. Introduction 1.1 Overview....................................................................................................1
    [Show full text]
  • A Guide for Symbian OS C++ Developers (Nokia Mobile
    Developing Series 60 Applications: A Guide For Symbian OS C++ Developers (Nokia Mobile Developer Series) Ebooks Free Reviewed by Nokia's subject matter experts, the authors cover the entire development process - from design, programming, and testing to debugging and deployment - while providing sixty projects, each with full C++ source code and installation scripts. This is a guide to Series 60 development for C++ programmers and software designers. --This text refers to an out of print or unavailable edition of this title. Series: Nokia Mobile Developer Series Paperback: 749 pages Publisher: Addison Wesley Longman; 1st Special edition edition (January 2006) Language: English ISBN-10: 032126875X ISBN-13: 978-0321268754 Product Dimensions: 9.1 x 7.1 x 1.7 inches Shipping Weight: 2.9 pounds Average Customer Review: 4.5 out of 5 stars  See all reviews (13 customer reviews) Best Sellers Rank: #14,652,086 in Books (See Top 100 in Books) #55 in Books > Computers & Technology > Programming > APIs & Operating Environments > EPOC-Symbian #60168 in Books > Computers & Technology > Software I picked up this book with the purpose of learning about Symbian development on smart phones and to refresh my C++ grammar. Having heard of other Symbian and Series XX books, I had my doubts regarding the quality of the book's content. As a pleasant surprise, the authors have done a good job in creating a well-structured book that leads a newbie into the world of Series 60 programming.First of all, as the authors state in the preface, prior knowledge of C++ is a prerequisite for getting the most out of this book.
    [Show full text]