The XGC Libraries

C/C++ Libraries for 16 and 32-bit Spacecraft Microprocessors

Edited by

Chris Nettleton

This document includes information for users of the GCC-1750 and GCC-ERC32 software development systems.

The XGC Libraries is commercial non-proprietary software distributed under the terms of the GNU Public Library license. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.

The XGC libraries were developed under European Space Agency contract 11935/NL/JG.


Table of Contents
Preface
About This Manual
Audience
Reader's Comments
Conventions
1. Introduction
1.1. Program Startup
1.2. Program Termination
1.3. Standard Headers
1.4. Errors <errno.h>
1.5. Limits <float.h> and <limits.h>
1.6. Common definitions <stddef.h>
2. Diagnostics <assert.h>
2.1. Program Diagnostics
2.1.1. The assert macro
3. Character Handling <ctype.h>
3.1. Character Testing Functions
3.1.1. The isalnum function
3.1.2. The isalpha function
3.1.3. The iscntrl function
3.1.4. The isdigit function
3.1.5. The isgraph function
3.1.6. The islower function
3.1.7. The isprint function
3.1.8. The ispunct function
3.1.9. The isspace function
3.1.10. The isupper function
3.1.11. The isxdigit function
3.2. Character Case Mapping Functions
3.2.1. The tolower function
3.2.2. The toupper function
4. Localization <locale.h>
5. Mathematics <math.h>
5.1. Treatment of Error Conditions
5.2. Notes
5.3. Trigonometric Functions
5.3.1. The acos function
5.3.2. The asin function
5.3.3. The atan function
5.3.4. The atan2 function
5.3.5. The cos function
5.3.6. The sin function
5.3.7. The tan function
5.4. Hyperbolic Functions
5.4.1. The cosh function
5.4.2. The sinh function
5.4.3. The tanh function
5.5. Exponential and Logarithmic Functions
5.5.1. The exp function
5.5.2. The frexp function
5.5.3. The ldexp function
5.5.4. The log function
5.5.5. The log10 function
5.5.6. The modf function
5.6. Power Functions
5.6.1. The pow function
5.6.2. The sqrt function
5.7. Nearest Integer, Absolute Value and Remainder Functions
5.7.1. The ceil function
5.7.2. The fabs function
5.7.3. The floor function
5.7.4. The fmod function
6. Nonlocal Jumps <setjmp.h>
6.1. Save Calling Environment
6.1.1. The setjmp macro
6.2. Restore Calling Environment
6.2.1. The longjmp function
7. Signal Handling <signal.h>
7.1. Specify Signal Handling
7.1.1. The signal function
7.2. Send Signal
7.2.1. The raise function
8. Variable Arguments <stdarg.h>
8.1. Variable Argument List Access Macros
8.1.1. The va_start macro
8.1.2. The va_arg macro
8.1.3. The va_end macro
9. Input/output <stdio.h>
9.1. Formatted Input/Output Functions
9.1.1. The printf function
9.1.2. The sprintf function
9.1.3. The vprintf function
9.1.4. The vsprintf function
9.2. Character Input/Output Functions
9.2.1. The fgetc function
9.2.2. The fgets function
9.2.3. The fputc function
9.2.4. The fputs function
9.2.5. The getc function
9.2.6. The getchar function
9.2.7. The gets function
9.2.8. The putc function
9.2.9. The putchar function
9.2.10. The puts function
10. General Utilities <stdlib.h>
10.1. String Conversion Functions
10.1.1. The atof function
10.1.2. The atoi function
10.1.3. The atol function
10.1.4. The strtod function
10.1.5. The strtol function
10.1.6. The strtoul function
10.2. Pseudo-Random Sequence Generation Functions
10.2.1. The rand function
10.2.2. The srand function
10.3. Memory Management Functions
10.3.1. The calloc function
10.3.2. The free function
10.3.3. The malloc function
10.3.4. The realloc function
10.4. Communication with the Environment
10.4.1. The abort function
10.4.2. The atexit function
10.4.3. The exit function
10.4.4. The system function
10.5. Searching and Sorting Utilities
10.5.1. The bsearch function
10.6. Integer Arithmetic Functions
10.6.1. The abs function
10.6.2. The div function
10.6.3. The labs function
10.6.4. The ldiv function
10.7. Multi-byte Character Functions
10.7.1. The mblen function
10.7.2. The mbtowc function
10.7.3. The wctomb function
10.8. Multi-byte String Functions
10.8.1. The mbstowcs function
10.8.2. The wcstombs function
11. String Handling <string.h>
11.1. String Function Conventions
11.2. Copying Functions
11.2.1. The memcpy function
11.2.2. The memmove function
11.2.3. The strcpy function
11.2.4. The strncpy function
11.3. Concatenation Functions
11.3.1. The strcat function
11.3.2. The strncat function
11.4. Comparison Functions
11.4.1. The memcmp function
11.4.2. The strcmp function
11.4.3. The strncmp function
11.4.4. The strcoll function
11.4.5. The strxfrm function
11.5. Search Functions
11.5.1. The memchr function
11.5.2. The strchr function
11.5.3. The strcspn function
11.5.4. The strpbrk function
11.5.5. The strrchr function
11.5.6. The strspn function
11.5.7. The strstr function
11.5.8. The strtok function
11.6. Miscellaneous Functions
11.6.1. The memset function
11.6.2. The strerror function
11.6.3. The strlen function
12. Date and Time <time.h>
12.1. Time Manipulation Functions
12.1.1. The clock function
12.1.2. The difftime function
12.1.3. The mktime function
12.1.4. The time function
12.2. Time Conversion Functions
12.2.1. The asctime function
12.2.2. The ctime function
12.2.3. The gmtime function
12.2.4. The localtime function
12.2.5. The strftime function
13. Test Output <report.h>
13.1. Test Support Functions
13.1.1. The test function
13.1.2. The comment function
13.1.3. The failed function
13.1.4. The result function
14. POSIX Threads
14.1. Initialization Functions
14.1.1. The pthread_init function
14.2. Create and Destroy Functions
14.2.1. The pthread_create function
14.2.2. The pthread_detach function
14.2.3. The pthread_equal function
14.2.4. The pthread_exit function
14.2.5. The pthread_join function
14.3. Scheduling Functions
14.3.1. The pthread_getschedparam function
14.3.2. The pthread_setschedparam function
14.3.3. The sched_get_priority_max function
14.3.4. The sched_get_priority_min function
14.3.5. The sched_yield function
14.4. Timing Functions
14.4.1. The sleep function
14.4.2. The clock_gettime function
14.4.3. The nanosleep function
14.5. Pthread Attribute Functions
14.5.1. The pthread_attr_destroy function
14.5.2. The pthread_attr_getdetachstate function
14.5.3. The pthread_attr_getinheritsched function
14.5.4. The pthread_attr_getschedparam function
14.5.5. The pthread_attr_getschedpolicy function
14.5.6. The pthread_attr_init function
14.5.7. The pthread_attr_setdetachstate function
14.5.8. The pthread_attr_setinheritsched function
14.5.9. The pthread_attr_setschedparam function
14.5.10. The pthread_attr_setschedpolicy function
14.5.11. The pthread_attr_setstacksize function
14.6. Pthread Cond Functions
14.6.1. The pthread_cond_broadcast function
14.6.2. The pthread_cond_destroy function
14.6.3. The pthread_cond_init function
14.6.4. The pthread_cond_signal function
14.6.5. The pthread_cond_timedwait function
14.6.6. The pthread_cond_wait function
14.7. Pthread Mutex Functions
14.7.1. The pthread_mutex_init function
14.7.2. The pthread_mutex_destroy function
14.7.3. The pthread_mutex_lock function
14.7.4. The pthread_mutex_trylock function
14.7.5. The pthread_mutex_unlock function
14.8. Miscellaneous Functions
14.8.1. The pthread_once function
14.8.2. The pthread_self function
14.8.3. The pthread_key_create function
14.8.4. The pthread_getspecific function
14.8.5. The pthread_setspecific function
14.8.6. The pthread_cleanup_push function
14.8.7. The pthread_cleanup_pop function
15. Low-Level Programming <intrrpt.h>
15.1. Interrupt Handling Functions
15.1.1. The handler function
Index