Skip to content

Latest commit

 

History

History
42 lines (35 loc) · 1.62 KB

File metadata and controls

42 lines (35 loc) · 1.62 KB

0x09. C - Static libraries

Learning Objectives for this project:

  • What is a static library, how does it work, how to create one, and how to use it
  • Basic usage of ar, ranlib, nm

Tests ✔️

  • tests: Folder of test files. Provided by Holberton School.

Tasks 📃

  • 0. A library is not a luxury but one of the necessities of life

    • libholberton.a: C Static library containing all the functions listed below:

      • int _putchar(char c);
      • int _islower(int c);
      • int _isalpha(int c);
      • int _abs(int n);
      • int _isupper(int c);
      • int _isdigit(int c);
      • int _strlen(char *s);
      • void _puts(char *s);
      • char *_strcpy(char *dest, char *src);
      • int _atoi(char *s);
      • char *_strcat(char *dest, char *src);
      • char *_strncat(char *dest, char *src, int n);
      • char *_strncpy(char *dest, char *src, int n);
      • int _strcmp(char *s1, char *s2);
      • char *_memset(char *s, char b, unsigned int n);
      • char *_memcpy(char *dest, char *src, unsigned int n);
      • char *_strchr(char *s, char c);
      • unsigned int _strspn(char *s, char *accept);
      • char *_strpbrk(char *s, char *accept);
      • char *_strstr(char *haystack, char *needle);
    • holberton.h: Header file containing the prototypes of all functions included in libholberton.a.

  • 1. Without libraries what have we? We have no past and no future

    • create_static_lib.sh: Bash script that creates a static library called liball.a from all the .c files in the current directory.