30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

sim30simulator. The header file, simio.h, defines the interface between the<br />

library<br />

and the simulator. It is provided so you can rebuild the libraries and continue to<br />

use the<br />

simulator. However, your application should not use this interface since the<br />

simulator<br />

will not be available to an embedded application.<br />

The helper functions must be modified and rebuilt for your target application.<br />

The<br />

libpic30-omf.alibrary can be rebuild with the batch file named makelib.bat,<br />

which has been provided with the sources in src\pic30. Execute the batch file<br />

from<br />

a command window. Be sure you are in the src\pic30directory. Then copy the<br />

newly<br />

compiled file (libpic30-omf.a) into the lib directory.<br />

Standard C Libraries with Math Functions<br />

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

4.18.2 Function Descriptions<br />

This section describes the functions that must be customized for correct<br />

operation of<br />

the Standard C Library in your target environment. The default behavior section<br />

describes what the function does as it isdistributed. The description and remarks<br />

describe what it typically should do.<br />

_exit<br />

Description: Terminate program execution.<br />

Include: None<br />

Prototype: void _exit (int status);<br />

Argument: status exit status<br />

Remarks: This is a helper function called by the exit()Standard C Library<br />

function.<br />

Default Behavior: As distributed, this function flushes stdout and terminates.<br />

The<br />

parameter status is the same as that passed to the exit()standard C<br />

library function.<br />

File: _exit.c<br />

brk<br />

Description: Set the end of the process's data space.<br />

Include: None<br />

Prototype: int brk(void *endds)<br />

Argument: endds pointer to the end of the data segment<br />

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

Remarks: brk()is used to dynamically change the amount of space allocated for<br />

điểm đệm để vị trí lưu trữ để đọc dữ liệu<br />

len số lượng tối đa của các nhân vật để đọc<br />

Quay trở lại giá trị: Trả về số charactersread, mà có thể ít hơn lenif<br />

có ít hơn lencharacters còn lại trong các tập tin hoặc các tập tin được<br />

mở trong chế độ văn bản, trong trường hợp mỗi vận chuyển trở lại-linefeed mà<br />

Cặp (CR-LF) được thay thế bằng một nhân vật linefeed duy nhất. Chỉ có<br />

nhân vật linefeed duy nhất được tính vào giá trị trả về. Các<br />

thay thế không ảnh hưởng đến con trỏ tập tin. Nếu chức năng cố gắng đọc<br />

ở cuối của tập tin, nó sẽ trả về "0". Nếu xử lý không hợp lệ, hoặc các tập tin<br />

không mở cửa<br />

để đọc, hoặc các tập tin bị khóa, hàm trả về '-1'.<br />

Bình luận: chức năng trợ giúp này được gọi bởi các chức năng thư viện chuẩn C<br />

fgetc (), fgets (), fread (), và được ().<br />

Hành vi mặc định: Khi phân phối, các thông số được truyền đến hệ thống máy<br />

chủ<br />

thông qua các mô phỏng. Giá trị trả về là giá trị được trả về bởi máy chủ<br />

hệ thống tập tin.<br />

File: read.c<br />

loại bỏ<br />

Mô tả: Xóa một tập tin.<br />

Bao gồm:<br />

Nguyên mẫu: int remove (const char * filename);<br />

Đối số: file tên tập tin phải được loại bỏ<br />

Trở lại giá trị: Trả về "0" nếu thành công, "- 1 'nếu không thành công.<br />

Hành vi mặc định: Khi phân phối, các thông số được truyền đến hệ thống máy<br />

chủ<br />

thông qua các mô phỏng. Giá trị trả về là giá trị được trả về bởi máy chủ<br />

hệ thống tập tin.<br />

File: remove.c<br />

đổi tên<br />

Mô tả: Đổi tên một tập tin hoặc thư mục.<br />

Bao gồm:<br />

Nguyên mẫu: int đổi tên (const char * oldname, const char<br />

* Newname);<br />

Đối số: con trỏ oldname thành tên cũ<br />

newname con trỏ sang tên mới<br />

Trở lại giá trị: Trả về "0" nếu nó là thành công. Trên một lỗi, hàm trả về một giá<br />

trị khác không<br />

giá trị.<br />

Hành vi mặc định: Khi phân phối, các thông số được truyền đến hệ thống máy<br />

chủ<br />

thông qua các mô phỏng. Giá trị trả về là giá trị được trả về bởi máy chủ

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

Saved successfully!

Ooh no, something went wrong!