diff --git a/MacroLibX/compile_commands.json b/MacroLibX/compile_commands.json deleted file mode 100644 index 2ff098d..0000000 --- a/MacroLibX/compile_commands.json +++ /dev/null @@ -1,1094 +0,0 @@ -[ - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/application.o", - "src/core/application.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/application.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/application.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/bridge.o", - "src/core/bridge.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/bridge.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/bridge.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/errors.o", - "src/core/errors.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/errors.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/errors.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/graphics.o", - "src/core/graphics.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/graphics.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/graphics.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/memory.o", - "src/core/memory.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/memory.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/memory.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/UUID.o", - "src/core/UUID.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/UUID.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/UUID.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/platform/inputs.o", - "src/platform/inputs.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/platform/inputs.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/platform/inputs.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/platform/window.o", - "src/platform/window.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/platform/window.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/platform/window.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/font.o", - "src/renderer/font.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/font.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/font.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/pixel_put.o", - "src/renderer/pixel_put.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/pixel_put.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/pixel_put.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/renderer.o", - "src/renderer/renderer.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/renderer.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/renderer.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/text_library.o", - "src/renderer/text_library.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/text_library.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/text_library.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/text_pipeline.o", - "src/renderer/text_pipeline.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/text_pipeline.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/text_pipeline.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/buffers/vk_buffer.o", - "src/renderer/buffers/vk_buffer.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/buffers/vk_buffer.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/buffers/vk_buffer.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/buffers/vk_ubo.o", - "src/renderer/buffers/vk_ubo.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/buffers/vk_ubo.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/buffers/vk_ubo.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/buffers/vk_vbo.o", - "src/renderer/buffers/vk_vbo.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/buffers/vk_vbo.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/buffers/vk_vbo.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/command/cmd_manager.o", - "src/renderer/command/cmd_manager.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/command/cmd_manager.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/command/cmd_manager.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/command/single_time_cmd_manager.o", - "src/renderer/command/single_time_cmd_manager.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/command/single_time_cmd_manager.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/command/single_time_cmd_manager.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/command/vk_cmd_buffer.o", - "src/renderer/command/vk_cmd_buffer.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/command/vk_cmd_buffer.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/command/vk_cmd_buffer.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/command/vk_cmd_pool.o", - "src/renderer/command/vk_cmd_pool.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/command/vk_cmd_pool.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/command/vk_cmd_pool.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/memory.o", - "src/renderer/core/memory.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/memory.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/memory.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/render_core.o", - "src/renderer/core/render_core.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/render_core.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/render_core.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_device.o", - "src/renderer/core/vk_device.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_device.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_device.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_fence.o", - "src/renderer/core/vk_fence.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_fence.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_fence.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_instance.o", - "src/renderer/core/vk_instance.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_instance.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_instance.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_queues.o", - "src/renderer/core/vk_queues.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_queues.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_queues.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_semaphore.o", - "src/renderer/core/vk_semaphore.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_semaphore.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_semaphore.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_surface.o", - "src/renderer/core/vk_surface.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_surface.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_surface.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_validation_layers.o", - "src/renderer/core/vk_validation_layers.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_validation_layers.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_validation_layers.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/descriptors/vk_descriptor_pool.o", - "src/renderer/descriptors/vk_descriptor_pool.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/descriptors/vk_descriptor_pool.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_pool.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/descriptors/vk_descriptor_set.o", - "src/renderer/descriptors/vk_descriptor_set.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/descriptors/vk_descriptor_set.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_set.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/descriptors/vk_descriptor_set_layout.o", - "src/renderer/descriptors/vk_descriptor_set_layout.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/descriptors/vk_descriptor_set_layout.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_set_layout.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/images/texture_atlas.o", - "src/renderer/images/texture_atlas.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/images/texture_atlas.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/images/texture_atlas.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/images/texture.o", - "src/renderer/images/texture.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/images/texture.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/images/texture.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/images/vk_image.o", - "src/renderer/images/vk_image.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/images/vk_image.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/images/vk_image.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/pipeline/pipeline.o", - "src/renderer/pipeline/pipeline.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/pipeline/pipeline.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/pipeline/pipeline.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/renderpass/vk_framebuffer.o", - "src/renderer/renderpass/vk_framebuffer.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/renderpass/vk_framebuffer.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/renderpass/vk_framebuffer.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/renderpass/vk_render_pass.o", - "src/renderer/renderpass/vk_render_pass.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/renderpass/vk_render_pass.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/renderpass/vk_render_pass.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/swapchain/vk_swapchain.o", - "src/renderer/swapchain/vk_swapchain.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/swapchain/vk_swapchain.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/swapchain/vk_swapchain.o" - } -] diff --git a/MacroLibX/libmlx.so b/MacroLibX/libmlx.so deleted file mode 100755 index bbeffad..0000000 Binary files a/MacroLibX/libmlx.so and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/core/application.o b/MacroLibX/objs/makefile/src/core/application.o deleted file mode 100644 index 778a04b..0000000 Binary files a/MacroLibX/objs/makefile/src/core/application.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/core/bridge.o b/MacroLibX/objs/makefile/src/core/bridge.o deleted file mode 100644 index fa54f19..0000000 Binary files a/MacroLibX/objs/makefile/src/core/bridge.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/core/errors.o b/MacroLibX/objs/makefile/src/core/errors.o deleted file mode 100644 index f9e9324..0000000 Binary files a/MacroLibX/objs/makefile/src/core/errors.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/core/graphics.o b/MacroLibX/objs/makefile/src/core/graphics.o deleted file mode 100644 index a370bf5..0000000 Binary files a/MacroLibX/objs/makefile/src/core/graphics.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/core/memory.o b/MacroLibX/objs/makefile/src/core/memory.o deleted file mode 100644 index d8719a1..0000000 Binary files a/MacroLibX/objs/makefile/src/core/memory.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/platform/inputs.o b/MacroLibX/objs/makefile/src/platform/inputs.o deleted file mode 100644 index 60cf2de..0000000 Binary files a/MacroLibX/objs/makefile/src/platform/inputs.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/platform/window.o b/MacroLibX/objs/makefile/src/platform/window.o deleted file mode 100644 index 810d1c9..0000000 Binary files a/MacroLibX/objs/makefile/src/platform/window.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/buffers/vk_buffer.o b/MacroLibX/objs/makefile/src/renderer/buffers/vk_buffer.o deleted file mode 100644 index d112bfc..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/buffers/vk_buffer.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/buffers/vk_ubo.o b/MacroLibX/objs/makefile/src/renderer/buffers/vk_ubo.o deleted file mode 100644 index f49346f..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/buffers/vk_ubo.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/buffers/vk_vbo.o b/MacroLibX/objs/makefile/src/renderer/buffers/vk_vbo.o deleted file mode 100644 index 8dc61db..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/buffers/vk_vbo.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/command/cmd_manager.o b/MacroLibX/objs/makefile/src/renderer/command/cmd_manager.o deleted file mode 100644 index 65598e1..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/command/cmd_manager.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/command/vk_cmd_buffer.o b/MacroLibX/objs/makefile/src/renderer/command/vk_cmd_buffer.o deleted file mode 100644 index 12bcb32..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/command/vk_cmd_buffer.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/command/vk_cmd_pool.o b/MacroLibX/objs/makefile/src/renderer/command/vk_cmd_pool.o deleted file mode 100644 index 2308577..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/command/vk_cmd_pool.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/core/memory.o b/MacroLibX/objs/makefile/src/renderer/core/memory.o deleted file mode 100644 index 5b9ef7a..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/core/memory.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/core/render_core.o b/MacroLibX/objs/makefile/src/renderer/core/render_core.o deleted file mode 100644 index f0f5317..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/core/render_core.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/core/vk_device.o b/MacroLibX/objs/makefile/src/renderer/core/vk_device.o deleted file mode 100644 index cc01eb9..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/core/vk_device.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/core/vk_fence.o b/MacroLibX/objs/makefile/src/renderer/core/vk_fence.o deleted file mode 100644 index 58e0646..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/core/vk_fence.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/core/vk_instance.o b/MacroLibX/objs/makefile/src/renderer/core/vk_instance.o deleted file mode 100644 index c3db0b1..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/core/vk_instance.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/core/vk_queues.o b/MacroLibX/objs/makefile/src/renderer/core/vk_queues.o deleted file mode 100644 index 83c560f..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/core/vk_queues.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/core/vk_semaphore.o b/MacroLibX/objs/makefile/src/renderer/core/vk_semaphore.o deleted file mode 100644 index 9da2dc2..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/core/vk_semaphore.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/core/vk_surface.o b/MacroLibX/objs/makefile/src/renderer/core/vk_surface.o deleted file mode 100644 index ff48e33..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/core/vk_surface.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/core/vk_validation_layers.o b/MacroLibX/objs/makefile/src/renderer/core/vk_validation_layers.o deleted file mode 100644 index f6b8d40..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/core/vk_validation_layers.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_pool.o b/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_pool.o deleted file mode 100644 index 67820d1..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_pool.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_set.o b/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_set.o deleted file mode 100644 index dd55f4d..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_set.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_set_layout.o b/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_set_layout.o deleted file mode 100644 index 37b4428..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_set_layout.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/images/texture.o b/MacroLibX/objs/makefile/src/renderer/images/texture.o deleted file mode 100644 index 307f356..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/images/texture.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/images/texture_atlas.o b/MacroLibX/objs/makefile/src/renderer/images/texture_atlas.o deleted file mode 100644 index cbfd062..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/images/texture_atlas.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/images/vk_image.o b/MacroLibX/objs/makefile/src/renderer/images/vk_image.o deleted file mode 100644 index 56a6977..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/images/vk_image.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/pipeline/pipeline.o b/MacroLibX/objs/makefile/src/renderer/pipeline/pipeline.o deleted file mode 100644 index cd09b1c..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/pipeline/pipeline.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/pixel_put.o b/MacroLibX/objs/makefile/src/renderer/pixel_put.o deleted file mode 100644 index 1e51221..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/pixel_put.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/renderer.o b/MacroLibX/objs/makefile/src/renderer/renderer.o deleted file mode 100644 index 5f63414..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/renderer.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/renderpass/vk_framebuffer.o b/MacroLibX/objs/makefile/src/renderer/renderpass/vk_framebuffer.o deleted file mode 100644 index fdb5f82..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/renderpass/vk_framebuffer.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/renderpass/vk_render_pass.o b/MacroLibX/objs/makefile/src/renderer/renderpass/vk_render_pass.o deleted file mode 100644 index c5e15a8..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/renderpass/vk_render_pass.o and /dev/null differ diff --git a/MacroLibX/objs/makefile/src/renderer/swapchain/vk_swapchain.o b/MacroLibX/objs/makefile/src/renderer/swapchain/vk_swapchain.o deleted file mode 100644 index db63685..0000000 Binary files a/MacroLibX/objs/makefile/src/renderer/swapchain/vk_swapchain.o and /dev/null differ diff --git a/Makefile b/Makefile index 6f6867e..e9571d3 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: adjoly +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2023/11/01 11:03:22 by adjoly #+# #+# # -# Updated: 2024/01/13 17:23:48 by adjoly ### ########.fr # +# Updated: 2024/01/13 19:09:13 by adjoly ### ########.fr # # # # **************************************************************************** # @@ -46,13 +46,13 @@ all: $(NAME) clean: make -C libft clean make -C get_next_line clean - make -C printf + make -C printf clean rm -f $(OBJS) fclean: clean make -C libft fclean make -C get_next_line fclean - make -C printf + make -C printf fclean rm -f $(NAME) re: fclean all diff --git a/ft_move_character.o b/ft_move_character.o deleted file mode 100644 index 4b5f77b..0000000 Binary files a/ft_move_character.o and /dev/null differ diff --git a/get_map.o b/get_map.o deleted file mode 100644 index e57de24..0000000 Binary files a/get_map.o and /dev/null differ diff --git a/get_next_line/get_next_line.a b/get_next_line/get_next_line.a deleted file mode 100644 index cd22091..0000000 Binary files a/get_next_line/get_next_line.a and /dev/null differ diff --git a/get_next_line/get_next_line.o b/get_next_line/get_next_line.o deleted file mode 100644 index f93ff55..0000000 Binary files a/get_next_line/get_next_line.o and /dev/null differ diff --git a/get_next_line/get_next_line_utils.o b/get_next_line/get_next_line_utils.o deleted file mode 100644 index c8c7179..0000000 Binary files a/get_next_line/get_next_line_utils.o and /dev/null differ diff --git a/libft b/libft deleted file mode 160000 index e391b9b..0000000 --- a/libft +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e391b9b0f745d775ca6cc48de602e1aab1f2866c diff --git a/libft/Makefile b/libft/Makefile new file mode 100644 index 0000000..77a0eef --- /dev/null +++ b/libft/Makefile @@ -0,0 +1,83 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: adjoly +#+ +:+ +#+ # +# +#+#+#+#+#+ +#+ # +# Created: 2023/11/01 11:03:22 by adjoly #+# #+# # +# Updated: 2024/01/07 22:47:45 by adjoly ### ########.fr # +# # +# **************************************************************************** # + +NAME = libft.a + +CC = clang + +SRCS = ft_atoi.c \ + ft_bzero.c \ + ft_isalnum.c \ + ft_isalpha.c \ + ft_isascii.c \ + ft_isdigit.c \ + ft_isprint.c \ + ft_putchar_fd.c \ + ft_putnbr_fd.c \ + ft_putstr_fd.c \ + ft_strdup.c \ + ft_memcpy.c \ + ft_memset.c \ + ft_memmove.c \ + ft_strlcpy.c \ + ft_strlen.c \ + ft_substr.c \ + ft_tolower.c \ + ft_toupper.c \ + ft_strlcat.c \ + ft_strjoin.c \ + ft_strncmp.c \ + ft_itoa.c \ + ft_calloc.c \ + ft_memchr.c \ + ft_memcmp.c \ + ft_strchr.c \ + ft_strrchr.c \ + ft_strnstr.c \ + ft_putendl_fd.c \ + ft_strtrim.c \ + ft_split.c \ + ft_strmapi.c \ + ft_striteri.c \ + ft_lstnew.c \ + ft_lstadd_front.c \ + ft_lstsize.c \ + ft_lstlast.c \ + ft_lstadd_back.c \ + ft_lstdelone.c \ + ft_lstclear.c \ + ft_lstiter.c \ + ft_lstmap.c \ + +OBJS = $(SRCS:.c=.o) + +FLAGS = -Werror -Wall -Wextra + +HEADER = libft.h + +$(NAME): $(OBJS) + ar -rcs $(NAME) $(OBJS) + +%.o: %.c + $(CC) $(FLAGS) -I $(HEADER) $< -c -o $@ + +all: $(NAME) + +clean: + rm -f $(OBJS) + +fclean: clean + rm -f $(NAME) + +re: fclean all + +.PHONY: clean all re fclean \ No newline at end of file diff --git a/libft/ft_atoi.c b/libft/ft_atoi.c new file mode 100644 index 0000000..541098d --- /dev/null +++ b/libft/ft_atoi.c @@ -0,0 +1,37 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_atoi.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 09:00:27 by adjoly #+# #+# */ +/* Updated: 2023/11/05 15:27:36 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int ft_atoi(const char *nptr) +{ + int i; + int sign; + int nbr; + + i = 0; + sign = 1; + nbr = 0; + while ((nptr[i] >= 7 && nptr[i] <= 13) || nptr[i] == 32) + i++; + if (nptr[i] == '-') + { + sign *= -1; + i++; + } + else if (nptr[i] == '+') + i++; + while (nptr[i] >= '0' && nptr[i] <= '9') + { + nbr = nbr * 10 + (nptr[i] - '0'); + i++; + } + return (nbr * sign); +} diff --git a/libft/ft_bzero.c b/libft/ft_bzero.c new file mode 100644 index 0000000..c6902d8 --- /dev/null +++ b/libft/ft_bzero.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_bzero.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/03 11:58:03 by adjoly #+# #+# */ +/* Updated: 2023/11/03 12:03:51 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_bzero(void *s, size_t n) +{ + ft_memset(s, '\0', n); +} diff --git a/libft/ft_calloc.c b/libft/ft_calloc.c new file mode 100644 index 0000000..77e79ff --- /dev/null +++ b/libft/ft_calloc.c @@ -0,0 +1,29 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_calloc.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/01 16:02:26 by adjoly #+# #+# */ +/* Updated: 2023/11/11 01:32:30 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" +#include + +void *ft_calloc(size_t nmemb, size_t size) +{ + void *result; + + if (size != 0 && nmemb != 0 && (nmemb * size) / nmemb != size) + return (NULL); + if (nmemb == 0 || size == 0) + return (malloc(1)); + result = malloc(size * nmemb); + if (result == NULL) + return (NULL); + ft_bzero(result, size * nmemb); + return (result); +} diff --git a/libft/ft_isalnum.c b/libft/ft_isalnum.c new file mode 100644 index 0000000..b41e0b0 --- /dev/null +++ b/libft/ft_isalnum.c @@ -0,0 +1,19 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isalnum.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 08:31:10 by adjoly #+# #+# */ +/* Updated: 2023/11/03 11:49:58 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int ft_isalnum(int c) +{ + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') + || (c >= '0' && c <= '9')) + return (1); + return (0); +} diff --git a/libft/ft_isalpha.c b/libft/ft_isalpha.c new file mode 100644 index 0000000..5585ab7 --- /dev/null +++ b/libft/ft_isalpha.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isalpha.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 08:31:10 by adjoly #+# #+# */ +/* Updated: 2023/11/03 11:52:37 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int ft_isalpha(int c) +{ + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) + return (1); + return (0); +} diff --git a/libft/ft_isascii.c b/libft/ft_isascii.c new file mode 100644 index 0000000..32648e4 --- /dev/null +++ b/libft/ft_isascii.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isascii.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 08:31:10 by adjoly #+# #+# */ +/* Updated: 2023/10/31 08:46:18 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int ft_isascii(int c) +{ + if (c >= 0 && c <= 127) + return (1); + return (0); +} diff --git a/libft/ft_isdigit.c b/libft/ft_isdigit.c new file mode 100644 index 0000000..79e2778 --- /dev/null +++ b/libft/ft_isdigit.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isdigit.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 08:50:01 by adjoly #+# #+# */ +/* Updated: 2023/11/03 11:53:33 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int ft_isdigit(int c) +{ + if (c >= '0' && c <= '9') + return (1); + return (0); +} diff --git a/libft/ft_isprint.c b/libft/ft_isprint.c new file mode 100644 index 0000000..e21f334 --- /dev/null +++ b/libft/ft_isprint.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isprint.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/05 14:47:49 by adjoly #+# #+# */ +/* Updated: 2023/11/05 14:51:51 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int ft_isprint(int c) +{ + if (c >= 32 && c <= 126) + return (1); + return (0); +} diff --git a/libft/ft_itoa.c b/libft/ft_itoa.c new file mode 100644 index 0000000..2f32646 --- /dev/null +++ b/libft/ft_itoa.c @@ -0,0 +1,58 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_itoa.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/05 16:26:26 by adjoly #+# #+# */ +/* Updated: 2023/11/06 15:36:28 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +static int ft_count_digit(int n) +{ + int i; + + i = 0; + if (n < 0) + i++; + if (n == 0) + return (1); + while (n) + { + n /= 10; + i++; + } + return (i); +} + +char *ft_itoa(int n) +{ + char *result; + int i; + + i = ft_count_digit(n); + if (n == 0) + return (ft_strdup("0")); + if (n == -2147483648) + return (ft_strdup("-2147483648")); + result = malloc(sizeof(char) * (i + 1)); + if (result == NULL) + return (NULL); + result[i--] = '\0'; + if (n < 0) + { + result[0] = '-'; + n = -n; + } + while (n) + { + result[i] = n % 10 + '0'; + n /= 10; + i--; + } + return (result); +} diff --git a/libft/ft_lstadd_back.c b/libft/ft_lstadd_back.c new file mode 100644 index 0000000..f1c1b98 --- /dev/null +++ b/libft/ft_lstadd_back.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstadd_back.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 16:37:42 by adjoly #+# #+# */ +/* Updated: 2023/11/11 17:56:48 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_lstadd_back(t_list **lst, t_list *new) +{ + if (lst == NULL) + return ; + if (*lst == NULL) + { + (*lst) = new; + return ; + } + ft_lstlast((*lst))->next = new; +} diff --git a/libft/ft_lstadd_front.c b/libft/ft_lstadd_front.c new file mode 100644 index 0000000..41bec2b --- /dev/null +++ b/libft/ft_lstadd_front.c @@ -0,0 +1,23 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstadd_front.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 15:39:25 by adjoly #+# #+# */ +/* Updated: 2023/11/11 15:50:06 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_lstadd_front(t_list **lst, t_list *new) +{ + if (lst == NULL) + return ; + if (new == NULL) + return ; + new->next = *lst; + *lst = new; +} diff --git a/libft/ft_lstclear.c b/libft/ft_lstclear.c new file mode 100644 index 0000000..c74554b --- /dev/null +++ b/libft/ft_lstclear.c @@ -0,0 +1,26 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstclear.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 18:05:14 by adjoly #+# #+# */ +/* Updated: 2023/11/12 16:19:59 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_lstclear(t_list **lst, void (*del)(void *)) +{ + t_list *tmp; + + tmp = NULL; + while (lst && *lst && del) + { + tmp = (*lst)->next; + ft_lstdelone((*lst), del); + *lst = tmp; + } +} diff --git a/libft/ft_lstdelone.c b/libft/ft_lstdelone.c new file mode 100644 index 0000000..0c50109 --- /dev/null +++ b/libft/ft_lstdelone.c @@ -0,0 +1,21 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstdelone.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 17:59:39 by adjoly #+# #+# */ +/* Updated: 2023/11/12 15:33:38 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_lstdelone(t_list *lst, void (*del)(void *)) +{ + if (lst == NULL || del == NULL) + return ; + del(lst->content); + free(lst); +} diff --git a/libft/ft_lstiter.c b/libft/ft_lstiter.c new file mode 100644 index 0000000..a9b1717 --- /dev/null +++ b/libft/ft_lstiter.c @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstiter.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 18:20:25 by adjoly #+# #+# */ +/* Updated: 2023/11/11 18:23:58 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_lstiter(t_list *lst, void (*f)(void *)) +{ + if (lst == NULL || f == NULL) + return ; + while (lst) + { + f(lst->content); + lst = lst->next; + } +} diff --git a/libft/ft_lstlast.c b/libft/ft_lstlast.c new file mode 100644 index 0000000..f5c8f54 --- /dev/null +++ b/libft/ft_lstlast.c @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstlast.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 16:03:12 by adjoly #+# #+# */ +/* Updated: 2023/11/11 16:37:10 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +t_list *ft_lstlast(t_list *lst) +{ + if (lst == NULL) + return (NULL); + while (lst->next) + lst = lst->next; + return (lst); +} diff --git a/libft/ft_lstmap.c b/libft/ft_lstmap.c new file mode 100644 index 0000000..bb470ed --- /dev/null +++ b/libft/ft_lstmap.c @@ -0,0 +1,35 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstmap.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 18:24:49 by adjoly #+# #+# */ +/* Updated: 2023/11/11 18:38:51 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *)) +{ + t_list *res; + t_list *tmp; + + if (lst == NULL || f == NULL || del == NULL) + return (NULL); + res = NULL; + while (lst) + { + tmp = ft_lstnew(f(lst->content)); + if (tmp == NULL) + { + ft_lstclear(&tmp, del); + return (NULL); + } + ft_lstadd_back(&res, tmp); + lst = lst->next; + } + return (res); +} diff --git a/libft/ft_lstnew.c b/libft/ft_lstnew.c new file mode 100644 index 0000000..298e054 --- /dev/null +++ b/libft/ft_lstnew.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstnew.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 15:30:32 by adjoly #+# #+# */ +/* Updated: 2023/11/11 15:51:49 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +t_list *ft_lstnew(void *content) +{ + t_list *lst; + + lst = malloc(sizeof(t_list)); + if (lst == NULL) + return (NULL); + lst[0].content = content; + lst[0].next = NULL; + return (lst); +} diff --git a/libft/ft_lstsize.c b/libft/ft_lstsize.c new file mode 100644 index 0000000..62a77a5 --- /dev/null +++ b/libft/ft_lstsize.c @@ -0,0 +1,26 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstsize.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 15:53:01 by adjoly #+# #+# */ +/* Updated: 2023/11/11 15:59:03 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +int ft_lstsize(t_list *lst) +{ + int i; + + i = 0; + while (lst != NULL) + { + lst = lst->next; + i++; + } + return (i); +} diff --git a/libft/ft_memchr.c b/libft/ft_memchr.c new file mode 100644 index 0000000..188a661 --- /dev/null +++ b/libft/ft_memchr.c @@ -0,0 +1,27 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memchr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/05 14:52:53 by adjoly #+# #+# */ +/* Updated: 2023/11/09 14:27:32 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void *ft_memchr(const void *s, int c, size_t n) +{ + size_t i; + + i = 0; + while (i < n) + { + if (((unsigned char *)s)[i] == (unsigned char)c) + return (((void *)s + i)); + i++; + } + return (NULL); +} diff --git a/libft/ft_memcmp.c b/libft/ft_memcmp.c new file mode 100644 index 0000000..9da23a1 --- /dev/null +++ b/libft/ft_memcmp.c @@ -0,0 +1,26 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memcmp.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/08 12:04:48 by adjoly #+# #+# */ +/* Updated: 2023/11/09 14:06:17 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" +#include + +int ft_memcmp(const void *s1, const void *s2, size_t n) +{ + size_t i; + + i = 0; + if (n == 0) + return (0); + while (((unsigned char *)s1)[i] == ((unsigned char *)s2)[i] && i < n - 1) + i++; + return (((unsigned char *)s1)[i] - ((unsigned char *)s2)[i]); +} diff --git a/libft/ft_memcpy.c b/libft/ft_memcpy.c new file mode 100644 index 0000000..02015d9 --- /dev/null +++ b/libft/ft_memcpy.c @@ -0,0 +1,30 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memcpy.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/02 10:21:55 by adjoly #+# #+# */ +/* Updated: 2023/11/04 14:13:12 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void *ft_memcpy(void *dest, const void *src, size_t n) +{ + size_t i; + + i = 0; + if (src == NULL && dest == NULL) + { + return (dest); + } + while (i < n) + { + ((unsigned char *)dest)[i] = ((unsigned char *)src)[i]; + i++; + } + return (dest); +} diff --git a/libft/ft_memmove.c b/libft/ft_memmove.c new file mode 100644 index 0000000..fd5ed7a --- /dev/null +++ b/libft/ft_memmove.c @@ -0,0 +1,27 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memmove.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/03 15:04:04 by adjoly #+# #+# */ +/* Updated: 2023/11/05 22:05:37 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void *ft_memmove(void *dest, const void *src, size_t n) +{ + size_t i; + + i = -1; + if (dest > src) + while (n-- > 0) + ((unsigned char *)dest)[n] = ((unsigned char *)src)[n]; + else if (dest < src) + while (++i < n) + ((unsigned char *)dest)[i] = ((unsigned char *)src)[i]; + return (dest); +} diff --git a/libft/ft_memset.c b/libft/ft_memset.c new file mode 100644 index 0000000..a9d8143 --- /dev/null +++ b/libft/ft_memset.c @@ -0,0 +1,26 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memset.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 17:40:22 by adjoly #+# #+# */ +/* Updated: 2023/11/03 12:11:08 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void *ft_memset(void *s, int c, size_t n) +{ + size_t i; + + i = 0; + while (i < n) + { + ((char *)(s))[i] = c; + i++; + } + return (s); +} diff --git a/libft/ft_putchar_fd.c b/libft/ft_putchar_fd.c new file mode 100644 index 0000000..b644921 --- /dev/null +++ b/libft/ft_putchar_fd.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putchar_fd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 11:42:17 by adjoly #+# #+# */ +/* Updated: 2023/11/01 17:15:09 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_putchar_fd(char c, int fd) +{ + write(fd, &c, 1); +} diff --git a/libft/ft_putendl_fd.c b/libft/ft_putendl_fd.c new file mode 100644 index 0000000..00bfae5 --- /dev/null +++ b/libft/ft_putendl_fd.c @@ -0,0 +1,19 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putendl_fd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/09 19:12:00 by adjoly #+# #+# */ +/* Updated: 2023/11/09 19:15:50 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_putendl_fd(char *s, int fd) +{ + ft_putstr_fd(s, fd); + ft_putchar_fd('\n', fd); +} diff --git a/libft/ft_putnbr_fd.c b/libft/ft_putnbr_fd.c new file mode 100644 index 0000000..5c3f7fd --- /dev/null +++ b/libft/ft_putnbr_fd.c @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putnbr_fd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 11:52:46 by adjoly #+# #+# */ +/* Updated: 2023/11/03 19:17:27 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_putnbr_fd(int n, int fd) +{ + unsigned int nbr; + + if (n < 0) + { + write(fd, "-", 1); + nbr = -n; + } + else + nbr = n; + if (nbr < 10) + write(fd, &(char){nbr + '0'}, 1); + else + { + ft_putnbr_fd(nbr / 10, fd); + write(fd, &(char){nbr % 10 + '0'}, 1); + } +} diff --git a/libft/ft_putstr_fd.c b/libft/ft_putstr_fd.c new file mode 100644 index 0000000..2b23b47 --- /dev/null +++ b/libft/ft_putstr_fd.c @@ -0,0 +1,27 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putstr_fd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 11:45:55 by adjoly #+# #+# */ +/* Updated: 2023/11/05 15:06:13 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_putstr_fd(char *s, int fd) +{ + int i; + + i = 0; + if (s == NULL) + return ; + while (s[i]) + { + write(fd, &s[i], 1); + i++; + } +} diff --git a/libft/ft_split.c b/libft/ft_split.c new file mode 100644 index 0000000..1ade67b --- /dev/null +++ b/libft/ft_split.c @@ -0,0 +1,94 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_split.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/12 09:14:19 by adjoly #+# #+# */ +/* Updated: 2023/11/12 16:28:35 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +static int ft_countword(char const *s, char sep) +{ + int i; + int w_count; + + i = 0; + w_count = 0; + while (s[i]) + { + if (s[i] != sep && (i == 0 || s[i - 1] == sep)) + w_count++; + i++; + } + return (w_count); +} + +static int ft_countletter(char const *s, char sep) +{ + int i; + + i = 0; + while (s[i] != sep && s[i] != '\0') + i++; + return (i); +} + +static void *ft_freearr(char **arr) +{ + int i; + + i = 0; + while (arr[i]) + { + free(arr[i]); + i++; + } + free(arr); + return (NULL); +} + +char **ft_split_to_result(char **tab, char const *s, char c) +{ + int i; + int j; + int k; + + i = 0; + j = 0; + while (s[i]) + { + if (s[i] != c) + { + k = 0; + tab[j] = ft_calloc(ft_countletter(&s[i], c) + 1, sizeof(char)); + if (!tab[j]) + return (ft_freearr(tab)); + while (s[i] && s[i] != c) + tab[j][k++] = s [i++]; + tab[j][k] = '\0'; + j++; + } + else + i++; + } + tab[j] = NULL; + return (tab); +} + +char **ft_split(char const *s, char c) +{ + char **result; + + if (s == NULL) + return (NULL); + result = ft_calloc(ft_countword(s, c) + 1, sizeof(char *)); + if (!result) + return (NULL); + result = ft_split_to_result(result, s, c); + return (result); +} diff --git a/libft/ft_strchr.c b/libft/ft_strchr.c new file mode 100644 index 0000000..2016b39 --- /dev/null +++ b/libft/ft_strchr.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strchr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/01 15:45:18 by adjoly #+# #+# */ +/* Updated: 2023/11/09 14:31:55 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +char *ft_strchr(const char *s, int c) +{ + size_t len_s; + char *result; + + len_s = ft_strlen(s); + result = ft_memchr(s, c, len_s); + if (c == 0) + return ((char *)s + len_s); + return (result); +} diff --git a/libft/ft_strdup.c b/libft/ft_strdup.c new file mode 100644 index 0000000..9a9548c --- /dev/null +++ b/libft/ft_strdup.c @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strdup.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/03 22:57:39 by adjoly #+# #+# */ +/* Updated: 2023/11/04 14:40:17 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +char *ft_strdup(const char *s) +{ + int i; + char *result; + int len; + + i = 0; + len = ft_strlen(s); + result = malloc(sizeof(char) * (len + 1)); + if (result == NULL) + return (NULL); + while (s[i]) + { + result[i] = s[i]; + i++; + } + result[i] = '\0'; + return (result); +} diff --git a/libft/ft_striteri.c b/libft/ft_striteri.c new file mode 100644 index 0000000..c807bc2 --- /dev/null +++ b/libft/ft_striteri.c @@ -0,0 +1,27 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_striteri.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 14:15:30 by adjoly #+# #+# */ +/* Updated: 2023/11/12 13:59:23 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_striteri(char *s, void (*f)(unsigned int, char *)) +{ + int i; + + i = 0; + if (s == NULL || f == NULL) + return ; + while (s[i]) + { + f(i, &s[i]); + i++; + } +} diff --git a/libft/ft_strjoin.c b/libft/ft_strjoin.c new file mode 100644 index 0000000..01229c0 --- /dev/null +++ b/libft/ft_strjoin.c @@ -0,0 +1,41 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strjoin.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/04 13:44:09 by adjoly #+# #+# */ +/* Updated: 2023/11/12 16:18:45 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +char *ft_strjoin(char const *s1, char const *s2) +{ + char *result; + size_t i; + size_t j; + + i = 0; + j = 0; + if (s1 == NULL || s2 == NULL) + return (NULL); + result = ft_calloc((ft_strlen(s1) + ft_strlen(s2) + 1), sizeof(char)); + if (result == NULL) + return (NULL); + while (s1[i]) + { + result[i] = s1[i]; + i++; + } + while (s2[j]) + { + result[i] = s2[j]; + i++; + j++; + } + result[i] = '\0'; + return (result); +} diff --git a/libft/ft_strlcat.c b/libft/ft_strlcat.c new file mode 100644 index 0000000..d211d89 --- /dev/null +++ b/libft/ft_strlcat.c @@ -0,0 +1,38 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strlcat.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/03 15:59:31 by adjoly #+# #+# */ +/* Updated: 2023/11/05 10:39:34 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +size_t ft_strlcat(char *dst, const char *src, size_t size) +{ + size_t i; + size_t j; + size_t len_dst; + size_t len_src; + + if (dst == NULL && size == 0) + return (0); + i = 0; + j = ft_strlen(dst); + len_src = ft_strlen(src); + len_dst = ft_strlen(dst); + if (size <= j) + return (len_src + size); + while (j < size - 1 && src[i]) + { + dst[j] = src[i]; + i++; + j++; + } + dst[j] = '\0'; + return (len_src + len_dst); +} diff --git a/libft/ft_strlcpy.c b/libft/ft_strlcpy.c new file mode 100644 index 0000000..bef78a1 --- /dev/null +++ b/libft/ft_strlcpy.c @@ -0,0 +1,30 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strlcpy.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/01 09:52:45 by adjoly #+# #+# */ +/* Updated: 2023/11/03 22:46:49 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +size_t ft_strlcpy(char *dst, const char *src, size_t size) +{ + size_t i; + + i = 0; + if (size == 0) + return (ft_strlen(src)); + while (i < size - 1 && src[i]) + { + dst[i] = src[i]; + i++; + } + if (i < size) + dst[i] = '\0'; + return (ft_strlen(src)); +} diff --git a/libft/ft_strlen.c b/libft/ft_strlen.c new file mode 100644 index 0000000..5ccf0b8 --- /dev/null +++ b/libft/ft_strlen.c @@ -0,0 +1,23 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strlen.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/30 18:15:57 by adjoly #+# #+# */ +/* Updated: 2023/11/01 17:15:12 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +size_t ft_strlen(const char *s) +{ + int i; + + i = 0; + while (s[i]) + i++; + return (i); +} diff --git a/libft/ft_strmapi.c b/libft/ft_strmapi.c new file mode 100644 index 0000000..d2e4be5 --- /dev/null +++ b/libft/ft_strmapi.c @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strmapi.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 11:44:24 by adjoly #+# #+# */ +/* Updated: 2023/11/13 16:14:32 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +char *ft_strmapi(char const *s, char (*f)(unsigned int, char)) +{ + int i; + char *res; + + i = 0; + if (!s || !f) + return (NULL); + res = ft_calloc((ft_strlen(s) + 1), sizeof(char)); + if (res == NULL) + return (NULL); + while (s[i]) + { + res[i] = f(i, s[i]); + i++; + } + res[i] = '\0'; + return (res); +} diff --git a/libft/ft_strncmp.c b/libft/ft_strncmp.c new file mode 100644 index 0000000..71eaf9b --- /dev/null +++ b/libft/ft_strncmp.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strncmp.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/05 10:40:45 by adjoly #+# #+# */ +/* Updated: 2023/11/06 14:53:38 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +int ft_strncmp(const char *s1, const char *s2, size_t n) +{ + size_t i; + + i = 0; + if (n == 0) + return (0); + while (s1[i] == s2[i] && s1[i] && i < n - 1) + i++; + return ((unsigned char)s1[i] - (unsigned char)s2[i]); +} diff --git a/libft/ft_strnstr.c b/libft/ft_strnstr.c new file mode 100644 index 0000000..7028671 --- /dev/null +++ b/libft/ft_strnstr.c @@ -0,0 +1,35 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strnstr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/08 16:02:17 by adjoly #+# #+# */ +/* Updated: 2023/11/12 16:17:28 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +char *ft_strnstr(const char *big, const char *little, size_t len) +{ + size_t i; + size_t j; + + i = 0; + if (!big && len == 0) + return (NULL); + if (*little == '\0' || little == big) + return ((char *)big); + while (i < len && big[i]) + { + j = 0; + while (big[i + j] == little[j] && little[j] && big[i] && i + j < len) + j++; + if (little[j] == 0) + return ((char *)big + i); + i++; + } + return (NULL); +} diff --git a/libft/ft_strrchr.c b/libft/ft_strrchr.c new file mode 100644 index 0000000..d77e573 --- /dev/null +++ b/libft/ft_strrchr.c @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strrchr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/08 14:44:26 by adjoly #+# #+# */ +/* Updated: 2023/11/08 15:21:28 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +char *ft_strrchr(const char *s, int c) +{ + size_t i; + size_t len_s; + + len_s = ft_strlen(s); + i = len_s; + if (c == 0) + return (&((char *)s)[len_s]); + while (i > 0) + { + if (s[i] == (char)c) + return (&((char *)s)[i]); + i--; + } + if (s[0] == (char)c) + return (&((char *)s)[0]); + return (NULL); +} diff --git a/libft/ft_strtrim.c b/libft/ft_strtrim.c new file mode 100644 index 0000000..f567d4b --- /dev/null +++ b/libft/ft_strtrim.c @@ -0,0 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strtrim.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/11 00:37:37 by adjoly #+# #+# */ +/* Updated: 2023/11/11 01:09:36 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +char *ft_strtrim(char const *s1, char const *set) +{ + int i; + int j; + char *result; + + i = 0; + if (s1 == NULL || set == NULL) + return (NULL); + j = ft_strlen(s1); + while (ft_strchr(set, s1[i]) != 0) + i++; + while (ft_strrchr(set, s1[j]) != 0) + j--; + result = ft_substr(s1, i, (j - i) + 1); + return (result); +} diff --git a/libft/ft_substr.c b/libft/ft_substr.c new file mode 100644 index 0000000..f473fe4 --- /dev/null +++ b/libft/ft_substr.c @@ -0,0 +1,37 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_substr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/02 17:59:58 by adjoly #+# #+# */ +/* Updated: 2023/11/13 16:22:26 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +char *ft_substr(char const *s, unsigned int start, size_t len) +{ + size_t i; + char *result; + + i = 0; + if (s == NULL) + return (0); + if (len >= ft_strlen(s)) + len = ft_strlen(s) - start; + if (len == 0 || start >= ft_strlen(s)) + return (ft_calloc(1, 1)); + result = malloc((len + 1) * sizeof(char)); + if (result == NULL) + return (NULL); + while (i < len && s[start + i]) + { + result[i] = s[start + i]; + i++; + } + result[i] = '\0'; + return (result); +} diff --git a/libft/ft_tolower.c b/libft/ft_tolower.c new file mode 100644 index 0000000..56bb63e --- /dev/null +++ b/libft/ft_tolower.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_tolower.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 17:15:28 by adjoly #+# #+# */ +/* Updated: 2023/10/31 17:26:10 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int ft_tolower(int c) +{ + if (c >= 'A' && c <= 'Z') + return (c + 32); + return (c); +} diff --git a/libft/ft_toupper.c b/libft/ft_toupper.c new file mode 100644 index 0000000..5066e55 --- /dev/null +++ b/libft/ft_toupper.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_toupper.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 17:15:28 by adjoly #+# #+# */ +/* Updated: 2023/10/31 17:26:15 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int ft_toupper(int c) +{ + if (c >= 'a' && c <= 'z') + return (c - 32); + return (c); +} diff --git a/libft/libft.h b/libft/libft.h new file mode 100644 index 0000000..5d540b8 --- /dev/null +++ b/libft/libft.h @@ -0,0 +1,73 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* libft.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/01 10:06:03 by adjoly #+# #+# */ +/* Updated: 2023/11/11 18:37:56 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef LIBFT_H +# define LIBFT_H + +# include +# include +# include + +typedef struct s_list +{ + void *content; + struct s_list *next; +} t_list; + +int ft_atoi(const char *nptr); +void *ft_calloc(size_t nmemb, size_t size); +int ft_isalnum(int c); +int ft_isalpha(int c); +int ft_isascii(int c); +int ft_isdigit(int c); +void ft_bzero(void *s, size_t n); +void *ft_memset(void *s, int c, size_t n); +void *ft_memmove(void *dest, const void *src, size_t n); +void *ft_memcpy(void *dest, const void *src, size_t n); +void ft_putchar_fd(char c, int fd); +void ft_putnbr_fd(int n, int fd); +char *ft_strdup(const char *s); +void ft_putstr_fd(char *s, int fd); +char *ft_strchr(const char *s, int c); +size_t ft_strlcpy(char *dst, const char *src, size_t size); +size_t ft_strlen(const char *s); +char *ft_substr(char const *s, unsigned int start, size_t len); +int ft_tolower(int c); +int ft_toupper(int c); +size_t ft_strlcat(char *dst, const char *src, size_t size); +char *ft_strjoin(char const *s1, char const *s2); +int ft_strncmp(const char *s1, const char *s2, size_t n); +int ft_isprint(int c); +void *ft_memchr(const void *s, int c, size_t n); +char *ft_itoa(int n); +void *ft_memmove(void *dest, const void *src, size_t n); +void *ft_memchr(const void *s, int c, size_t n); +int ft_memcmp(const void *s1, const void *s2, size_t n); +char *ft_strrchr(const char *s, int c); +char *ft_strnstr(const char *big, const char *little, size_t len); +void ft_putendl_fd(char *s, int fd); +char *ft_strtrim(char const *s1, char const *set); +char **ft_split(char const *s, char c); +char *ft_strmapi(char const *s, char (*f)(unsigned int, char)); +void ft_striteri(char *s, void (*f)(unsigned int, char *)); + +t_list *ft_lstnew(void *content); +void ft_lstadd_front(t_list **lst, t_list *new); +int ft_lstsize(t_list *lst); +t_list *ft_lstlast(t_list *lst); +void ft_lstadd_back(t_list **lst, t_list *new); +void ft_lstdelone(t_list *lst, void (*del)(void *)); +void ft_lstclear(t_list **lst, void (*del)(void *)); +void ft_lstiter(t_list *lst, void (*f)(void *)); +t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *)); + +#endif \ No newline at end of file diff --git a/main.o b/main.o deleted file mode 100644 index 15d3014..0000000 Binary files a/main.o and /dev/null differ diff --git a/print_map.o b/print_map.o deleted file mode 100644 index 5536727..0000000 Binary files a/print_map.o and /dev/null differ diff --git a/printf b/printf deleted file mode 160000 index 71ce8f7..0000000 --- a/printf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 71ce8f741dae4b145a4d5cb2bf74de651c859100 diff --git a/printf/Makefile b/printf/Makefile new file mode 100644 index 0000000..65fa8b2 --- /dev/null +++ b/printf/Makefile @@ -0,0 +1,46 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: adjoly +#+ +:+ +#+ # +# +#+#+#+#+#+ +#+ # +# Created: 2023/11/17 12:35:27 by adjoly #+# #+# # +# Updated: 2023/11/20 15:55:52 by adjoly ### ########.fr # +# # +# **************************************************************************** # + +NAME = libftprintf.a + +CC = cc + +SRCS = ft_printf.c \ + ft_putchar.c \ + ft_putnbr.c \ + ft_putnbrbase.c \ + ft_putstr.c \ + ft_strlen.c \ + +OBJS = $(SRCS:.c=.o) + +FLAGS = -Werror -Wall -Wextra + +HEADER = libftprintf.h + +$(NAME): $(OBJS) + ar -rcs $(NAME) $(OBJS) + +%.o: %.c + $(CC) $(FLAGS) -I $(HEADER) $< -c -o $@ + +all: $(NAME) + +clean: + rm -f $(OBJS) + +fclean: clean + rm -f $(NAME) + +re: fclean all + +.PHONY: clean all re fclean \ No newline at end of file diff --git a/printf/ft_printf.c b/printf/ft_printf.c new file mode 100644 index 0000000..7144557 --- /dev/null +++ b/printf/ft_printf.c @@ -0,0 +1,92 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_printf.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/17 16:48:37 by adjoly #+# #+# */ +/* Updated: 2023/12/06 14:27:05 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_printf.h" + +int ft_putaddr(void *ptr) +{ + int r; + + if (ptr == NULL) + return (write(1, "(nil)", 5)); + write(1, "0x", 2); + r = ft_putnbrbase_p((long unsigned int)ptr, "0123456789abcdef"); + return (2 + r); +} + +int ft_putnbrulong(unsigned int n) +{ + int len; + + len = 0; + if (n < 10) + len += write(1, &(char){n + '0'}, 1); + else + { + len += ft_putnbrulong(n / 10); + len += write(1, &(char){n % 10 + '0'}, 1); + } + return (len); +} + +int ft_printconversion(char conversion, va_list args) +{ + int count; + + count = 0; + if (conversion == '%') + count = ft_putchar('%'); + else if (conversion == 's') + count = ft_putstr(va_arg(args, char *)); + else if (conversion == 'c') + count = ft_putchar(va_arg(args, int)); + else if (conversion == 'i' || conversion == 'd') + count = ft_putnbr(va_arg(args, int)); + else if (conversion == 'u') + count = ft_putnbrulong(va_arg(args, unsigned int)); + else if (conversion == 'p') + count = ft_putaddr(va_arg(args, void *)); + else if (conversion == 'x') + count = ft_putnbrbase(va_arg(args, unsigned long), "0123456789abcdef"); + else if (conversion == 'X') + count = ft_putnbrbase(va_arg(args, unsigned long), "0123456789ABCDEF"); + return (count); +} + +int ft_printf(const char *format, ...) +{ + int i; + va_list args; + int count; + + va_start(args, format); + count = 0; + i = 0; + if (format == NULL) + return (-1); + while (format[i]) + { + if (format[i] == '%') + { + i++; + if (format[i]) + count += ft_printconversion(format[i], args); + else + return (-1); + } + else + count += ft_putchar(format[i]); + i++; + } + va_end(args); + return (count); +} diff --git a/printf/ft_printf.h b/printf/ft_printf.h new file mode 100644 index 0000000..fa3cdb7 --- /dev/null +++ b/printf/ft_printf.h @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_printf.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/17 16:50:36 by adjoly #+# #+# */ +/* Updated: 2023/11/22 14:00:38 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef FT_PRINTF_H +# define FT_PRINTF_H + +# include +# include +# include + +int ft_printf(const char *format, ...); +int ft_printconversion(char conversion, va_list args); +int ft_putnbrulong(unsigned int n); +int ft_putaddr(void *ptr); + +int ft_putstr(char *s); + +int ft_putnbrbase_p(unsigned long int n, char *base); +int ft_putnbrbase(unsigned int n, char *base); +int ft_putchar(char c); +int ft_putnbr(int n); +size_t ft_strlen(const char *s); + +#endif \ No newline at end of file diff --git a/printf/ft_putchar.c b/printf/ft_putchar.c new file mode 100644 index 0000000..7436489 --- /dev/null +++ b/printf/ft_putchar.c @@ -0,0 +1,19 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putchar.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/18 10:49:00 by adjoly #+# #+# */ +/* Updated: 2023/11/22 11:07:22 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_printf.h" + +int ft_putchar(char c) +{ + write(1, &c, 1); + return (1); +} diff --git a/printf/ft_putnbr.c b/printf/ft_putnbr.c new file mode 100644 index 0000000..cf709ff --- /dev/null +++ b/printf/ft_putnbr.c @@ -0,0 +1,36 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putnbr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 11:52:46 by adjoly #+# #+# */ +/* Updated: 2023/11/22 10:51:24 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_printf.h" + +int ft_putnbr(int n) +{ + unsigned int nbr; + int len; + + len = 0; + if (n < 0) + { + len += write(1, "-", 1); + nbr = -n; + } + else + nbr = n; + if (nbr < 10) + len += write(1, &(char){nbr + '0'}, 1); + else + { + len += ft_putnbr(nbr / 10); + len += write(1, &(char){nbr % 10 + '0'}, 1); + } + return (len); +} diff --git a/printf/ft_putnbrbase.c b/printf/ft_putnbrbase.c new file mode 100644 index 0000000..1866219 --- /dev/null +++ b/printf/ft_putnbrbase.c @@ -0,0 +1,47 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putnbrbase.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/18 10:57:44 by adjoly #+# #+# */ +/* Updated: 2023/11/22 14:02:37 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_printf.h" + +int ft_putnbrbase(unsigned int n, char *base) +{ + unsigned int base_len; + int len; + + len = 0; + base_len = (int)ft_strlen(base); + if (n < base_len) + len += write(1, &base[n % base_len], 1); + else + { + len += ft_putnbrbase(n / base_len, base); + len += write(1, &base[n % base_len], 1); + } + return (len); +} + +int ft_putnbrbase_p(unsigned long int n, char *base) +{ + unsigned long int base_len; + int len; + + len = 0; + base_len = (int)ft_strlen(base); + if (n < base_len) + len += write(1, &base[n % base_len], 1); + else + { + len += ft_putnbrbase_p(n / base_len, base); + len += write(1, &base[n % base_len], 1); + } + return (len); +} diff --git a/printf/ft_putstr.c b/printf/ft_putstr.c new file mode 100644 index 0000000..297a2e5 --- /dev/null +++ b/printf/ft_putstr.c @@ -0,0 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putstr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/31 11:45:55 by adjoly #+# #+# */ +/* Updated: 2023/12/06 15:51:38 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_printf.h" + +int ft_putstr(char *s) +{ + int i; + + i = 0; + if (s == NULL) + { + write(1, "(null)", 6); + return (6); + } + while (s[i]) + { + write(1, &s[i], 1); + i++; + } + return (i); +} diff --git a/printf/ft_strlen.c b/printf/ft_strlen.c new file mode 100644 index 0000000..ce68f8d --- /dev/null +++ b/printf/ft_strlen.c @@ -0,0 +1,23 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strlen.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/30 18:15:57 by adjoly #+# #+# */ +/* Updated: 2023/11/20 15:51:51 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_printf.h" + +size_t ft_strlen(const char *s) +{ + int i; + + i = 0; + while (s[i]) + i++; + return (i); +} diff --git a/so_long b/so_long deleted file mode 100755 index 7a08e25..0000000 Binary files a/so_long and /dev/null differ