30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Default Behavior: As distributed, the parameters are passed to the host file<br />

system<br />

®<br />

Thư viện Công cụ Ngôn ngữ<br />

through the simulator. The return value is the value returned by the host<br />

DS51456B trang 376<br />

2004 Microchip Technology Inc<br />

file system. If the host system returns a value of ‘-1’, the global variable<br />

errno is set to the value of the symbolic constant EFOPENdefined in<br />

.<br />

File: open.c<br />

Standard C Libraries with Math Functions<br />

2004 Microchip Technology Inc. DS51456B-page 371<br />

read<br />

Description: Read data from a file.<br />

Include: None<br />

Prototype: int read(int handle, void * buffer,<br />

unsigned int len);<br />

Argument: handle handle referring toan opened file<br />

buffer points to the storage location for read data<br />

len the maximum number of characters to read<br />

Return Value: Returns the number of charactersread, which may be less than<br />

lenif<br />

there are fewer than lencharacters left in the file or if the file was<br />

opened in text mode, in which case each carriage return-linefeed<br />

(CR-LF) pair is replaced with a single linefeed character. Only the<br />

single linefeed character is counted in the return value. The<br />

replacement does not affect the file pointer. If the function tries to read<br />

at end of file, it returns ‘0’. If the handle is invalid, or the file is not open<br />

for reading, or the file is locked, the function returns ‘-1’.<br />

Remarks: This helper function is called by the Standard C Library functions<br />

fgetc(), fgets(), fread(), and gets().<br />

Default Behavior: As distributed, the parameters are passed to the host file<br />

system<br />

through the simulator. The return value is the value returned by the host<br />

file system.<br />

File: read.c<br />

remove<br />

Description: Remove a file.<br />

Include: <br />

Prototype: int remove(const char *filename);<br />

Argument: filename file to be removed<br />

Return Value: Returns ‘0’ if successful,‘-1’ if unsuccessful.<br />

Default Behavior: As distributed, the parameters are passed to the host file<br />

system<br />

5.2 Xây-IN DANH SÁCH CHỨC NĂNG<br />

Phần này mô tả các giao diện lập trình để trình biên dịch MPLAB C30 C được<br />

xây dựng trong<br />

chức năng. Kể từ khi chức năng này được "xây dựng trong", không có tập tin<br />

tiêu đề liên quan<br />

chúng. Tương tự như vậy, không có thiết bị chuyển mạch dòng lệnh liên quan<br />

đến việc tích hợp<br />

chức năng - họ luôn có sẵn. Tên chức năng được xây dựng trong được lựa chọn<br />

như vậy mà<br />

họ thuộc về không gian tên của trình biên dịch (tất cả đều có __builtin_ tiền tố)<br />

do đó<br />

họ sẽ không xung đột với các chức năng hoặc tên biến trong không gian tên của<br />

lập trình viên.<br />

__builtin_divsd<br />

Mô tả: Chức năng tính toán thương num / den. Một ngoại lệ lỗi toán học<br />

xảy ra nếu denis không. Đối số chức năng được ký kết, như là chức năng<br />

kết quả. Các tùy chọn dòng lệnh -Wconversionscan được sử dụng để<br />

phát hiện chuyển đổi tín hiệu không mong muốn.<br />

Nguyên mẫu: int __builtin_divsd (num dài const, const int den);<br />

Đối số: num tử số<br />

mẫu den<br />

Quay trở lại giá trị: Trả về giá trị số nguyên có chữ ký của các thương num /<br />

den.<br />

Assembler<br />

Điều hành / Máy<br />

Hướng dẫn:<br />

div.sd<br />

__builtin_divud<br />

Mô tả: Chức năng tính toán thương num / den. Một ngoại lệ lỗi toán học<br />

xảy ra nếu denis không. Chức năng argumentsare unsigned, như là<br />

chức năng kết quả. Các tùy chọn dòng lệnh được -Wconversionscan<br />

được sử dụng để phát hiện các dấu hiệu chuyển đổi bất ngờ.<br />

Nguyên mẫu: int __builtin_divud (const unsigned<br />

num dài, const int den);<br />

Đối số: num tử số<br />

mẫu den<br />

Quay trở lại giá trị: Trả về integervalue unsigned của các thương num / den.<br />

Assembler<br />

Điều hành / Máy<br />

Hướng dẫn:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!