diff --git a/.DS_Store b/.DS_Store index bb66350..0c4d79b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 666c675..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,120 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(MixProject) - -# Set the C++ standard -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED True) - -# Add the executable for 'mix.cpp' -add_executable(mix2 src/mix2.cpp) - -# Remove this line so the executable is generated in the same directory as CMakeLists.txt -# set_target_properties(mix PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build") - -# Add a custom target to remove the old 'mix' executable if it exists -add_custom_target(clean_mix2 ALL - COMMAND rm -rf ${CMAKE_SOURCE_DIR}/mix2 - COMMENT "Removing old mix2 executable if it exists" -) - -# Ensure that 'clean_mix' runs before building the 'mix' executable -add_dependencies(mix2 clean_mix2) - -# Enable testing -enable_testing() - -# List of flow files in the 'files' folder and their corresponding actions -set(FLOW_FILES - files/flow1.flow - files/flow2.flow - files/flow3.flow - files/flow4.flow - files/flow5.flow - files/flow8.flow - files/flow9.flow - files/flow10.flow - files/flow11.flow - files/flow12.flow - files/flow14.flow - files/flow13.flow -) - -set(ACTION_NAMES - doit - shenanigan - doit - doit - pipe3 - concat1 - concat_echoes - concat_ultimate - unique_numbers - catch_errors - process_pipe - process_pipe -) - -set(EXPECTED_COMMANDS - "ls | wc" # flow1.flow - "(cat ${CMAKE_SOURCE_DIR}/files/foo.txt \; cat ${CMAKE_SOURCE_DIR}/files/foo.txt | sed 's/o/u/g') | wc" # flow2.flow - "ls -l | ls" # flow3.flow - "ls \; ls -l" # flow4.flow - "ls | grep '.cpp' | wc" # flow5.flow - "ls \; ls" # flow8.flow - "echo 'f o o' \; echo 'f o o' \; echo 'f o o' \; echo 'f o o' \; echo 'f o o'" # flow9.flow - "echo 'Command One Executed.' \; echo 'Command One Executed.' \; echo 'Command Two Executed.' \; echo 'Command Three Executed.' \; echo 'Command Four Executed.' \; echo 'Command Four Executed.' \; echo 'Command One Executed.' \; echo 'Command Two Executed.'" # flow10.flow - "(seq 1 5 | awk '{print \$1*\$1}' \; seq 1 5 | awk '{print \$1*2}' \; seq 1 5 | awk '{print \$1+5}') | sort -n | uniq" # flow11.flow - "mkdir a 2>&1 | wc" # flow12.flow - "ls > output.txt" # flow14.flow - "cat output.txt | wc" # flow13.flow -) - -# Ensure the lengths of the lists match -list(LENGTH FLOW_FILES num_flow_files) -list(LENGTH ACTION_NAMES num_actions) -list(LENGTH EXPECTED_COMMANDS num_expected_commands) - -message(STATUS "Number of flow files: ${num_flow_files}") -message(STATUS "Number of actions: ${num_actions}") -message(STATUS "Number of expected commands: ${num_expected_commands}") - -if(NOT num_flow_files EQUAL num_actions OR NOT num_flow_files EQUAL num_expected_commands) - message(FATAL_ERROR "FLOW_FILES, ACTION_NAMES, and EXPECTED_COMMANDS must have the same number of elements.") -endif() - -# Loop over the flow files and define a test for each -math(EXPR num_tests "${num_flow_files} - 1") - -foreach(i RANGE 0 ${num_tests}) - list(GET FLOW_FILES ${i} flow_file) - list(GET ACTION_NAMES ${i} action_name) - list(GET EXPECTED_COMMANDS ${i} expected_command) - - # Define the test name - string(REPLACE "." "_" flow_file_safe ${flow_file}) - set(test_name "Test_${flow_file_safe}") - - # Define output files - set(actual_output "${test_name}_actual_output.txt") - set(expected_output "${test_name}_expected_output.txt") - - # Add the test - add_test(NAME ${test_name} - COMMAND bash -c " - echo '=== Running ${test_name} ==='; - echo 'Running mix with ${flow_file}:'; - ${CMAKE_SOURCE_DIR}/mix ${flow_file} ${action_name} > ${actual_output}; - echo 'Expected output from command:'; - ${expected_command} > ${expected_output}; - echo '--- Actual Output ---'; - cat ${actual_output}; - echo '--- Expected Output ---'; - cat ${expected_output}; - " - ) - - # Set test properties to display output - set_tests_properties(${test_name} PROPERTIES - PASS_REGULAR_EXPRESSION ".*" - ) -endforeach() \ No newline at end of file diff --git a/README.md b/README.md index bcd8c92..0e00553 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,143 @@ -# OS_HW_2 -Operating System Homework 2 +# FlowControl: Command Sequence Execution Framework -flow5 can parse pipes normally. -flow6 can 2 nodes and 1node,1pipe -flow7 improved but same. -flow8 hadles concatenation. -mix mix. +## Overview +FlowControl is a C++ framework designed for interpreting and executing sequences of commands described in `.flow` files. This framework simulates shell command execution, including complex piping, redirection, and concatenation, tailored for Unix-like systems. It's an ideal tool for automating and testing command line operations, making it highly useful for developers and system administrators. +## Features -Test Cases -0: just one node in any .flow file +- **Command Execution**: Directly execute Unix commands through structured scripts. +- **Piping and Redirections**: Supports complex piping (`|`) and redirections (`>`, `2>&1`). +- **Concatenations**: Execute commands in sequence using concatenation (`;`). +- **File Output Handling**: Direct command outputs to files for logging and further processing. +- **Error Handling**: Advanced error redirection and handling for robust script testing. +- **Automated Testing**: Includes a Python script for automated testing against expected outputs. -1: ls | wc // normal pipe -2: ls -l | wc // if - arguments can be handled properly -3: ls -l | ls // if pipe can be used for a "to" argument that doesnt take inputs -4: echo foo | wc // no quotes for argument -4: echo 'foo2' | cat // single quotes -5: echo "foo1" | wc // double quotes -6: echo 'f o o' | wc // quotes with space +## Installation -7: ls ; pwd // normal concat -8: ls; ls ; ls -a // concat with more than 2 parts and also arguments -9: echo foo1 ; echo 'foo2' ; echo "foo3" ; echo 'f o o 4' // no quotes ; double ; single ; spaces +Ensure you have GCC (supporting C++11 or later) and Python 3.x installed. Clone the repository and compile the source: -10: ls | wc ; pwd // mix -11: ( cat foo.txt ; cat foo.txt | sed s/o/u/g ) | wc // complicated mix +```bash +git clone https://yourrepositorylink.com/FlowControl.git +cd FlowControl +g++ -std=c++11 flow.cpp -o flow +``` -12: ( seq 1 5 | awk '{print $1*$1}'; seq 1 5 | awk '{print $1*2}'; seq 1 5 | awk '{print $1+5}' ) | sort -n | uniq -// extra credit - chatgpt - complicated with quotes, arguments, everything +## Usage Guide -13: cd b 2>&1 // b would not exist in the directory -14: mkdir a 2>&1 | wc +`.flow` files dictate the operations within the framework. Here’s how to structure these files: -15: ls > output.txt -16: cat output.txt | wc \ No newline at end of file +### Basic Command Node + +Defines a single command operation. + +```plaintext +node=ls_node +command=ls -l +``` + +### Piping Output + +Directs the output of one command to another. + +```plaintext +node=echo_node +command=echo "Hello World" + +node=wc_node +command=wc -w + +pipe=echo_to_wc +from=echo_node +to=wc_node +``` + +### Concatenating Commands + +Executes multiple commands in sequence. + +```plaintext +node=date_node +command=date + +node=whoami_node +command=whoami + +concatenate=system_info +parts=2 +part_0=date_node +part_1=whoami_node +``` + +### Error Handling Example + +Redirects error output to another command. + +```plaintext +node=mkdir_attempt +command=mkdir existing_dir + +stderr=stdout_to_stderr_for_mkdir +from=mkdir_attempt + +pipe=catch_errors +from=stdout_to_stderr_for_mkdir +to=word_count_node +``` + +### File Output Handling + +Captures the output of a command and writes it to a file. + +```plaintext +node=list_files +command=ls + +file=output_file +name=output.txt + +pipe=process_pipe +from=list_files +to=output_file +``` + +## Testing Framework + +Run `python3 run.py` to test all `.flow` files in the `files` directory. This script compiles the program, runs tests, and saves results to `TestResult_{DateTime}.txt`. + +## Different Cases + +- **Case 0**: A single command node. +- **Case 1**: Command output redirection to a file. +- **Case 2**: Piping commands. +- **Case 3**: Concatenating commands. +- **Case 4**: Error handling. +- **Case 5**: File input/output handling. +- **Case 6**: Complex command sequences. + +## To test: + +1. Download and extract this repository. +2. Run `python3 run.py` +3. Open `TestResult_{current_time}.txt` for more information. + +### Test Cases + +- **0**: just one node in any `.flow` file +- **1**: `ls | wc` // normal pipe +- **2**: `ls -l | wc` // if `-` arguments can be handled properly +- **3**: `ls -l | ls` // if pipe can be used for a "to" argument that doesn't take inputs +- **4**: `echo foo | cat` // no quotes for argument +- **5**: `echo 'foo' | cat` // single quotes +- **6**: `echo "foo" | cat` // double quotes +- **7**: `echo 'f o o' | cat` // quotes with space +- **8**: `ls ; pwd` // normal concat +- **9**: `ls; ls ; ls -a` // concat with more than 2 parts and also arguments +- **10**: `echo foo1 ; echo 'foo2' ; echo "foo3" ; echo 'f o o 4'` // no quotes; double; single; spaces +- **11**: `ls | wc ; pwd` // mix +- **12**: `( cat foo.txt ; cat foo.txt | sed s/o/u/g ) | wc` // complicated mix +- **13**: `( seq 1 5 | awk '{print $1*$1}'; seq 1 5 | awk '{print $1*2}'; seq 1 5 | awk '{print $1+5}' ) | sort -n | uniq` // extra credit - chatgpt - complicated with quotes, arguments, everything +- **14**: `mkdir a 2>&1` // b would not exist in the directory (calling stderr as action directly) +- **15**: `mldir a 2>&1 | wc` // calling non-stderr as action +- **16**: `ls > output.txt` +- **17**: `cat output.txt | wc` \ No newline at end of file diff --git a/build/.DS_Store b/build/.DS_Store deleted file mode 100644 index bbeee3b..0000000 Binary files a/build/.DS_Store and /dev/null differ diff --git a/build/CMakeCache.txt b/build/CMakeCache.txt deleted file mode 100644 index 32d71ec..0000000 --- a/build/CMakeCache.txt +++ /dev/null @@ -1,369 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /Users/reetnandy/vscode/OS_HW_2/build -# It was generated by CMake: /usr/local/Cellar/cmake/3.30.5/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Path to a program. -CMAKE_ADDR2LINE:FILEPATH=CMAKE_ADDR2LINE-NOTFOUND - -//Path to a program. -CMAKE_AR:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/ar - -//Choose the type of build, options are: None Debug Release RelWithDebInfo -// MinSizeRel ... -CMAKE_BUILD_TYPE:STRING= - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//CXX compiler -CMAKE_CXX_COMPILER:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/c++ - -//Flags used by the CXX compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the CXX compiler during DEBUG builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the CXX compiler during MINSIZEREL builds. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the CXX compiler during RELEASE builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the CXX compiler during RELWITHDEBINFO builds. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//C compiler -CMAKE_C_COMPILER:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/cc - -//Flags used by the C compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the C compiler during DEBUG builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the C compiler during MINSIZEREL builds. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the C compiler during RELEASE builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the C compiler during RELWITHDEBINFO builds. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Path to a program. -CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND - -//Flags used by the linker during all build types. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during DEBUG builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during MINSIZEREL builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during RELEASE builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during RELWITHDEBINFO builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= - -//Value Computed by CMake. -CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/pkgRedirects - -//Path to a program. -CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make - -//Flags used by the linker during the creation of modules during -// all build types. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of modules during -// DEBUG builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of modules during -// MINSIZEREL builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of modules during -// RELEASE builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of modules during -// RELWITHDEBINFO builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/objdump - -//Build architectures for OSX -CMAKE_OSX_ARCHITECTURES:STRING= - -//Minimum OS X version to target for deployment (at runtime); newer -// APIs weak linked. Set to empty string for default value. -CMAKE_OSX_DEPLOYMENT_TARGET:STRING= - -//The product will be built against the headers and libraries located -// inside the indicated SDK. -CMAKE_OSX_SYSROOT:PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk - -//Value Computed by CMake -CMAKE_PROJECT_DESCRIPTION:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_HOMEPAGE_URL:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=MixProject - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/ranlib - -//Path to a program. -CMAKE_READELF:FILEPATH=CMAKE_READELF-NOTFOUND - -//Flags used by the linker during the creation of shared libraries -// during all build types. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of shared libraries -// during DEBUG builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of shared libraries -// during MINSIZEREL builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELEASE builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELWITHDEBINFO builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries -// during all build types. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of static libraries -// during DEBUG builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of static libraries -// during MINSIZEREL builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELEASE builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELWITHDEBINFO builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/strip - -//Path to a program. -CMAKE_TAPI:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/tapi - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Value Computed by CMake -MixProject_BINARY_DIR:STATIC=/Users/reetnandy/vscode/OS_HW_2/build - -//Value Computed by CMake -MixProject_IS_TOP_LEVEL:STATIC=ON - -//Value Computed by CMake -MixProject_SOURCE_DIR:STATIC=/Users/reetnandy/vscode/OS_HW_2 - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_ADDR2LINE -CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/Users/reetnandy/vscode/OS_HW_2/build -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=30 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=5 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.30.5/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.30.5/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.30.5/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_DLLTOOL -CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 -//Path to cache edit program executable. -CMAKE_EDIT_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.30.5/bin/ccmake -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=MACHO -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Generator instance identifier. -CMAKE_GENERATOR_INSTANCE:INTERNAL= -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/Users/reetnandy/vscode/OS_HW_2 -//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL -CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//Platform information initialized -CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_READELF -CMAKE_READELF-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/usr/local/Cellar/cmake/3.30.5/share/cmake -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_TAPI -CMAKE_TAPI-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/usr/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 - diff --git a/build/CMakeFiles/3.30.5/CMakeCCompiler.cmake b/build/CMakeFiles/3.30.5/CMakeCCompiler.cmake deleted file mode 100644 index 61c489c..0000000 --- a/build/CMakeFiles/3.30.5/CMakeCCompiler.cmake +++ /dev/null @@ -1,81 +0,0 @@ -set(CMAKE_C_COMPILER "/Library/Developer/CommandLineTools/usr/bin/cc") -set(CMAKE_C_COMPILER_ARG1 "") -set(CMAKE_C_COMPILER_ID "AppleClang") -set(CMAKE_C_COMPILER_VERSION "16.0.0.16000026") -set(CMAKE_C_COMPILER_VERSION_INTERNAL "") -set(CMAKE_C_COMPILER_WRAPPER "") -set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") -set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") -set(CMAKE_C_STANDARD_LATEST "23") -set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") -set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") -set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") -set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") -set(CMAKE_C17_COMPILE_FEATURES "c_std_17") -set(CMAKE_C23_COMPILE_FEATURES "c_std_23") - -set(CMAKE_C_PLATFORM_ID "Darwin") -set(CMAKE_C_SIMULATE_ID "") -set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU") -set(CMAKE_C_SIMULATE_VERSION "") - - - - -set(CMAKE_AR "/Library/Developer/CommandLineTools/usr/bin/ar") -set(CMAKE_C_COMPILER_AR "") -set(CMAKE_RANLIB "/Library/Developer/CommandLineTools/usr/bin/ranlib") -set(CMAKE_C_COMPILER_RANLIB "") -set(CMAKE_LINKER "/Library/Developer/CommandLineTools/usr/bin/ld") -set(CMAKE_LINKER_LINK "") -set(CMAKE_LINKER_LLD "") -set(CMAKE_C_COMPILER_LINKER "/Library/Developer/CommandLineTools/usr/bin/ld") -set(CMAKE_C_COMPILER_LINKER_ID "AppleClang") -set(CMAKE_C_COMPILER_LINKER_VERSION 1115.7.3) -set(CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT GNU) -set(CMAKE_MT "") -set(CMAKE_TAPI "/Library/Developer/CommandLineTools/usr/bin/tapi") -set(CMAKE_COMPILER_IS_GNUCC ) -set(CMAKE_C_COMPILER_LOADED 1) -set(CMAKE_C_COMPILER_WORKS TRUE) -set(CMAKE_C_ABI_COMPILED TRUE) - -set(CMAKE_C_COMPILER_ENV_VAR "CC") - -set(CMAKE_C_COMPILER_ID_RUN 1) -set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) -set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_C_LINKER_PREFERENCE 10) -set(CMAKE_C_LINKER_DEPFILE_SUPPORTED FALSE) - -# Save compiler ABI information. -set(CMAKE_C_SIZEOF_DATA_PTR "8") -set(CMAKE_C_COMPILER_ABI "") -set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") -set(CMAKE_C_LIBRARY_ARCHITECTURE "") - -if(CMAKE_C_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_C_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") -endif() - -if(CMAKE_C_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/Library/Developer/CommandLineTools/usr/lib/clang/16/include;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include;/Library/Developer/CommandLineTools/usr/include") -set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") -set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift") -set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks") diff --git a/build/CMakeFiles/3.30.5/CMakeCXXCompiler.cmake b/build/CMakeFiles/3.30.5/CMakeCXXCompiler.cmake deleted file mode 100644 index 48fd878..0000000 --- a/build/CMakeFiles/3.30.5/CMakeCXXCompiler.cmake +++ /dev/null @@ -1,101 +0,0 @@ -set(CMAKE_CXX_COMPILER "/Library/Developer/CommandLineTools/usr/bin/c++") -set(CMAKE_CXX_COMPILER_ARG1 "") -set(CMAKE_CXX_COMPILER_ID "AppleClang") -set(CMAKE_CXX_COMPILER_VERSION "16.0.0.16000026") -set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") -set(CMAKE_CXX_COMPILER_WRAPPER "") -set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") -set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON") -set(CMAKE_CXX_STANDARD_LATEST "23") -set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23") -set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") -set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") -set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") -set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") -set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") -set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23") -set(CMAKE_CXX26_COMPILE_FEATURES "") - -set(CMAKE_CXX_PLATFORM_ID "Darwin") -set(CMAKE_CXX_SIMULATE_ID "") -set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "GNU") -set(CMAKE_CXX_SIMULATE_VERSION "") - - - - -set(CMAKE_AR "/Library/Developer/CommandLineTools/usr/bin/ar") -set(CMAKE_CXX_COMPILER_AR "") -set(CMAKE_RANLIB "/Library/Developer/CommandLineTools/usr/bin/ranlib") -set(CMAKE_CXX_COMPILER_RANLIB "") -set(CMAKE_LINKER "/Library/Developer/CommandLineTools/usr/bin/ld") -set(CMAKE_LINKER_LINK "") -set(CMAKE_LINKER_LLD "") -set(CMAKE_CXX_COMPILER_LINKER "/Library/Developer/CommandLineTools/usr/bin/ld") -set(CMAKE_CXX_COMPILER_LINKER_ID "AppleClang") -set(CMAKE_CXX_COMPILER_LINKER_VERSION 1115.7.3) -set(CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT GNU) -set(CMAKE_MT "") -set(CMAKE_TAPI "/Library/Developer/CommandLineTools/usr/bin/tapi") -set(CMAKE_COMPILER_IS_GNUCXX ) -set(CMAKE_CXX_COMPILER_LOADED 1) -set(CMAKE_CXX_COMPILER_WORKS TRUE) -set(CMAKE_CXX_ABI_COMPILED TRUE) - -set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") - -set(CMAKE_CXX_COMPILER_ID_RUN 1) -set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m) -set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) - -foreach (lang IN ITEMS C OBJC OBJCXX) - if (CMAKE_${lang}_COMPILER_ID_RUN) - foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) - list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) - endforeach() - endif() -endforeach() - -set(CMAKE_CXX_LINKER_PREFERENCE 30) -set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) -set(CMAKE_CXX_LINKER_DEPFILE_SUPPORTED FALSE) - -# Save compiler ABI information. -set(CMAKE_CXX_SIZEOF_DATA_PTR "8") -set(CMAKE_CXX_COMPILER_ABI "") -set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") -set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") - -if(CMAKE_CXX_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_CXX_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") -endif() - -if(CMAKE_CXX_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1;/Library/Developer/CommandLineTools/usr/lib/clang/16/include;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include;/Library/Developer/CommandLineTools/usr/include") -set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++") -set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift") -set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks") -set(CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR "") - -set(CMAKE_CXX_COMPILER_IMPORT_STD "") -### Imported target for C++23 standard library -set(CMAKE_CXX23_COMPILER_IMPORT_STD_NOT_FOUND_MESSAGE "Unsupported generator: Unix Makefiles") - - - diff --git a/build/CMakeFiles/3.30.5/CMakeDetermineCompilerABI_C.bin b/build/CMakeFiles/3.30.5/CMakeDetermineCompilerABI_C.bin deleted file mode 100755 index 2f93037..0000000 Binary files a/build/CMakeFiles/3.30.5/CMakeDetermineCompilerABI_C.bin and /dev/null differ diff --git a/build/CMakeFiles/3.30.5/CMakeDetermineCompilerABI_CXX.bin b/build/CMakeFiles/3.30.5/CMakeDetermineCompilerABI_CXX.bin deleted file mode 100755 index edcb501..0000000 Binary files a/build/CMakeFiles/3.30.5/CMakeDetermineCompilerABI_CXX.bin and /dev/null differ diff --git a/build/CMakeFiles/3.30.5/CMakeSystem.cmake b/build/CMakeFiles/3.30.5/CMakeSystem.cmake deleted file mode 100644 index 5e9d114..0000000 --- a/build/CMakeFiles/3.30.5/CMakeSystem.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(CMAKE_HOST_SYSTEM "Darwin-24.0.0") -set(CMAKE_HOST_SYSTEM_NAME "Darwin") -set(CMAKE_HOST_SYSTEM_VERSION "24.0.0") -set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") - - - -set(CMAKE_SYSTEM "Darwin-24.0.0") -set(CMAKE_SYSTEM_NAME "Darwin") -set(CMAKE_SYSTEM_VERSION "24.0.0") -set(CMAKE_SYSTEM_PROCESSOR "x86_64") - -set(CMAKE_CROSSCOMPILING "FALSE") - -set(CMAKE_SYSTEM_LOADED 1) diff --git a/build/CMakeFiles/3.30.5/CompilerIdC/CMakeCCompilerId.c b/build/CMakeFiles/3.30.5/CompilerIdC/CMakeCCompilerId.c deleted file mode 100644 index 8d8bb03..0000000 --- a/build/CMakeFiles/3.30.5/CompilerIdC/CMakeCCompilerId.c +++ /dev/null @@ -1,904 +0,0 @@ -#ifdef __cplusplus -# error "A C++ compiler has been selected for C." -#endif - -#if defined(__18CXX) -# define ID_VOID_MAIN -#endif -#if defined(__CLASSIC_C__) -/* cv-qualifiers did not exist in K&R C */ -# define const -# define volatile -#endif - -#if !defined(__has_include) -/* If the compiler does not have __has_include, pretend the answer is - always no. */ -# define __has_include(x) 0 -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, - except that a few beta releases use the old format with V=2021. */ -# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) - /* The third version component from --version is an update index, - but no macro is provided for it. */ -# define COMPILER_VERSION_PATCH DEC(0) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) -# define COMPILER_ID "IntelLLVM" -#if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -#endif -#if defined(__GNUC__) -# define SIMULATE_ID "GNU" -#endif -/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and - * later. Look for 6 digit vs. 8 digit version number to decide encoding. - * VVVV is no smaller than the current year when a version is released. - */ -#if __INTEL_LLVM_COMPILER < 1000000L -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) -#else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) -#endif -#if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -#endif -#if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -#elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -#endif -#if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -#endif -#if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -#endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_C) -# define COMPILER_ID "SunPro" -# if __SUNPRO_C >= 0x5100 - /* __SUNPRO_C = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# endif - -#elif defined(__HP_cc) -# define COMPILER_ID "HP" - /* __HP_cc = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) - -#elif defined(__DECC) -# define COMPILER_ID "Compaq" - /* __DECC_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) - -#elif defined(__IBMC__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__open_xl__) && defined(__clang__) -# define COMPILER_ID "IBMClang" -# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) -# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) -# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) - - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 -# define COMPILER_ID "XL" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__NVCOMPILER) -# define COMPILER_ID "NVHPC" -# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) -# if defined(__NVCOMPILER_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) -# endif - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(__clang__) && defined(__cray__) -# define COMPILER_ID "CrayClang" -# define COMPILER_VERSION_MAJOR DEC(__cray_major__) -# define COMPILER_VERSION_MINOR DEC(__cray_minor__) -# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__CLANG_FUJITSU) -# define COMPILER_ID "FujitsuClang" -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(__FUJITSU) -# define COMPILER_ID "Fujitsu" -# if defined(__FCC_version__) -# define COMPILER_VERSION __FCC_version__ -# elif defined(__FCC_major__) -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# endif -# if defined(__fcc_version) -# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) -# elif defined(__FCC_VERSION) -# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) -# endif - - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__TASKING__) -# define COMPILER_ID "Tasking" - # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) - # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) -# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) - -#elif defined(__ORANGEC__) -# define COMPILER_ID "OrangeC" -# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) - -#elif defined(__TINYC__) -# define COMPILER_ID "TinyCC" - -#elif defined(__BCC__) -# define COMPILER_ID "Bruce" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) && defined(__ti__) -# define COMPILER_ID "TIClang" - # define COMPILER_VERSION_MAJOR DEC(__ti_major__) - # define COMPILER_VERSION_MINOR DEC(__ti_minor__) - # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) -# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) -# define COMPILER_ID "LCC" -# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) -# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) -# if defined(__LCC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) -# endif -# if defined(__GNUC__) && defined(__GNUC_MINOR__) -# define SIMULATE_ID "GNU" -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif -# endif - -#elif defined(__GNUC__) -# define COMPILER_ID "GNU" -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(_ADI_COMPILER) -# define COMPILER_ID "ADSP" -#if defined(__VERSIONNUM__) - /* __VERSIONNUM__ = 0xVVRRPPTT */ -# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) -# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) -# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) -# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) -# define COMPILER_ID "SDCC" -# if defined(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) -# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) -# else - /* SDCC = VRP */ -# define COMPILER_VERSION_MAJOR DEC(SDCC/100) -# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) -# define COMPILER_VERSION_PATCH DEC(SDCC % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__MSYS__) -# define PLATFORM_ID "MSYS" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# elif defined(__VXWORKS__) -# define PLATFORM_ID "VxWorks" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -# elif defined(_ADI_COMPILER) -# define PLATFORM_ID "ADSP" - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_ARM64EC) -# define ARCHITECTURE_ID "ARM64EC" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__ICCSTM8__) -# define ARCHITECTURE_ID "STM8" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__clang__) && defined(__ti__) -# if defined(__ARM_ARCH) -# define ARCHITECTURE_ID "Arm" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__TI_COMPILER_VERSION__) -# if defined(__TI_ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__MSP430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__TMS320C28XX__) -# define ARCHITECTURE_ID "TMS320C28x" - -# elif defined(__TMS320C6X__) || defined(_TMS320C6X) -# define ARCHITECTURE_ID "TMS320C6x" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -# elif defined(__ADSPSHARC__) -# define ARCHITECTURE_ID "SHARC" - -# elif defined(__ADSPBLACKFIN__) -# define ARCHITECTURE_ID "Blackfin" - -#elif defined(__TASKING__) - -# if defined(__CTC__) || defined(__CPTC__) -# define ARCHITECTURE_ID "TriCore" - -# elif defined(__CMCS__) -# define ARCHITECTURE_ID "MCS" - -# elif defined(__CARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__CARC__) -# define ARCHITECTURE_ID "ARC" - -# elif defined(__C51__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__CPCP__) -# define ARCHITECTURE_ID "PCP" - -# else -# define ARCHITECTURE_ID "" -# endif - -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number. */ -#ifdef COMPILER_VERSION -char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; - -/* Construct a string literal encoding the version number components. */ -#elif defined(COMPILER_VERSION_MAJOR) -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#elif defined(COMPILER_VERSION_INTERNAL_STR) -char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - -#define C_STD_99 199901L -#define C_STD_11 201112L -#define C_STD_17 201710L -#define C_STD_23 202311L - -#ifdef __STDC_VERSION__ -# define C_STD __STDC_VERSION__ -#endif - -#if !defined(__STDC__) && !defined(__clang__) -# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) -# define C_VERSION "90" -# else -# define C_VERSION -# endif -#elif C_STD > C_STD_17 -# define C_VERSION "23" -#elif C_STD > C_STD_11 -# define C_VERSION "17" -#elif C_STD > C_STD_99 -# define C_VERSION "11" -#elif C_STD >= C_STD_99 -# define C_VERSION "99" -#else -# define C_VERSION "90" -#endif -const char* info_language_standard_default = - "INFO" ":" "standard_default[" C_VERSION "]"; - -const char* info_language_extensions_default = "INFO" ":" "extensions_default[" -#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ - defined(__TI_COMPILER_VERSION__)) && \ - !defined(__STRICT_ANSI__) - "ON" -#else - "OFF" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -#ifdef ID_VOID_MAIN -void main() {} -#else -# if defined(__CLASSIC_C__) -int main(argc, argv) int argc; char *argv[]; -# else -int main(int argc, char* argv[]) -# endif -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) - require += info_cray[argc]; -#endif - require += info_language_standard_default[argc]; - require += info_language_extensions_default[argc]; - (void)argv; - return require; -} -#endif diff --git a/build/CMakeFiles/3.30.5/CompilerIdC/CMakeCCompilerId.o b/build/CMakeFiles/3.30.5/CompilerIdC/CMakeCCompilerId.o deleted file mode 100644 index 8510c40..0000000 Binary files a/build/CMakeFiles/3.30.5/CompilerIdC/CMakeCCompilerId.o and /dev/null differ diff --git a/build/CMakeFiles/3.30.5/CompilerIdCXX/CMakeCXXCompilerId.cpp b/build/CMakeFiles/3.30.5/CompilerIdCXX/CMakeCXXCompilerId.cpp deleted file mode 100644 index da6c824..0000000 --- a/build/CMakeFiles/3.30.5/CompilerIdCXX/CMakeCXXCompilerId.cpp +++ /dev/null @@ -1,919 +0,0 @@ -/* This source file must have a .cpp extension so that all C++ compilers - recognize the extension without flags. Borland does not know .cxx for - example. */ -#ifndef __cplusplus -# error "A C compiler has been selected for C++." -#endif - -#if !defined(__has_include) -/* If the compiler does not have __has_include, pretend the answer is - always no. */ -# define __has_include(x) 0 -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, - except that a few beta releases use the old format with V=2021. */ -# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) - /* The third version component from --version is an update index, - but no macro is provided for it. */ -# define COMPILER_VERSION_PATCH DEC(0) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) -# define COMPILER_ID "IntelLLVM" -#if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -#endif -#if defined(__GNUC__) -# define SIMULATE_ID "GNU" -#endif -/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and - * later. Look for 6 digit vs. 8 digit version number to decide encoding. - * VVVV is no smaller than the current year when a version is released. - */ -#if __INTEL_LLVM_COMPILER < 1000000L -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) -#else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) -#endif -#if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -#endif -#if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -#elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -#endif -#if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -#endif -#if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -#endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_CC) -# define COMPILER_ID "SunPro" -# if __SUNPRO_CC >= 0x5100 - /* __SUNPRO_CC = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# endif - -#elif defined(__HP_aCC) -# define COMPILER_ID "HP" - /* __HP_aCC = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) - -#elif defined(__DECCXX) -# define COMPILER_ID "Compaq" - /* __DECCXX_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) - -#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__open_xl__) && defined(__clang__) -# define COMPILER_ID "IBMClang" -# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) -# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) -# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) - - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 -# define COMPILER_ID "XL" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__NVCOMPILER) -# define COMPILER_ID "NVHPC" -# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) -# if defined(__NVCOMPILER_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) -# endif - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(__clang__) && defined(__cray__) -# define COMPILER_ID "CrayClang" -# define COMPILER_VERSION_MAJOR DEC(__cray_major__) -# define COMPILER_VERSION_MINOR DEC(__cray_minor__) -# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__CLANG_FUJITSU) -# define COMPILER_ID "FujitsuClang" -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(__FUJITSU) -# define COMPILER_ID "Fujitsu" -# if defined(__FCC_version__) -# define COMPILER_VERSION __FCC_version__ -# elif defined(__FCC_major__) -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# endif -# if defined(__fcc_version) -# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) -# elif defined(__FCC_VERSION) -# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) -# endif - - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__TASKING__) -# define COMPILER_ID "Tasking" - # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) - # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) -# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) - -#elif defined(__ORANGEC__) -# define COMPILER_ID "OrangeC" -# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) && defined(__ti__) -# define COMPILER_ID "TIClang" - # define COMPILER_VERSION_MAJOR DEC(__ti_major__) - # define COMPILER_VERSION_MINOR DEC(__ti_minor__) - # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) -# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) -# define COMPILER_ID "LCC" -# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) -# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) -# if defined(__LCC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) -# endif -# if defined(__GNUC__) && defined(__GNUC_MINOR__) -# define SIMULATE_ID "GNU" -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif -# endif - -#elif defined(__GNUC__) || defined(__GNUG__) -# define COMPILER_ID "GNU" -# if defined(__GNUC__) -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# else -# define COMPILER_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(_ADI_COMPILER) -# define COMPILER_ID "ADSP" -#if defined(__VERSIONNUM__) - /* __VERSIONNUM__ = 0xVVRRPPTT */ -# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) -# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) -# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) -# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__MSYS__) -# define PLATFORM_ID "MSYS" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# elif defined(__VXWORKS__) -# define PLATFORM_ID "VxWorks" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -# elif defined(_ADI_COMPILER) -# define PLATFORM_ID "ADSP" - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_ARM64EC) -# define ARCHITECTURE_ID "ARM64EC" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__ICCSTM8__) -# define ARCHITECTURE_ID "STM8" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__clang__) && defined(__ti__) -# if defined(__ARM_ARCH) -# define ARCHITECTURE_ID "Arm" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__TI_COMPILER_VERSION__) -# if defined(__TI_ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__MSP430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__TMS320C28XX__) -# define ARCHITECTURE_ID "TMS320C28x" - -# elif defined(__TMS320C6X__) || defined(_TMS320C6X) -# define ARCHITECTURE_ID "TMS320C6x" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -# elif defined(__ADSPSHARC__) -# define ARCHITECTURE_ID "SHARC" - -# elif defined(__ADSPBLACKFIN__) -# define ARCHITECTURE_ID "Blackfin" - -#elif defined(__TASKING__) - -# if defined(__CTC__) || defined(__CPTC__) -# define ARCHITECTURE_ID "TriCore" - -# elif defined(__CMCS__) -# define ARCHITECTURE_ID "MCS" - -# elif defined(__CARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__CARC__) -# define ARCHITECTURE_ID "ARC" - -# elif defined(__C51__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__CPCP__) -# define ARCHITECTURE_ID "PCP" - -# else -# define ARCHITECTURE_ID "" -# endif - -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number. */ -#ifdef COMPILER_VERSION -char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; - -/* Construct a string literal encoding the version number components. */ -#elif defined(COMPILER_VERSION_MAJOR) -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#elif defined(COMPILER_VERSION_INTERNAL_STR) -char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - -#define CXX_STD_98 199711L -#define CXX_STD_11 201103L -#define CXX_STD_14 201402L -#define CXX_STD_17 201703L -#define CXX_STD_20 202002L -#define CXX_STD_23 202302L - -#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) -# if _MSVC_LANG > CXX_STD_17 -# define CXX_STD _MSVC_LANG -# elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init) -# define CXX_STD CXX_STD_20 -# elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17 -# define CXX_STD CXX_STD_20 -# elif _MSVC_LANG > CXX_STD_14 -# define CXX_STD CXX_STD_17 -# elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi) -# define CXX_STD CXX_STD_14 -# elif defined(__INTEL_CXX11_MODE__) -# define CXX_STD CXX_STD_11 -# else -# define CXX_STD CXX_STD_98 -# endif -#elif defined(_MSC_VER) && defined(_MSVC_LANG) -# if _MSVC_LANG > __cplusplus -# define CXX_STD _MSVC_LANG -# else -# define CXX_STD __cplusplus -# endif -#elif defined(__NVCOMPILER) -# if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init) -# define CXX_STD CXX_STD_20 -# else -# define CXX_STD __cplusplus -# endif -#elif defined(__INTEL_COMPILER) || defined(__PGI) -# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes) -# define CXX_STD CXX_STD_17 -# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) -# define CXX_STD CXX_STD_14 -# else -# define CXX_STD __cplusplus -# endif -#elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__) -# if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) -# define CXX_STD CXX_STD_14 -# else -# define CXX_STD __cplusplus -# endif -#elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__) -# define CXX_STD CXX_STD_11 -#else -# define CXX_STD __cplusplus -#endif - -const char* info_language_standard_default = "INFO" ":" "standard_default[" -#if CXX_STD > CXX_STD_23 - "26" -#elif CXX_STD > CXX_STD_20 - "23" -#elif CXX_STD > CXX_STD_17 - "20" -#elif CXX_STD > CXX_STD_14 - "17" -#elif CXX_STD > CXX_STD_11 - "14" -#elif CXX_STD >= CXX_STD_11 - "11" -#else - "98" -#endif -"]"; - -const char* info_language_extensions_default = "INFO" ":" "extensions_default[" -#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ - defined(__TI_COMPILER_VERSION__)) && \ - !defined(__STRICT_ANSI__) - "ON" -#else - "OFF" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -int main(int argc, char* argv[]) -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) - require += info_cray[argc]; -#endif - require += info_language_standard_default[argc]; - require += info_language_extensions_default[argc]; - (void)argv; - return require; -} diff --git a/build/CMakeFiles/3.30.5/CompilerIdCXX/CMakeCXXCompilerId.o b/build/CMakeFiles/3.30.5/CompilerIdCXX/CMakeCXXCompilerId.o deleted file mode 100644 index 8146948..0000000 Binary files a/build/CMakeFiles/3.30.5/CompilerIdCXX/CMakeCXXCompilerId.o and /dev/null differ diff --git a/build/CMakeFiles/CMakeConfigureLog.yaml b/build/CMakeFiles/CMakeConfigureLog.yaml deleted file mode 100644 index e4516e2..0000000 --- a/build/CMakeFiles/CMakeConfigureLog.yaml +++ /dev/null @@ -1,473 +0,0 @@ - ---- -events: - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineSystem.cmake:205 (message)" - - "CMakeLists.txt:2 (project)" - message: | - The system is: Darwin - 24.0.0 - x86_64 - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCCompiler.cmake:123 (CMAKE_DETERMINE_COMPILER_ID)" - - "CMakeLists.txt:2 (project)" - message: | - Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. - Compiler: /Library/Developer/CommandLineTools/usr/bin/cc - Build flags: - Id flags: - - The output was: - 1 - ld: library 'System' not found - cc: error: linker command failed with exit code 1 (use -v to see invocation) - - - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCCompiler.cmake:123 (CMAKE_DETERMINE_COMPILER_ID)" - - "CMakeLists.txt:2 (project)" - message: | - Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. - Compiler: /Library/Developer/CommandLineTools/usr/bin/cc - Build flags: - Id flags: -c - - The output was: - 0 - - - Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o" - - The C compiler identification is AppleClang, found in: - /Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/3.30.5/CompilerIdC/CMakeCCompilerId.o - - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:126 (CMAKE_DETERMINE_COMPILER_ID)" - - "CMakeLists.txt:2 (project)" - message: | - Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. - Compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - Build flags: - Id flags: - - The output was: - 1 - ld: library 'c++' not found - c++: error: linker command failed with exit code 1 (use -v to see invocation) - - - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:126 (CMAKE_DETERMINE_COMPILER_ID)" - - "CMakeLists.txt:2 (project)" - message: | - Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. - Compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - Build flags: - Id flags: -c - - The output was: - 0 - - - Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o" - - The CXX compiler identification is AppleClang, found in: - /Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/3.30.5/CompilerIdCXX/CMakeCXXCompilerId.o - - - - kind: "try_compile-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:74 (try_compile)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:2 (project)" - checks: - - "Detecting C compiler ABI info" - directories: - source: "/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-xz5Za8" - binary: "/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-xz5Za8" - cmakeVariables: - CMAKE_C_FLAGS: "" - CMAKE_C_FLAGS_DEBUG: "-g" - CMAKE_EXE_LINKER_FLAGS: "" - CMAKE_OSX_ARCHITECTURES: "" - CMAKE_OSX_DEPLOYMENT_TARGET: "" - CMAKE_OSX_SYSROOT: "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk" - buildResult: - variable: "CMAKE_C_ABI_COMPILED" - cached: true - stdout: | - Change Dir: '/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-xz5Za8' - - Run Build Command(s): /usr/local/Cellar/cmake/3.30.5/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_82178/fast - /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_82178.dir/build.make CMakeFiles/cmTC_82178.dir/build - Building C object CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o - /Library/Developer/CommandLineTools/usr/bin/cc -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -v -Wl,-v -MD -MT CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -c /usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCCompilerABI.c - Apple clang version 16.0.0 (clang-1600.0.26.3) - Target: x86_64-apple-darwin24.0.0 - Thread model: posix - InstalledDir: /Library/Developer/CommandLineTools/usr/bin - cc: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] - "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=2 -target-sdk-version=15.0 -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 1115.7.3 -v -fcoverage-compilation-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-xz5Za8 -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/16 -dependency-file CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/16/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdebug-compilation-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-xz5Za8 -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -x c /usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCCompilerABI.c - clang -cc1 version 16.0.0 (clang-1600.0.26.3) default target x86_64-apple-darwin24.0.0 - ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/local/include" - ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/Library/Frameworks" - #include "..." search starts here: - #include <...> search starts here: - /Library/Developer/CommandLineTools/usr/lib/clang/16/include - /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include - /Library/Developer/CommandLineTools/usr/include - /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks (framework directory) - End of search list. - Linking C executable cmTC_82178 - /usr/local/Cellar/cmake/3.30.5/bin/cmake -E cmake_link_script CMakeFiles/cmTC_82178.dir/link.txt --verbose=1 - /Library/Developer/CommandLineTools/usr/bin/cc -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -o cmTC_82178 - Apple clang version 16.0.0 (clang-1600.0.26.3) - Target: x86_64-apple-darwin24.0.0 - Thread model: posix - InstalledDir: /Library/Developer/CommandLineTools/usr/bin - "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 15.0.0 15.0 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_82178 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a - @(#)PROGRAM:ld PROJECT:ld-1115.7.3 - BUILD 13:27:52 Aug 9 2024 - configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em - will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em - LTO support using: LLVM version 16.0.0 (static support for 29, runtime is 29) - TAPI support using: Apple TAPI version 16.0.0 (tapi-1600.0.11.8) - Library search paths: - /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib - /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift - Framework search paths: - /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks - - exitCode: 0 - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:113 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:2 (project)" - message: | - Effective list of requested architectures (possibly empty) : "" - Effective list of architectures found in the ABI info binary: "x86_64" - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:182 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:2 (project)" - message: | - Parsed C implicit include dir info: rv=done - found start of include info - found start of implicit include info - add: [/Library/Developer/CommandLineTools/usr/lib/clang/16/include] - add: [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include] - add: [/Library/Developer/CommandLineTools/usr/include] - end of search list found - collapse include dir [/Library/Developer/CommandLineTools/usr/lib/clang/16/include] ==> [/Library/Developer/CommandLineTools/usr/lib/clang/16/include] - collapse include dir [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include] - collapse include dir [/Library/Developer/CommandLineTools/usr/include] ==> [/Library/Developer/CommandLineTools/usr/include] - implicit include dirs: [/Library/Developer/CommandLineTools/usr/lib/clang/16/include;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include;/Library/Developer/CommandLineTools/usr/include] - - - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:218 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:2 (project)" - message: | - Parsed C implicit link information: - link line regex: [^( *|.*[/\\])(ld[0-9]*(\\.[a-z]+)?|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] - linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(\\.[a-z]+)?))("|,| |$)] - ignore line: [Change Dir: '/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-xz5Za8'] - ignore line: [] - ignore line: [Run Build Command(s): /usr/local/Cellar/cmake/3.30.5/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_82178/fast] - ignore line: [/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_82178.dir/build.make CMakeFiles/cmTC_82178.dir/build] - ignore line: [Building C object CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o] - ignore line: [/Library/Developer/CommandLineTools/usr/bin/cc -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -v -Wl -v -MD -MT CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -c /usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCCompilerABI.c] - ignore line: [Apple clang version 16.0.0 (clang-1600.0.26.3)] - ignore line: [Target: x86_64-apple-darwin24.0.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Library/Developer/CommandLineTools/usr/bin] - ignore line: [cc: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] - ignore line: [ "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=2 -target-sdk-version=15.0 -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 1115.7.3 -v -fcoverage-compilation-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-xz5Za8 -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/16 -dependency-file CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/16/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdebug-compilation-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-xz5Za8 -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -x c /usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCCompilerABI.c] - ignore line: [clang -cc1 version 16.0.0 (clang-1600.0.26.3) default target x86_64-apple-darwin24.0.0] - ignore line: [ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/local/include"] - ignore line: [ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/Library/Frameworks"] - ignore line: [#include "..." search starts here:] - ignore line: [#include <...> search starts here:] - ignore line: [ /Library/Developer/CommandLineTools/usr/lib/clang/16/include] - ignore line: [ /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include] - ignore line: [ /Library/Developer/CommandLineTools/usr/include] - ignore line: [ /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks (framework directory)] - ignore line: [End of search list.] - ignore line: [Linking C executable cmTC_82178] - ignore line: [/usr/local/Cellar/cmake/3.30.5/bin/cmake -E cmake_link_script CMakeFiles/cmTC_82178.dir/link.txt --verbose=1] - ignore line: [/Library/Developer/CommandLineTools/usr/bin/cc -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -Wl -search_paths_first -Wl -headerpad_max_install_names -v -Wl -v CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -o cmTC_82178] - ignore line: [Apple clang version 16.0.0 (clang-1600.0.26.3)] - ignore line: [Target: x86_64-apple-darwin24.0.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Library/Developer/CommandLineTools/usr/bin] - link line: [ "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 15.0.0 15.0 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_82178 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] - arg [/Library/Developer/CommandLineTools/usr/bin/ld] ==> ignore - arg [-demangle] ==> ignore - arg [-lto_library] ==> ignore, skip following value - arg [/Library/Developer/CommandLineTools/usr/lib/libLTO.dylib] ==> skip value of -lto_library - arg [-dynamic] ==> ignore - arg [-arch] ==> ignore - arg [x86_64] ==> ignore - arg [-platform_version] ==> ignore - arg [macos] ==> ignore - arg [15.0.0] ==> ignore - arg [15.0] ==> ignore - arg [-syslibroot] ==> ignore - arg [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk] ==> ignore - arg [-mllvm] ==> ignore - arg [-enable-linkonceodr-outlining] ==> ignore - arg [-o] ==> ignore - arg [cmTC_82178] ==> ignore - arg [-search_paths_first] ==> ignore - arg [-headerpad_max_install_names] ==> ignore - arg [-v] ==> ignore - arg [CMakeFiles/cmTC_82178.dir/CMakeCCompilerABI.c.o] ==> ignore - arg [-lSystem] ==> lib [System] - arg [/Library/Developer/CommandLineTools/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] ==> lib [/Library/Developer/CommandLineTools/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] - linker tool for 'C': /Library/Developer/CommandLineTools/usr/bin/ld - Library search paths: [;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift] - Framework search paths: [;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks] - remove lib [System] - remove lib [/Library/Developer/CommandLineTools/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] - collapse library dir [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib] - collapse library dir [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift] - collapse framework dir [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks] - implicit libs: [] - implicit objs: [] - implicit dirs: [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift] - implicit fwks: [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks] - - - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:40 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:255 (cmake_determine_linker_id)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:2 (project)" - message: | - Running the C compiler's linker: "/Library/Developer/CommandLineTools/usr/bin/ld" "-v" - @(#)PROGRAM:ld PROJECT:ld-1115.7.3 - BUILD 13:27:52 Aug 9 2024 - configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em - will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em - LTO support using: LLVM version 16.0.0 (static support for 29, runtime is 29) - TAPI support using: Apple TAPI version 16.0.0 (tapi-1600.0.11.8) - - - kind: "try_compile-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:74 (try_compile)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:2 (project)" - checks: - - "Detecting CXX compiler ABI info" - directories: - source: "/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-j5OmA3" - binary: "/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-j5OmA3" - cmakeVariables: - CMAKE_CXX_FLAGS: "" - CMAKE_CXX_FLAGS_DEBUG: "-g" - CMAKE_CXX_SCAN_FOR_MODULES: "OFF" - CMAKE_EXE_LINKER_FLAGS: "" - CMAKE_OSX_ARCHITECTURES: "" - CMAKE_OSX_DEPLOYMENT_TARGET: "" - CMAKE_OSX_SYSROOT: "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk" - buildResult: - variable: "CMAKE_CXX_ABI_COMPILED" - cached: true - stdout: | - Change Dir: '/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-j5OmA3' - - Run Build Command(s): /usr/local/Cellar/cmake/3.30.5/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_e6fdf/fast - /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_e6fdf.dir/build.make CMakeFiles/cmTC_e6fdf.dir/build - Building CXX object CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o - /Library/Developer/CommandLineTools/usr/bin/c++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -v -Wl,-v -MD -MT CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCXXCompilerABI.cpp - Apple clang version 16.0.0 (clang-1600.0.26.3) - Target: x86_64-apple-darwin24.0.0 - Thread model: posix - InstalledDir: /Library/Developer/CommandLineTools/usr/bin - c++: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] - ignoring nonexistent directory "/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1" - "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=2 -target-sdk-version=15.0 -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 1115.7.3 -v -fcoverage-compilation-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-j5OmA3 -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/16 -dependency-file CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1 -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/16/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdeprecated-macro -fdebug-compilation-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-j5OmA3 -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCXXCompilerABI.cpp - clang -cc1 version 16.0.0 (clang-1600.0.26.3) default target x86_64-apple-darwin24.0.0 - ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/local/include" - ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/Library/Frameworks" - #include "..." search starts here: - #include <...> search starts here: - /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1 - /Library/Developer/CommandLineTools/usr/lib/clang/16/include - /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include - /Library/Developer/CommandLineTools/usr/include - /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks (framework directory) - End of search list. - Linking CXX executable cmTC_e6fdf - /usr/local/Cellar/cmake/3.30.5/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e6fdf.dir/link.txt --verbose=1 - /Library/Developer/CommandLineTools/usr/bin/c++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_e6fdf - Apple clang version 16.0.0 (clang-1600.0.26.3) - Target: x86_64-apple-darwin24.0.0 - Thread model: posix - InstalledDir: /Library/Developer/CommandLineTools/usr/bin - "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 15.0.0 15.0 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_e6fdf -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a - @(#)PROGRAM:ld PROJECT:ld-1115.7.3 - BUILD 13:27:52 Aug 9 2024 - configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em - will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em - LTO support using: LLVM version 16.0.0 (static support for 29, runtime is 29) - TAPI support using: Apple TAPI version 16.0.0 (tapi-1600.0.11.8) - Library search paths: - /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib - /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift - Framework search paths: - /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks - - exitCode: 0 - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:113 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:2 (project)" - message: | - Effective list of requested architectures (possibly empty) : "" - Effective list of architectures found in the ABI info binary: "x86_64" - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:182 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:2 (project)" - message: | - Parsed CXX implicit include dir info: rv=done - found start of include info - found start of implicit include info - add: [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1] - add: [/Library/Developer/CommandLineTools/usr/lib/clang/16/include] - add: [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include] - add: [/Library/Developer/CommandLineTools/usr/include] - end of search list found - collapse include dir [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1] - collapse include dir [/Library/Developer/CommandLineTools/usr/lib/clang/16/include] ==> [/Library/Developer/CommandLineTools/usr/lib/clang/16/include] - collapse include dir [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include] - collapse include dir [/Library/Developer/CommandLineTools/usr/include] ==> [/Library/Developer/CommandLineTools/usr/include] - implicit include dirs: [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1;/Library/Developer/CommandLineTools/usr/lib/clang/16/include;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include;/Library/Developer/CommandLineTools/usr/include] - - - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:218 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:2 (project)" - message: | - Parsed CXX implicit link information: - link line regex: [^( *|.*[/\\])(ld[0-9]*(\\.[a-z]+)?|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] - linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(\\.[a-z]+)?))("|,| |$)] - ignore line: [Change Dir: '/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-j5OmA3'] - ignore line: [] - ignore line: [Run Build Command(s): /usr/local/Cellar/cmake/3.30.5/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_e6fdf/fast] - ignore line: [/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_e6fdf.dir/build.make CMakeFiles/cmTC_e6fdf.dir/build] - ignore line: [Building CXX object CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o] - ignore line: [/Library/Developer/CommandLineTools/usr/bin/c++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -v -Wl -v -MD -MT CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCXXCompilerABI.cpp] - ignore line: [Apple clang version 16.0.0 (clang-1600.0.26.3)] - ignore line: [Target: x86_64-apple-darwin24.0.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Library/Developer/CommandLineTools/usr/bin] - ignore line: [c++: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] - ignore line: [ignoring nonexistent directory "/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1"] - ignore line: [ "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=2 -target-sdk-version=15.0 -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 1115.7.3 -v -fcoverage-compilation-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-j5OmA3 -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/16 -dependency-file CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1 -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/16/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdeprecated-macro -fdebug-compilation-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/CMakeScratch/TryCompile-j5OmA3 -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCXXCompilerABI.cpp] - ignore line: [clang -cc1 version 16.0.0 (clang-1600.0.26.3) default target x86_64-apple-darwin24.0.0] - ignore line: [ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/local/include"] - ignore line: [ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/Library/Frameworks"] - ignore line: [#include "..." search starts here:] - ignore line: [#include <...> search starts here:] - ignore line: [ /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1] - ignore line: [ /Library/Developer/CommandLineTools/usr/lib/clang/16/include] - ignore line: [ /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include] - ignore line: [ /Library/Developer/CommandLineTools/usr/include] - ignore line: [ /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks (framework directory)] - ignore line: [End of search list.] - ignore line: [Linking CXX executable cmTC_e6fdf] - ignore line: [/usr/local/Cellar/cmake/3.30.5/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e6fdf.dir/link.txt --verbose=1] - ignore line: [/Library/Developer/CommandLineTools/usr/bin/c++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -Wl -search_paths_first -Wl -headerpad_max_install_names -v -Wl -v CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_e6fdf] - ignore line: [Apple clang version 16.0.0 (clang-1600.0.26.3)] - ignore line: [Target: x86_64-apple-darwin24.0.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Library/Developer/CommandLineTools/usr/bin] - link line: [ "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 15.0.0 15.0 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_e6fdf -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] - arg [/Library/Developer/CommandLineTools/usr/bin/ld] ==> ignore - arg [-demangle] ==> ignore - arg [-lto_library] ==> ignore, skip following value - arg [/Library/Developer/CommandLineTools/usr/lib/libLTO.dylib] ==> skip value of -lto_library - arg [-dynamic] ==> ignore - arg [-arch] ==> ignore - arg [x86_64] ==> ignore - arg [-platform_version] ==> ignore - arg [macos] ==> ignore - arg [15.0.0] ==> ignore - arg [15.0] ==> ignore - arg [-syslibroot] ==> ignore - arg [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk] ==> ignore - arg [-mllvm] ==> ignore - arg [-enable-linkonceodr-outlining] ==> ignore - arg [-o] ==> ignore - arg [cmTC_e6fdf] ==> ignore - arg [-search_paths_first] ==> ignore - arg [-headerpad_max_install_names] ==> ignore - arg [-v] ==> ignore - arg [CMakeFiles/cmTC_e6fdf.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore - arg [-lc++] ==> lib [c++] - arg [-lSystem] ==> lib [System] - arg [/Library/Developer/CommandLineTools/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] ==> lib [/Library/Developer/CommandLineTools/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] - linker tool for 'CXX': /Library/Developer/CommandLineTools/usr/bin/ld - Library search paths: [;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift] - Framework search paths: [;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks] - remove lib [System] - remove lib [/Library/Developer/CommandLineTools/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] - collapse library dir [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib] - collapse library dir [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift] - collapse framework dir [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks] - implicit libs: [c++] - implicit objs: [] - implicit dirs: [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib;/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/swift] - implicit fwks: [/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks] - - - - - kind: "message-v1" - backtrace: - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:40 (message)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:255 (cmake_determine_linker_id)" - - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:2 (project)" - message: | - Running the CXX compiler's linker: "/Library/Developer/CommandLineTools/usr/bin/ld" "-v" - @(#)PROGRAM:ld PROJECT:ld-1115.7.3 - BUILD 13:27:52 Aug 9 2024 - configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em - will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em - LTO support using: LLVM version 16.0.0 (static support for 29, runtime is 29) - TAPI support using: Apple TAPI version 16.0.0 (tapi-1600.0.11.8) -... diff --git a/build/CMakeFiles/CMakeDirectoryInformation.cmake b/build/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index 299f419..0000000 --- a/build/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.30 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/reetnandy/vscode/OS_HW_2") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/reetnandy/vscode/OS_HW_2/build") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/build/CMakeFiles/CMakeRuleHashes.txt b/build/CMakeFiles/CMakeRuleHashes.txt deleted file mode 100644 index 99c83f6..0000000 --- a/build/CMakeFiles/CMakeRuleHashes.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Hashes of file build rules. -3e2af143f83168c20f179eb5702b824f CMakeFiles/clean_mix2 diff --git a/build/CMakeFiles/Makefile.cmake b/build/CMakeFiles/Makefile.cmake deleted file mode 100644 index c3a7281..0000000 --- a/build/CMakeFiles/Makefile.cmake +++ /dev/null @@ -1,134 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.30 - -# The generator used is: -set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") - -# The top level Makefile was generated from the following files: -set(CMAKE_MAKEFILE_DEPENDS - "CMakeCache.txt" - "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt" - "CMakeFiles/3.30.5/CMakeCCompiler.cmake" - "CMakeFiles/3.30.5/CMakeCXXCompiler.cmake" - "CMakeFiles/3.30.5/CMakeSystem.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCCompiler.cmake.in" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCCompilerABI.c" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCInformation.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCXXCompiler.cmake.in" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCXXCompilerABI.cpp" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCXXInformation.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCommonLanguageInclude.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeCompilerIdDetection.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerABI.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerId.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineCompilerSupport.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeDetermineSystem.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeFindBinUtils.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeGenericSystem.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeInitializeConfigs.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeLanguageInformation.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeParseImplicitIncludeInfo.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeParseImplicitLinkInfo.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeParseLibraryArchitecture.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeSystem.cmake.in" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeSystemSpecificInformation.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCXXCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCompilerCommon.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeUnixFindMake.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/ADSP-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/ARMCC-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/ARMClang-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/AppleClang-C.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/AppleClang-CXX.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/AppleClang-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Borland-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Bruce-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/CMakeCommonCompilerMacros.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Clang-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Clang.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Cray-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/CrayClang-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/FujitsuClang-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/GHS-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/GNU-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/GNU.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/HP-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/IAR-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/IBMClang-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/IBMClang-CXX-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Intel-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/IntelLLVM-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/LCC-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/LCC-CXX-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/MSVC-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/NVHPC-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/OrangeC-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/PGI-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/PathScale-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/SCO-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/TI-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/TIClang-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Tasking-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/Watcom-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/XL-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/XLClang-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/zOS-C-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Internal/FeatureTesting.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Platform/Apple-AppleClang-C.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Platform/Apple-AppleClang-CXX.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Platform/Apple-Clang-C.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Platform/Apple-Clang-CXX.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Platform/Apple-Clang.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Platform/Darwin-Determine-CXX.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Platform/Darwin-Initialize.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Platform/Darwin.cmake" - "/usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/Platform/UnixPaths.cmake" - ) - -# The corresponding makefile is: -set(CMAKE_MAKEFILE_OUTPUTS - "Makefile" - "CMakeFiles/cmake.check_cache" - ) - -# Byproducts of CMake generate step: -set(CMAKE_MAKEFILE_PRODUCTS - "CMakeFiles/3.30.5/CMakeSystem.cmake" - "CMakeFiles/3.30.5/CMakeCCompiler.cmake" - "CMakeFiles/3.30.5/CMakeCXXCompiler.cmake" - "CMakeFiles/3.30.5/CMakeCCompiler.cmake" - "CMakeFiles/3.30.5/CMakeCXXCompiler.cmake" - "CMakeFiles/CMakeDirectoryInformation.cmake" - ) - -# Dependency information for all targets: -set(CMAKE_DEPEND_INFO_FILES - "CMakeFiles/mix2.dir/DependInfo.cmake" - "CMakeFiles/clean_mix2.dir/DependInfo.cmake" - ) diff --git a/build/CMakeFiles/Makefile2 b/build/CMakeFiles/Makefile2 deleted file mode 100644 index e3166fd..0000000 --- a/build/CMakeFiles/Makefile2 +++ /dev/null @@ -1,140 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.30 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Disable VCS-based implicit rules. -% : %,v - -# Disable VCS-based implicit rules. -% : RCS/% - -# Disable VCS-based implicit rules. -% : RCS/%,v - -# Disable VCS-based implicit rules. -% : SCCS/s.% - -# Disable VCS-based implicit rules. -% : s.% - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Command-line flag to silence nested $(MAKE). -$(VERBOSE)MAKESILENT = -s - -#Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/local/Cellar/cmake/3.30.5/bin/cmake - -# The command to remove a file. -RM = /usr/local/Cellar/cmake/3.30.5/bin/cmake -E rm -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /Users/reetnandy/vscode/OS_HW_2 - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /Users/reetnandy/vscode/OS_HW_2/build - -#============================================================================= -# Directory level rules for the build root directory - -# The main recursive "all" target. -all: CMakeFiles/mix2.dir/all -all: CMakeFiles/clean_mix2.dir/all -.PHONY : all - -# The main recursive "preinstall" target. -preinstall: -.PHONY : preinstall - -# The main recursive "clean" target. -clean: CMakeFiles/mix2.dir/clean -clean: CMakeFiles/clean_mix2.dir/clean -.PHONY : clean - -#============================================================================= -# Target rules for target CMakeFiles/mix2.dir - -# All Build rule for target. -CMakeFiles/mix2.dir/all: CMakeFiles/clean_mix2.dir/all - $(MAKE) $(MAKESILENT) -f CMakeFiles/mix2.dir/build.make CMakeFiles/mix2.dir/depend - $(MAKE) $(MAKESILENT) -f CMakeFiles/mix2.dir/build.make CMakeFiles/mix2.dir/build - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles --progress-num=2,3 "Built target mix2" -.PHONY : CMakeFiles/mix2.dir/all - -# Build rule for subdir invocation for target. -CMakeFiles/mix2.dir/rule: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles 3 - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/mix2.dir/all - $(CMAKE_COMMAND) -E cmake_progress_start /Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles 0 -.PHONY : CMakeFiles/mix2.dir/rule - -# Convenience name for target. -mix2: CMakeFiles/mix2.dir/rule -.PHONY : mix2 - -# clean rule for target. -CMakeFiles/mix2.dir/clean: - $(MAKE) $(MAKESILENT) -f CMakeFiles/mix2.dir/build.make CMakeFiles/mix2.dir/clean -.PHONY : CMakeFiles/mix2.dir/clean - -#============================================================================= -# Target rules for target CMakeFiles/clean_mix2.dir - -# All Build rule for target. -CMakeFiles/clean_mix2.dir/all: - $(MAKE) $(MAKESILENT) -f CMakeFiles/clean_mix2.dir/build.make CMakeFiles/clean_mix2.dir/depend - $(MAKE) $(MAKESILENT) -f CMakeFiles/clean_mix2.dir/build.make CMakeFiles/clean_mix2.dir/build - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles --progress-num=1 "Built target clean_mix2" -.PHONY : CMakeFiles/clean_mix2.dir/all - -# Build rule for subdir invocation for target. -CMakeFiles/clean_mix2.dir/rule: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles 1 - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/clean_mix2.dir/all - $(CMAKE_COMMAND) -E cmake_progress_start /Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles 0 -.PHONY : CMakeFiles/clean_mix2.dir/rule - -# Convenience name for target. -clean_mix2: CMakeFiles/clean_mix2.dir/rule -.PHONY : clean_mix2 - -# clean rule for target. -CMakeFiles/clean_mix2.dir/clean: - $(MAKE) $(MAKESILENT) -f CMakeFiles/clean_mix2.dir/build.make CMakeFiles/clean_mix2.dir/clean -.PHONY : CMakeFiles/clean_mix2.dir/clean - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/build/CMakeFiles/TargetDirectories.txt b/build/CMakeFiles/TargetDirectories.txt deleted file mode 100644 index 7067de9..0000000 --- a/build/CMakeFiles/TargetDirectories.txt +++ /dev/null @@ -1,5 +0,0 @@ -/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/mix2.dir -/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/clean_mix2.dir -/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/test.dir -/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/edit_cache.dir -/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/rebuild_cache.dir diff --git a/build/CMakeFiles/clean_mix2.dir/DependInfo.cmake b/build/CMakeFiles/clean_mix2.dir/DependInfo.cmake deleted file mode 100644 index 29b95a5..0000000 --- a/build/CMakeFiles/clean_mix2.dir/DependInfo.cmake +++ /dev/null @@ -1,22 +0,0 @@ - -# Consider dependencies only in project. -set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF) - -# The set of languages for which implicit dependencies are needed: -set(CMAKE_DEPENDS_LANGUAGES - ) - -# The set of dependency files which are needed: -set(CMAKE_DEPENDS_DEPENDENCY_FILES - ) - -# Targets to which this target links which contain Fortran sources. -set(CMAKE_Fortran_TARGET_LINKED_INFO_FILES - ) - -# Targets to which this target links which contain Fortran sources. -set(CMAKE_Fortran_TARGET_FORWARD_LINKED_INFO_FILES - ) - -# Fortran module output directory. -set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/build/CMakeFiles/clean_mix2.dir/build.make b/build/CMakeFiles/clean_mix2.dir/build.make deleted file mode 100644 index 5b4ebd0..0000000 --- a/build/CMakeFiles/clean_mix2.dir/build.make +++ /dev/null @@ -1,88 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.30 - -# Delete rule output on recipe failure. -.DELETE_ON_ERROR: - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Disable VCS-based implicit rules. -% : %,v - -# Disable VCS-based implicit rules. -% : RCS/% - -# Disable VCS-based implicit rules. -% : RCS/%,v - -# Disable VCS-based implicit rules. -% : SCCS/s.% - -# Disable VCS-based implicit rules. -% : s.% - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Command-line flag to silence nested $(MAKE). -$(VERBOSE)MAKESILENT = -s - -#Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/local/Cellar/cmake/3.30.5/bin/cmake - -# The command to remove a file. -RM = /usr/local/Cellar/cmake/3.30.5/bin/cmake -E rm -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /Users/reetnandy/vscode/OS_HW_2 - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /Users/reetnandy/vscode/OS_HW_2/build - -# Utility rule file for clean_mix2. - -# Include any custom commands dependencies for this target. -include CMakeFiles/clean_mix2.dir/compiler_depend.make - -# Include the progress variables for this target. -include CMakeFiles/clean_mix2.dir/progress.make - -CMakeFiles/clean_mix2: - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --blue --bold --progress-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Removing old mix2 executable if it exists" - rm -rf /Users/reetnandy/vscode/OS_HW_2/mix2 - -clean_mix2: CMakeFiles/clean_mix2 -clean_mix2: CMakeFiles/clean_mix2.dir/build.make -.PHONY : clean_mix2 - -# Rule to build all files generated by this target. -CMakeFiles/clean_mix2.dir/build: clean_mix2 -.PHONY : CMakeFiles/clean_mix2.dir/build - -CMakeFiles/clean_mix2.dir/clean: - $(CMAKE_COMMAND) -P CMakeFiles/clean_mix2.dir/cmake_clean.cmake -.PHONY : CMakeFiles/clean_mix2.dir/clean - -CMakeFiles/clean_mix2.dir/depend: - cd /Users/reetnandy/vscode/OS_HW_2/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/reetnandy/vscode/OS_HW_2 /Users/reetnandy/vscode/OS_HW_2 /Users/reetnandy/vscode/OS_HW_2/build /Users/reetnandy/vscode/OS_HW_2/build /Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/clean_mix2.dir/DependInfo.cmake "--color=$(COLOR)" -.PHONY : CMakeFiles/clean_mix2.dir/depend - diff --git a/build/CMakeFiles/clean_mix2.dir/cmake_clean.cmake b/build/CMakeFiles/clean_mix2.dir/cmake_clean.cmake deleted file mode 100644 index 78c3c60..0000000 --- a/build/CMakeFiles/clean_mix2.dir/cmake_clean.cmake +++ /dev/null @@ -1,8 +0,0 @@ -file(REMOVE_RECURSE - "CMakeFiles/clean_mix2" -) - -# Per-language clean rules from dependency scanning. -foreach(lang ) - include(CMakeFiles/clean_mix2.dir/cmake_clean_${lang}.cmake OPTIONAL) -endforeach() diff --git a/build/CMakeFiles/clean_mix2.dir/compiler_depend.make b/build/CMakeFiles/clean_mix2.dir/compiler_depend.make deleted file mode 100644 index 78d69ba..0000000 --- a/build/CMakeFiles/clean_mix2.dir/compiler_depend.make +++ /dev/null @@ -1,2 +0,0 @@ -# Empty custom commands generated dependencies file for clean_mix2. -# This may be replaced when dependencies are built. diff --git a/build/CMakeFiles/clean_mix2.dir/compiler_depend.ts b/build/CMakeFiles/clean_mix2.dir/compiler_depend.ts deleted file mode 100644 index 03c24d1..0000000 --- a/build/CMakeFiles/clean_mix2.dir/compiler_depend.ts +++ /dev/null @@ -1,2 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Timestamp file for custom commands dependencies management for clean_mix2. diff --git a/build/CMakeFiles/clean_mix2.dir/progress.make b/build/CMakeFiles/clean_mix2.dir/progress.make deleted file mode 100644 index 781c7de..0000000 --- a/build/CMakeFiles/clean_mix2.dir/progress.make +++ /dev/null @@ -1,2 +0,0 @@ -CMAKE_PROGRESS_1 = 1 - diff --git a/build/CMakeFiles/cmake.check_cache b/build/CMakeFiles/cmake.check_cache deleted file mode 100644 index 3dccd73..0000000 --- a/build/CMakeFiles/cmake.check_cache +++ /dev/null @@ -1 +0,0 @@ -# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/build/CMakeFiles/mix2.dir/DependInfo.cmake b/build/CMakeFiles/mix2.dir/DependInfo.cmake deleted file mode 100644 index f669e41..0000000 --- a/build/CMakeFiles/mix2.dir/DependInfo.cmake +++ /dev/null @@ -1,23 +0,0 @@ - -# Consider dependencies only in project. -set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF) - -# The set of languages for which implicit dependencies are needed: -set(CMAKE_DEPENDS_LANGUAGES - ) - -# The set of dependency files which are needed: -set(CMAKE_DEPENDS_DEPENDENCY_FILES - "/Users/reetnandy/vscode/OS_HW_2/src/mix2.cpp" "CMakeFiles/mix2.dir/src/mix2.cpp.o" "gcc" "CMakeFiles/mix2.dir/src/mix2.cpp.o.d" - ) - -# Targets to which this target links which contain Fortran sources. -set(CMAKE_Fortran_TARGET_LINKED_INFO_FILES - ) - -# Targets to which this target links which contain Fortran sources. -set(CMAKE_Fortran_TARGET_FORWARD_LINKED_INFO_FILES - ) - -# Fortran module output directory. -set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/build/CMakeFiles/mix2.dir/build.make b/build/CMakeFiles/mix2.dir/build.make deleted file mode 100644 index 3258e2a..0000000 --- a/build/CMakeFiles/mix2.dir/build.make +++ /dev/null @@ -1,110 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.30 - -# Delete rule output on recipe failure. -.DELETE_ON_ERROR: - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Disable VCS-based implicit rules. -% : %,v - -# Disable VCS-based implicit rules. -% : RCS/% - -# Disable VCS-based implicit rules. -% : RCS/%,v - -# Disable VCS-based implicit rules. -% : SCCS/s.% - -# Disable VCS-based implicit rules. -% : s.% - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Command-line flag to silence nested $(MAKE). -$(VERBOSE)MAKESILENT = -s - -#Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/local/Cellar/cmake/3.30.5/bin/cmake - -# The command to remove a file. -RM = /usr/local/Cellar/cmake/3.30.5/bin/cmake -E rm -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /Users/reetnandy/vscode/OS_HW_2 - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /Users/reetnandy/vscode/OS_HW_2/build - -# Include any dependencies generated for this target. -include CMakeFiles/mix2.dir/depend.make -# Include any dependencies generated by the compiler for this target. -include CMakeFiles/mix2.dir/compiler_depend.make - -# Include the progress variables for this target. -include CMakeFiles/mix2.dir/progress.make - -# Include the compile flags for this target's objects. -include CMakeFiles/mix2.dir/flags.make - -CMakeFiles/mix2.dir/src/mix2.cpp.o: CMakeFiles/mix2.dir/flags.make -CMakeFiles/mix2.dir/src/mix2.cpp.o: /Users/reetnandy/vscode/OS_HW_2/src/mix2.cpp -CMakeFiles/mix2.dir/src/mix2.cpp.o: CMakeFiles/mix2.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/mix2.dir/src/mix2.cpp.o" - /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/mix2.dir/src/mix2.cpp.o -MF CMakeFiles/mix2.dir/src/mix2.cpp.o.d -o CMakeFiles/mix2.dir/src/mix2.cpp.o -c /Users/reetnandy/vscode/OS_HW_2/src/mix2.cpp - -CMakeFiles/mix2.dir/src/mix2.cpp.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/mix2.dir/src/mix2.cpp.i" - /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/reetnandy/vscode/OS_HW_2/src/mix2.cpp > CMakeFiles/mix2.dir/src/mix2.cpp.i - -CMakeFiles/mix2.dir/src/mix2.cpp.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/mix2.dir/src/mix2.cpp.s" - /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/reetnandy/vscode/OS_HW_2/src/mix2.cpp -o CMakeFiles/mix2.dir/src/mix2.cpp.s - -# Object files for target mix2 -mix2_OBJECTS = \ -"CMakeFiles/mix2.dir/src/mix2.cpp.o" - -# External object files for target mix2 -mix2_EXTERNAL_OBJECTS = - -mix2: CMakeFiles/mix2.dir/src/mix2.cpp.o -mix2: CMakeFiles/mix2.dir/build.make -mix2: CMakeFiles/mix2.dir/link.txt - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=/Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable mix2" - $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/mix2.dir/link.txt --verbose=$(VERBOSE) - -# Rule to build all files generated by this target. -CMakeFiles/mix2.dir/build: mix2 -.PHONY : CMakeFiles/mix2.dir/build - -CMakeFiles/mix2.dir/clean: - $(CMAKE_COMMAND) -P CMakeFiles/mix2.dir/cmake_clean.cmake -.PHONY : CMakeFiles/mix2.dir/clean - -CMakeFiles/mix2.dir/depend: - cd /Users/reetnandy/vscode/OS_HW_2/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/reetnandy/vscode/OS_HW_2 /Users/reetnandy/vscode/OS_HW_2 /Users/reetnandy/vscode/OS_HW_2/build /Users/reetnandy/vscode/OS_HW_2/build /Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles/mix2.dir/DependInfo.cmake "--color=$(COLOR)" -.PHONY : CMakeFiles/mix2.dir/depend - diff --git a/build/CMakeFiles/mix2.dir/cmake_clean.cmake b/build/CMakeFiles/mix2.dir/cmake_clean.cmake deleted file mode 100644 index 1970aed..0000000 --- a/build/CMakeFiles/mix2.dir/cmake_clean.cmake +++ /dev/null @@ -1,11 +0,0 @@ -file(REMOVE_RECURSE - "CMakeFiles/mix2.dir/src/mix2.cpp.o" - "CMakeFiles/mix2.dir/src/mix2.cpp.o.d" - "mix2" - "mix2.pdb" -) - -# Per-language clean rules from dependency scanning. -foreach(lang CXX) - include(CMakeFiles/mix2.dir/cmake_clean_${lang}.cmake OPTIONAL) -endforeach() diff --git a/build/CMakeFiles/mix2.dir/compiler_depend.make b/build/CMakeFiles/mix2.dir/compiler_depend.make deleted file mode 100644 index 9cc2b93..0000000 --- a/build/CMakeFiles/mix2.dir/compiler_depend.make +++ /dev/null @@ -1,2 +0,0 @@ -# Empty compiler generated dependencies file for mix2. -# This may be replaced when dependencies are built. diff --git a/build/CMakeFiles/mix2.dir/compiler_depend.ts b/build/CMakeFiles/mix2.dir/compiler_depend.ts deleted file mode 100644 index 737005b..0000000 --- a/build/CMakeFiles/mix2.dir/compiler_depend.ts +++ /dev/null @@ -1,2 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Timestamp file for compiler generated dependencies management for mix2. diff --git a/build/CMakeFiles/mix2.dir/depend.make b/build/CMakeFiles/mix2.dir/depend.make deleted file mode 100644 index 7106a5e..0000000 --- a/build/CMakeFiles/mix2.dir/depend.make +++ /dev/null @@ -1,2 +0,0 @@ -# Empty dependencies file for mix2. -# This may be replaced when dependencies are built. diff --git a/build/CMakeFiles/mix2.dir/flags.make b/build/CMakeFiles/mix2.dir/flags.make deleted file mode 100644 index 924af7b..0000000 --- a/build/CMakeFiles/mix2.dir/flags.make +++ /dev/null @@ -1,10 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.30 - -# compile CXX with /Library/Developer/CommandLineTools/usr/bin/c++ -CXX_DEFINES = - -CXX_INCLUDES = - -CXX_FLAGS = -std=gnu++11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk - diff --git a/build/CMakeFiles/mix2.dir/link.txt b/build/CMakeFiles/mix2.dir/link.txt deleted file mode 100644 index ce51ab5..0000000 --- a/build/CMakeFiles/mix2.dir/link.txt +++ /dev/null @@ -1 +0,0 @@ -/Library/Developer/CommandLineTools/usr/bin/c++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/mix2.dir/src/mix2.cpp.o -o mix2 diff --git a/build/CMakeFiles/mix2.dir/progress.make b/build/CMakeFiles/mix2.dir/progress.make deleted file mode 100644 index 2513171..0000000 --- a/build/CMakeFiles/mix2.dir/progress.make +++ /dev/null @@ -1,3 +0,0 @@ -CMAKE_PROGRESS_1 = 2 -CMAKE_PROGRESS_2 = 3 - diff --git a/build/CMakeFiles/progress.marks b/build/CMakeFiles/progress.marks deleted file mode 100644 index 00750ed..0000000 --- a/build/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/build/CTestTestfile.cmake b/build/CTestTestfile.cmake deleted file mode 100644 index 8edcb4e..0000000 --- a/build/CTestTestfile.cmake +++ /dev/null @@ -1,150 +0,0 @@ -# CMake generated Testfile for -# Source directory: /Users/reetnandy/vscode/OS_HW_2 -# Build directory: /Users/reetnandy/vscode/OS_HW_2/build -# -# This file includes the relevant testing commands required for -# testing this directory and lists subdirectories to be tested as well. -add_test(Test_files/flow1_flow "bash" "-c" " - echo '=== Running Test_files/flow1_flow ==='; - echo 'Running mix with files/flow1.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow1.flow doit > Test_files/flow1_flow_actual_output.txt; - echo 'Expected output from command:'; - ls | wc > Test_files/flow1_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow1_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow1_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow1_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") -add_test(Test_files/flow2_flow "bash" "-c" " - echo '=== Running Test_files/flow2_flow ==='; - echo 'Running mix with files/flow2.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow2.flow shenanigan > Test_files/flow2_flow_actual_output.txt; - echo 'Expected output from command:'; - (cat /Users/reetnandy/vscode/OS_HW_2/files/foo.txt ; cat /Users/reetnandy/vscode/OS_HW_2/files/foo.txt | sed 's/o/u/g') | wc > Test_files/flow2_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow2_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow2_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow2_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") -add_test(Test_files/flow3_flow "bash" "-c" " - echo '=== Running Test_files/flow3_flow ==='; - echo 'Running mix with files/flow3.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow3.flow doit > Test_files/flow3_flow_actual_output.txt; - echo 'Expected output from command:'; - ls -l | ls > Test_files/flow3_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow3_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow3_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow3_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") -add_test(Test_files/flow4_flow "bash" "-c" " - echo '=== Running Test_files/flow4_flow ==='; - echo 'Running mix with files/flow4.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow4.flow doit > Test_files/flow4_flow_actual_output.txt; - echo 'Expected output from command:'; - ls ; ls -l > Test_files/flow4_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow4_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow4_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow4_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") -add_test(Test_files/flow5_flow "bash" "-c" " - echo '=== Running Test_files/flow5_flow ==='; - echo 'Running mix with files/flow5.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow5.flow pipe3 > Test_files/flow5_flow_actual_output.txt; - echo 'Expected output from command:'; - ls | grep '.cpp' | wc > Test_files/flow5_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow5_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow5_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow5_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") -add_test(Test_files/flow8_flow "bash" "-c" " - echo '=== Running Test_files/flow8_flow ==='; - echo 'Running mix with files/flow8.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow8.flow concat1 > Test_files/flow8_flow_actual_output.txt; - echo 'Expected output from command:'; - ls ; ls > Test_files/flow8_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow8_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow8_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow8_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") -add_test(Test_files/flow9_flow "bash" "-c" " - echo '=== Running Test_files/flow9_flow ==='; - echo 'Running mix with files/flow9.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow9.flow concat_echoes > Test_files/flow9_flow_actual_output.txt; - echo 'Expected output from command:'; - echo 'f o o' ; echo 'f o o' ; echo 'f o o' ; echo 'f o o' ; echo 'f o o' > Test_files/flow9_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow9_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow9_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow9_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") -add_test(Test_files/flow10_flow "bash" "-c" " - echo '=== Running Test_files/flow10_flow ==='; - echo 'Running mix with files/flow10.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow10.flow concat_ultimate > Test_files/flow10_flow_actual_output.txt; - echo 'Expected output from command:'; - echo 'Command One Executed.' ; echo 'Command One Executed.' ; echo 'Command Two Executed.' ; echo 'Command Three Executed.' ; echo 'Command Four Executed.' ; echo 'Command Four Executed.' ; echo 'Command One Executed.' ; echo 'Command Two Executed.' > Test_files/flow10_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow10_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow10_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow10_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") -add_test(Test_files/flow11_flow "bash" "-c" " - echo '=== Running Test_files/flow11_flow ==='; - echo 'Running mix with files/flow11.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow11.flow unique_numbers > Test_files/flow11_flow_actual_output.txt; - echo 'Expected output from command:'; - (seq 1 5 | awk '{print \$1*\$1}' ; seq 1 5 | awk '{print \$1*2}' ; seq 1 5 | awk '{print \$1+5}') | sort -n | uniq > Test_files/flow11_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow11_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow11_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow11_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") -add_test(Test_files/flow12_flow "bash" "-c" " - echo '=== Running Test_files/flow12_flow ==='; - echo 'Running mix with files/flow12.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow12.flow catch_errors > Test_files/flow12_flow_actual_output.txt; - echo 'Expected output from command:'; - mkdir a 2>&1 | wc > Test_files/flow12_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow12_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow12_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow12_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") -add_test(Test_files/flow14_flow "bash" "-c" " - echo '=== Running Test_files/flow14_flow ==='; - echo 'Running mix with files/flow14.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow14.flow process_pipe > Test_files/flow14_flow_actual_output.txt; - echo 'Expected output from command:'; - ls > output.txt > Test_files/flow14_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow14_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow14_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow14_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") -add_test(Test_files/flow13_flow "bash" "-c" " - echo '=== Running Test_files/flow13_flow ==='; - echo 'Running mix with files/flow13.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow13.flow process_pipe > Test_files/flow13_flow_actual_output.txt; - echo 'Expected output from command:'; - cat output.txt | wc > Test_files/flow13_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow13_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow13_flow_expected_output.txt; - ") -set_tests_properties(Test_files/flow13_flow PROPERTIES PASS_REGULAR_EXPRESSION ".*" _BACKTRACE_TRIPLES "/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;102;add_test;/Users/reetnandy/vscode/OS_HW_2/CMakeLists.txt;0;") diff --git a/build/Makefile b/build/Makefile deleted file mode 100644 index 92741e5..0000000 --- a/build/Makefile +++ /dev/null @@ -1,206 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.30 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -# Allow only one "make -f Makefile2" at a time, but pass parallelism. -.NOTPARALLEL: - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Disable VCS-based implicit rules. -% : %,v - -# Disable VCS-based implicit rules. -% : RCS/% - -# Disable VCS-based implicit rules. -% : RCS/%,v - -# Disable VCS-based implicit rules. -% : SCCS/s.% - -# Disable VCS-based implicit rules. -% : s.% - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Command-line flag to silence nested $(MAKE). -$(VERBOSE)MAKESILENT = -s - -#Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/local/Cellar/cmake/3.30.5/bin/cmake - -# The command to remove a file. -RM = /usr/local/Cellar/cmake/3.30.5/bin/cmake -E rm -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /Users/reetnandy/vscode/OS_HW_2 - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /Users/reetnandy/vscode/OS_HW_2/build - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target test -test: - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running tests..." - /usr/local/Cellar/cmake/3.30.5/bin/ctest --force-new-ctest-process $(ARGS) -.PHONY : test - -# Special rule for the target test -test/fast: test -.PHONY : test/fast - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..." - /usr/local/Cellar/cmake/3.30.5/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..." - /usr/local/Cellar/cmake/3.30.5/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles /Users/reetnandy/vscode/OS_HW_2/build//CMakeFiles/progress.marks - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all - $(CMAKE_COMMAND) -E cmake_progress_start /Users/reetnandy/vscode/OS_HW_2/build/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -#============================================================================= -# Target rules for targets named mix2 - -# Build rule for target. -mix2: cmake_check_build_system - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 mix2 -.PHONY : mix2 - -# fast build rule for target. -mix2/fast: - $(MAKE) $(MAKESILENT) -f CMakeFiles/mix2.dir/build.make CMakeFiles/mix2.dir/build -.PHONY : mix2/fast - -#============================================================================= -# Target rules for targets named clean_mix2 - -# Build rule for target. -clean_mix2: cmake_check_build_system - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean_mix2 -.PHONY : clean_mix2 - -# fast build rule for target. -clean_mix2/fast: - $(MAKE) $(MAKESILENT) -f CMakeFiles/clean_mix2.dir/build.make CMakeFiles/clean_mix2.dir/build -.PHONY : clean_mix2/fast - -src/mix2.o: src/mix2.cpp.o -.PHONY : src/mix2.o - -# target to build an object file -src/mix2.cpp.o: - $(MAKE) $(MAKESILENT) -f CMakeFiles/mix2.dir/build.make CMakeFiles/mix2.dir/src/mix2.cpp.o -.PHONY : src/mix2.cpp.o - -src/mix2.i: src/mix2.cpp.i -.PHONY : src/mix2.i - -# target to preprocess a source file -src/mix2.cpp.i: - $(MAKE) $(MAKESILENT) -f CMakeFiles/mix2.dir/build.make CMakeFiles/mix2.dir/src/mix2.cpp.i -.PHONY : src/mix2.cpp.i - -src/mix2.s: src/mix2.cpp.s -.PHONY : src/mix2.s - -# target to generate assembly for a file -src/mix2.cpp.s: - $(MAKE) $(MAKESILENT) -f CMakeFiles/mix2.dir/build.make CMakeFiles/mix2.dir/src/mix2.cpp.s -.PHONY : src/mix2.cpp.s - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... rebuild_cache" - @echo "... test" - @echo "... clean_mix2" - @echo "... mix2" - @echo "... src/mix2.o" - @echo "... src/mix2.i" - @echo "... src/mix2.s" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/build/Testing/Temporary/CTestCostData.txt b/build/Testing/Temporary/CTestCostData.txt deleted file mode 100644 index 1bbd302..0000000 --- a/build/Testing/Temporary/CTestCostData.txt +++ /dev/null @@ -1,13 +0,0 @@ -Test_files/flow1_flow 1 0.0309353 -Test_files/flow2_flow 1 0.0369551 -Test_files/flow3_flow 1 0.030214 -Test_files/flow4_flow 1 0.0275901 -Test_files/flow5_flow 1 0.0274874 -Test_files/flow8_flow 1 0.0297966 -Test_files/flow9_flow 1 0.0202478 -Test_files/flow10_flow 1 0.0207895 -Test_files/flow11_flow 1 0.0463894 -Test_files/flow12_flow 1 0.0264338 -Test_files/flow14_flow 1 0.0211962 -Test_files/flow13_flow 1 0.0265988 ---- diff --git a/build/Testing/Temporary/LastTest.log b/build/Testing/Temporary/LastTest.log deleted file mode 100644 index d2d2bed..0000000 --- a/build/Testing/Temporary/LastTest.log +++ /dev/null @@ -1,470 +0,0 @@ -Start testing: Oct 28 19:45 EDT ----------------------------------------------------------- -1/12 Testing: Test_files/flow1_flow -1/12 Test: Test_files/flow1_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow1_flow ==='; - echo 'Running mix with files/flow1.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow1.flow doit > Test_files/flow1_flow_actual_output.txt; - echo 'Expected output from command:'; - ls | wc > Test_files/flow1_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow1_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow1_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow1_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow1_flow === -Running mix with files/flow1.flow: -/bin/bash: line 3: Test_files/flow1_flow_actual_output.txt: No such file or directory -Expected output from command: -/bin/bash: line 5: Test_files/flow1_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow1_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow1_flow_expected_output.txt: No such file or directory - -Test time = 0.03 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow1_flow" end time: Oct 28 19:45 EDT -"Test_files/flow1_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -2/12 Testing: Test_files/flow2_flow -2/12 Test: Test_files/flow2_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow2_flow ==='; - echo 'Running mix with files/flow2.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow2.flow shenanigan > Test_files/flow2_flow_actual_output.txt; - echo 'Expected output from command:'; - (cat /Users/reetnandy/vscode/OS_HW_2/files/foo.txt ; cat /Users/reetnandy/vscode/OS_HW_2/files/foo.txt | sed 's/o/u/g') | wc > Test_files/flow2_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow2_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow2_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow2_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow2_flow === -Running mix with files/flow2.flow: -/bin/bash: line 3: Test_files/flow2_flow_actual_output.txt: No such file or directory -Expected output from command: -/bin/bash: line 5: Test_files/flow2_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow2_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow2_flow_expected_output.txt: No such file or directory - -Test time = 0.04 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow2_flow" end time: Oct 28 19:45 EDT -"Test_files/flow2_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -3/12 Testing: Test_files/flow3_flow -3/12 Test: Test_files/flow3_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow3_flow ==='; - echo 'Running mix with files/flow3.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow3.flow doit > Test_files/flow3_flow_actual_output.txt; - echo 'Expected output from command:'; - ls -l | ls > Test_files/flow3_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow3_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow3_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow3_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow3_flow === -Running mix with files/flow3.flow: -/bin/bash: line 3: Test_files/flow3_flow_actual_output.txt: No such file or directory -Expected output from command: -/bin/bash: line 5: Test_files/flow3_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow3_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow3_flow_expected_output.txt: No such file or directory - -Test time = 0.03 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow3_flow" end time: Oct 28 19:45 EDT -"Test_files/flow3_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -4/12 Testing: Test_files/flow4_flow -4/12 Test: Test_files/flow4_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow4_flow ==='; - echo 'Running mix with files/flow4.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow4.flow doit > Test_files/flow4_flow_actual_output.txt; - echo 'Expected output from command:'; - ls ; ls -l > Test_files/flow4_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow4_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow4_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow4_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow4_flow === -Running mix with files/flow4.flow: -/bin/bash: line 3: Test_files/flow4_flow_actual_output.txt: No such file or directory -Expected output from command: -CMakeCache.txt -CMakeFiles -CTestTestfile.cmake -Makefile -Testing -cmake_install.cmake -flow -flow2 -flow3 -flow4 -flow5 -flow6 -flow7 -flow7_1 -flow8 -mix -mix2 -parse -/bin/bash: line 5: Test_files/flow4_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow4_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow4_flow_expected_output.txt: No such file or directory - -Test time = 0.03 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow4_flow" end time: Oct 28 19:45 EDT -"Test_files/flow4_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -5/12 Testing: Test_files/flow5_flow -5/12 Test: Test_files/flow5_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow5_flow ==='; - echo 'Running mix with files/flow5.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow5.flow pipe3 > Test_files/flow5_flow_actual_output.txt; - echo 'Expected output from command:'; - ls | grep '.cpp' | wc > Test_files/flow5_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow5_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow5_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow5_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow5_flow === -Running mix with files/flow5.flow: -/bin/bash: line 3: Test_files/flow5_flow_actual_output.txt: No such file or directory -Expected output from command: -/bin/bash: line 5: Test_files/flow5_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow5_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow5_flow_expected_output.txt: No such file or directory - -Test time = 0.03 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow5_flow" end time: Oct 28 19:45 EDT -"Test_files/flow5_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -6/12 Testing: Test_files/flow8_flow -6/12 Test: Test_files/flow8_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow8_flow ==='; - echo 'Running mix with files/flow8.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow8.flow concat1 > Test_files/flow8_flow_actual_output.txt; - echo 'Expected output from command:'; - ls ; ls > Test_files/flow8_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow8_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow8_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow8_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow8_flow === -Running mix with files/flow8.flow: -/bin/bash: line 3: Test_files/flow8_flow_actual_output.txt: No such file or directory -Expected output from command: -CMakeCache.txt -CMakeFiles -CTestTestfile.cmake -Makefile -Testing -cmake_install.cmake -flow -flow2 -flow3 -flow4 -flow5 -flow6 -flow7 -flow7_1 -flow8 -mix -mix2 -parse -/bin/bash: line 5: Test_files/flow8_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow8_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow8_flow_expected_output.txt: No such file or directory - -Test time = 0.03 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow8_flow" end time: Oct 28 19:45 EDT -"Test_files/flow8_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -7/12 Testing: Test_files/flow9_flow -7/12 Test: Test_files/flow9_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow9_flow ==='; - echo 'Running mix with files/flow9.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow9.flow concat_echoes > Test_files/flow9_flow_actual_output.txt; - echo 'Expected output from command:'; - echo 'f o o' ; echo 'f o o' ; echo 'f o o' ; echo 'f o o' ; echo 'f o o' > Test_files/flow9_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow9_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow9_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow9_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow9_flow === -Running mix with files/flow9.flow: -/bin/bash: line 3: Test_files/flow9_flow_actual_output.txt: No such file or directory -Expected output from command: -f o o -f o o -f o o -f o o -/bin/bash: line 5: Test_files/flow9_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow9_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow9_flow_expected_output.txt: No such file or directory - -Test time = 0.02 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow9_flow" end time: Oct 28 19:45 EDT -"Test_files/flow9_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -8/12 Testing: Test_files/flow10_flow -8/12 Test: Test_files/flow10_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow10_flow ==='; - echo 'Running mix with files/flow10.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow10.flow concat_ultimate > Test_files/flow10_flow_actual_output.txt; - echo 'Expected output from command:'; - echo 'Command One Executed.' ; echo 'Command One Executed.' ; echo 'Command Two Executed.' ; echo 'Command Three Executed.' ; echo 'Command Four Executed.' ; echo 'Command Four Executed.' ; echo 'Command One Executed.' ; echo 'Command Two Executed.' > Test_files/flow10_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow10_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow10_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow10_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow10_flow === -Running mix with files/flow10.flow: -/bin/bash: line 3: Test_files/flow10_flow_actual_output.txt: No such file or directory -Expected output from command: -Command One Executed. -Command One Executed. -Command Two Executed. -Command Three Executed. -Command Four Executed. -Command Four Executed. -Command One Executed. -/bin/bash: line 5: Test_files/flow10_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow10_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow10_flow_expected_output.txt: No such file or directory - -Test time = 0.02 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow10_flow" end time: Oct 28 19:45 EDT -"Test_files/flow10_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -9/12 Testing: Test_files/flow11_flow -9/12 Test: Test_files/flow11_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow11_flow ==='; - echo 'Running mix with files/flow11.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow11.flow unique_numbers > Test_files/flow11_flow_actual_output.txt; - echo 'Expected output from command:'; - (seq 1 5 | awk '{print $1*$1}' ; seq 1 5 | awk '{print $1*2}' ; seq 1 5 | awk '{print $1+5}') | sort -n | uniq > Test_files/flow11_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow11_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow11_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow11_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow11_flow === -Running mix with files/flow11.flow: -/bin/bash: line 3: Test_files/flow11_flow_actual_output.txt: No such file or directory -Expected output from command: -/bin/bash: line 5: Test_files/flow11_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow11_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow11_flow_expected_output.txt: No such file or directory - -Test time = 0.05 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow11_flow" end time: Oct 28 19:45 EDT -"Test_files/flow11_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -10/12 Testing: Test_files/flow12_flow -10/12 Test: Test_files/flow12_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow12_flow ==='; - echo 'Running mix with files/flow12.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow12.flow catch_errors > Test_files/flow12_flow_actual_output.txt; - echo 'Expected output from command:'; - mkdir a 2>&1 | wc > Test_files/flow12_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow12_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow12_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow12_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow12_flow === -Running mix with files/flow12.flow: -/bin/bash: line 3: Test_files/flow12_flow_actual_output.txt: No such file or directory -Expected output from command: -/bin/bash: line 5: Test_files/flow12_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow12_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow12_flow_expected_output.txt: No such file or directory - -Test time = 0.03 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow12_flow" end time: Oct 28 19:45 EDT -"Test_files/flow12_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -11/12 Testing: Test_files/flow14_flow -11/12 Test: Test_files/flow14_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow14_flow ==='; - echo 'Running mix with files/flow14.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow14.flow process_pipe > Test_files/flow14_flow_actual_output.txt; - echo 'Expected output from command:'; - ls > output.txt > Test_files/flow14_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow14_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow14_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow14_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow14_flow === -Running mix with files/flow14.flow: -/bin/bash: line 3: Test_files/flow14_flow_actual_output.txt: No such file or directory -Expected output from command: -/bin/bash: line 5: Test_files/flow14_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow14_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow14_flow_expected_output.txt: No such file or directory - -Test time = 0.02 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow14_flow" end time: Oct 28 19:45 EDT -"Test_files/flow14_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -12/12 Testing: Test_files/flow13_flow -12/12 Test: Test_files/flow13_flow -Command: "/bin/bash" "-c" " - echo '=== Running Test_files/flow13_flow ==='; - echo 'Running mix with files/flow13.flow:'; - /Users/reetnandy/vscode/OS_HW_2/mix files/flow13.flow process_pipe > Test_files/flow13_flow_actual_output.txt; - echo 'Expected output from command:'; - cat output.txt | wc > Test_files/flow13_flow_expected_output.txt; - echo '--- Actual Output ---'; - cat Test_files/flow13_flow_actual_output.txt; - echo '--- Expected Output ---'; - cat Test_files/flow13_flow_expected_output.txt; - " -Directory: /Users/reetnandy/vscode/OS_HW_2/build -"Test_files/flow13_flow" start time: Oct 28 19:45 EDT -Output: ----------------------------------------------------------- -=== Running Test_files/flow13_flow === -Running mix with files/flow13.flow: -/bin/bash: line 3: Test_files/flow13_flow_actual_output.txt: No such file or directory -Expected output from command: -/bin/bash: line 5: Test_files/flow13_flow_expected_output.txt: No such file or directory ---- Actual Output --- -cat: Test_files/flow13_flow_actual_output.txt: No such file or directory ---- Expected Output --- -cat: Test_files/flow13_flow_expected_output.txt: No such file or directory - -Test time = 0.03 sec ----------------------------------------------------------- -Test Pass Reason: -Required regular expression found. Regex=[.*] -"Test_files/flow13_flow" end time: Oct 28 19:45 EDT -"Test_files/flow13_flow" time elapsed: 00:00:00 ----------------------------------------------------------- - -End testing: Oct 28 19:45 EDT diff --git a/build/cmake_install.cmake b/build/cmake_install.cmake deleted file mode 100644 index ffec26e..0000000 --- a/build/cmake_install.cmake +++ /dev/null @@ -1,57 +0,0 @@ -# Install script for directory: /Users/reetnandy/vscode/OS_HW_2 - -# Set the install prefix -if(NOT DEFINED CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX "/usr/local") -endif() -string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") - -# Set the install configuration name. -if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) - if(BUILD_TYPE) - string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" - CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") - else() - set(CMAKE_INSTALL_CONFIG_NAME "") - endif() - message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") -endif() - -# Set the component getting installed. -if(NOT CMAKE_INSTALL_COMPONENT) - if(COMPONENT) - message(STATUS "Install component: \"${COMPONENT}\"") - set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") - else() - set(CMAKE_INSTALL_COMPONENT) - endif() -endif() - -# Is this installation the result of a crosscompile? -if(NOT DEFINED CMAKE_CROSSCOMPILING) - set(CMAKE_CROSSCOMPILING "FALSE") -endif() - -# Set path to fallback-tool for dependency-resolution. -if(NOT DEFINED CMAKE_OBJDUMP) - set(CMAKE_OBJDUMP "/Library/Developer/CommandLineTools/usr/bin/objdump") -endif() - -if(CMAKE_INSTALL_COMPONENT) - if(CMAKE_INSTALL_COMPONENT MATCHES "^[a-zA-Z0-9_.+-]+$") - set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") - else() - string(MD5 CMAKE_INST_COMP_HASH "${CMAKE_INSTALL_COMPONENT}") - set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INST_COMP_HASH}.txt") - unset(CMAKE_INST_COMP_HASH) - endif() -else() - set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") -endif() - -if(NOT CMAKE_INSTALL_LOCAL_ONLY) - string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT - "${CMAKE_INSTALL_MANIFEST_FILES}") - file(WRITE "/Users/reetnandy/vscode/OS_HW_2/build/${CMAKE_INSTALL_MANIFEST}" - "${CMAKE_INSTALL_MANIFEST_CONTENT}") -endif() diff --git a/build/flow b/build/flow deleted file mode 100755 index 20abd85..0000000 Binary files a/build/flow and /dev/null differ diff --git a/build/flow2 b/build/flow2 deleted file mode 100755 index c959a59..0000000 Binary files a/build/flow2 and /dev/null differ diff --git a/build/flow3 b/build/flow3 deleted file mode 100755 index 9da01a8..0000000 Binary files a/build/flow3 and /dev/null differ diff --git a/build/flow4 b/build/flow4 deleted file mode 100755 index b0f69ce..0000000 Binary files a/build/flow4 and /dev/null differ diff --git a/build/flow5 b/build/flow5 deleted file mode 100755 index 1e4ba01..0000000 Binary files a/build/flow5 and /dev/null differ diff --git a/build/flow6 b/build/flow6 deleted file mode 100755 index b97fec8..0000000 Binary files a/build/flow6 and /dev/null differ diff --git a/build/flow7 b/build/flow7 deleted file mode 100755 index 9a88c98..0000000 Binary files a/build/flow7 and /dev/null differ diff --git a/build/flow7_1 b/build/flow7_1 deleted file mode 100755 index 24ddc54..0000000 Binary files a/build/flow7_1 and /dev/null differ diff --git a/build/flow8 b/build/flow8 deleted file mode 100755 index 8541faa..0000000 Binary files a/build/flow8 and /dev/null differ diff --git a/build/mix b/build/mix deleted file mode 100755 index 52ccbc5..0000000 Binary files a/build/mix and /dev/null differ diff --git a/build/mix2 b/build/mix2 deleted file mode 100755 index fde7946..0000000 Binary files a/build/mix2 and /dev/null differ diff --git a/build/mix3 b/build/mix3 deleted file mode 100755 index 21731ed..0000000 Binary files a/build/mix3 and /dev/null differ diff --git a/build/parse b/build/parse deleted file mode 100755 index fa8535c..0000000 Binary files a/build/parse and /dev/null differ diff --git a/src/.DS_Store b/files/.DS_Store similarity index 84% rename from src/.DS_Store rename to files/.DS_Store index 2adf6af..00c9c61 100644 Binary files a/src/.DS_Store and b/files/.DS_Store differ diff --git a/files/0.flow b/files/0.flow new file mode 100644 index 0000000..a465942 --- /dev/null +++ b/files/0.flow @@ -0,0 +1,17 @@ +node=list_files +command=ls + +node=word_count +command=wc + +node=path +command=pwd + +pipe=pipe1 +from=list_files +to=word_count + +concatenate=doit +parts=2 +part_0=pipe1 +part_1=path \ No newline at end of file diff --git a/files/flow1.flow b/files/1.flow similarity index 100% rename from files/flow1.flow rename to files/1.flow diff --git a/files/10.flow b/files/10.flow new file mode 100644 index 0000000..3320152 --- /dev/null +++ b/files/10.flow @@ -0,0 +1,18 @@ +node=echo1 +command=echo foo1 + +node=echo2 +command=echo 'foo2' + +node=echo3 +command=echo "foo3" + +node=echo4 +command=echo 'f o o 4' + +concatenate=doit +parts=4 +part_0=echo1 +part_1=echo2 +part_2=echo3 +part_3=echo4 \ No newline at end of file diff --git a/files/11.flow b/files/11.flow new file mode 100644 index 0000000..a465942 --- /dev/null +++ b/files/11.flow @@ -0,0 +1,17 @@ +node=list_files +command=ls + +node=word_count +command=wc + +node=path +command=pwd + +pipe=pipe1 +from=list_files +to=word_count + +concatenate=doit +parts=2 +part_0=pipe1 +part_1=path \ No newline at end of file diff --git a/files/flow2.flow b/files/12.flow similarity index 93% rename from files/flow2.flow rename to files/12.flow index 1f378b5..d96c801 100644 --- a/files/flow2.flow +++ b/files/12.flow @@ -16,6 +16,6 @@ part_1=foo_to_fuu node=word_count command=wc -pipe=shenanigan +pipe=doit from=foo_then_fuu to=word_count \ No newline at end of file diff --git a/files/flow11.flow b/files/13.flow similarity index 96% rename from files/flow11.flow rename to files/13.flow index 4ba4e71..f5214e6 100644 --- a/files/flow11.flow +++ b/files/13.flow @@ -38,6 +38,6 @@ pipe=sorted_numbers from=processed_numbers to=sort_numbers -pipe=unique_numbers +pipe=doit from=sorted_numbers to=remove_duplicates \ No newline at end of file diff --git a/files/14.flow b/files/14.flow new file mode 100644 index 0000000..9ad2e91 --- /dev/null +++ b/files/14.flow @@ -0,0 +1,8 @@ +node=mkdir_attempt +command=mkdir a + +node=word_count +command=wc + +stderr=doit +from=mkdir_attempt \ No newline at end of file diff --git a/files/flow12.flow b/files/15.flow similarity index 90% rename from files/flow12.flow rename to files/15.flow index 482732d..6086411 100644 --- a/files/flow12.flow +++ b/files/15.flow @@ -7,6 +7,6 @@ command=wc stderr=stdout_to_stderr_for_mkdir from=mkdir_attempt -pipe=catch_errors +pipe=doit from=stdout_to_stderr_for_mkdir to=word_count \ No newline at end of file diff --git a/files/flow15.flow b/files/16.flow similarity index 87% rename from files/flow15.flow rename to files/16.flow index e78fb7f..cfebdfa 100644 --- a/files/flow15.flow +++ b/files/16.flow @@ -1,5 +1,5 @@ node=list_files -command=ls -l +command=ls file=output_file name=output.txt diff --git a/files/flow13.flow b/files/17.flow similarity index 90% rename from files/flow13.flow rename to files/17.flow index 817de23..36bd807 100644 --- a/files/flow13.flow +++ b/files/17.flow @@ -11,6 +11,6 @@ pipe=read_pipe from=input_file to=read_file -pipe=process_pipe +pipe=doit from=read_pipe to=word_count \ No newline at end of file diff --git a/files/2.flow b/files/2.flow new file mode 100644 index 0000000..924737c --- /dev/null +++ b/files/2.flow @@ -0,0 +1,9 @@ +node=list_files +command=ls -l + +node=word_count +command=wc + +pipe=doit +from=list_files +to=word_count \ No newline at end of file diff --git a/files/3.flow b/files/3.flow new file mode 100644 index 0000000..a9692c7 --- /dev/null +++ b/files/3.flow @@ -0,0 +1,9 @@ +node=list_files_l +command=ls -l + +node=list_files +command=ls + +pipe=doit +from=list_files_l +to=list_files \ No newline at end of file diff --git a/files/4.flow b/files/4.flow new file mode 100644 index 0000000..a07f5fa --- /dev/null +++ b/files/4.flow @@ -0,0 +1,9 @@ +node=foo +command=echo foo + +node=cat +command=cat + +pipe=doit +from=foo +to=cat \ No newline at end of file diff --git a/files/5.flow b/files/5.flow new file mode 100644 index 0000000..24d0423 --- /dev/null +++ b/files/5.flow @@ -0,0 +1,9 @@ +node=foo +command=echo 'foo' + +node=cat +command=cat + +pipe=doit +from=foo +to=cat \ No newline at end of file diff --git a/files/6.flow b/files/6.flow new file mode 100644 index 0000000..2041a6a --- /dev/null +++ b/files/6.flow @@ -0,0 +1,9 @@ +node=foo +command=echo "foo" + +node=cat +command=cat + +pipe=doit +from=foo +to=cat \ No newline at end of file diff --git a/files/7.flow b/files/7.flow new file mode 100644 index 0000000..0924325 --- /dev/null +++ b/files/7.flow @@ -0,0 +1,9 @@ +node=foo +command=echo 'f o o' + +node=cat +command=cat + +pipe=doit +from=foo +to=cat \ No newline at end of file diff --git a/files/8.flow b/files/8.flow new file mode 100644 index 0000000..a2b0367 --- /dev/null +++ b/files/8.flow @@ -0,0 +1,10 @@ +node=list_files +command=ls + +node=path +command=pwd + +concatenate=doit +parts=2 +part_0=list_files +part_1=path \ No newline at end of file diff --git a/files/9.flow b/files/9.flow new file mode 100644 index 0000000..a14ba66 --- /dev/null +++ b/files/9.flow @@ -0,0 +1,11 @@ +node=list_files +command=ls + +node=list_files_1 +command=ls -a + +concatenate=doit +parts=3 +part_0=list_files +part_1=list_files +part_2=list_files_1 \ No newline at end of file diff --git a/files/flow10.flow b/files/flow10.flow deleted file mode 100644 index d4b339e..0000000 --- a/files/flow10.flow +++ /dev/null @@ -1,37 +0,0 @@ -node=cmd_one -command=echo "Command One Executed." - -node=cmd_two -command=echo "Command Two Executed." - -node=cmd_three -command=echo "Command Three Executed." - -node=cmd_four -command=echo "Command Four Executed." - -concatenate=concat_basic -parts=2 -part_0=cmd_one -part_1=cmd_two - -concatenate=concat_another -parts=2 -part_0=cmd_three -part_1=cmd_four - -concatenate=concat_nested -parts=2 -part_0=concat_basic -part_1=concat_another - -concatenate=concat_super_nested -parts=3 -part_0=cmd_one -part_1=concat_nested -part_2=cmd_four - -concatenate=concat_ultimate -parts=2 -part_0=concat_super_nested -part_1=concat_basic \ No newline at end of file diff --git a/files/flow14.flow b/files/flow14.flow deleted file mode 100644 index 1d9ec27..0000000 --- a/files/flow14.flow +++ /dev/null @@ -1,13 +0,0 @@ -node=list_files -command=ls - -file=output_file -name=output.txt - -pipe=write_pipe -from=list_files -to=output_file - -pipe=process_pipe -from=list_files -to=write_pipe \ No newline at end of file diff --git a/files/flow3.flow b/files/flow3.flow deleted file mode 100644 index 5b25054..0000000 --- a/files/flow3.flow +++ /dev/null @@ -1,9 +0,0 @@ -node=list_files_1 -command=ls -l - -node=list_files_2 -command=ls - -pipe=doit -from=list_files_1 -to=list_files_2 \ No newline at end of file diff --git a/files/flow4.flow b/files/flow4.flow deleted file mode 100644 index ece046f..0000000 --- a/files/flow4.flow +++ /dev/null @@ -1,10 +0,0 @@ -node=list_files_1 -command=ls - -node=list_files_2 -command=ls -l - -concatenate=doit -parts=2 -part_0=list_files_1 -part_1=list_files_2 \ No newline at end of file diff --git a/files/flow5.flow b/files/flow5.flow deleted file mode 100644 index 126c785..0000000 --- a/files/flow5.flow +++ /dev/null @@ -1,16 +0,0 @@ -node=list_files -command=ls - -node=filter_cpp_files -command=grep ".cpp" - -node=count_files -command=wc - -pipe=pipe2 -from=list_files -to=filter_cpp_files - -pipe=pipe3 -from=pipe2 -to=count_files \ No newline at end of file diff --git a/files/flow6.flow b/files/flow6.flow deleted file mode 100644 index 12d0b56..0000000 --- a/files/flow6.flow +++ /dev/null @@ -1,20 +0,0 @@ -node=list_files -command=ls - -node=filter_cpp_files -command=grep ".cpp" - -node=count_files -command=wc - -pipe=pipe1 -from=list_files -to=filter_cpp_files - -pipe=pipe2 -from=count_files -to=count_files - -pipe=pipe3 -from=pipe1 -to=pipe2 \ No newline at end of file diff --git a/files/flow8.flow b/files/flow8.flow deleted file mode 100644 index 6185212..0000000 --- a/files/flow8.flow +++ /dev/null @@ -1,10 +0,0 @@ -node=list_files -command=ls - -node=list_files_2 -command=ls - -concatenate=concat1 -parts=2 -part_0=list_files -part_1=list_files_2 \ No newline at end of file diff --git a/files/flow9.flow b/files/flow9.flow deleted file mode 100644 index 663c655..0000000 --- a/files/flow9.flow +++ /dev/null @@ -1,22 +0,0 @@ -node=echo1 -command=echo 'f o o' - -node=echo2 -command=echo "f o o" - -node=echo3 -command=echo "f o o" - -node=echo4 -command=echo "foo" - -node=echo5 -command=echo 'f o o' - -concatenate=concat_echoes -parts=5 -part_0=echo1 -part_1=echo2 -part_2=echo3 -part_3=echo4 -part_4=echo5 \ No newline at end of file diff --git a/files/foo.txt b/files/foo.txt deleted file mode 100644 index 21cf5b3..0000000 --- a/files/foo.txt +++ /dev/null @@ -1 +0,0 @@ -f o o diff --git a/files/my_flow_file.flow b/files/my_flow_file.flow deleted file mode 100644 index aba5021..0000000 --- a/files/my_flow_file.flow +++ /dev/null @@ -1,40 +0,0 @@ -# Node 1: echo "foo bar baz" -node=echo_foo -command=echo "foo bar baz" - -# Node 2: cat (inside group) -node=cat_node -command=cat - -# Node 3: echo "another foo" (inside group) -node=echo_another -command=echo "another foo" - -# Node 4: sed 's/foo/FUU/g' (inside group) -node=sed_replace -command=sed 's/foo/FUU/g' - -# Pipe inside group: echo_another | sed_replace -pipe=another_to_sed -from=echo_another -to=sed_replace - -# Concatenation inside group: cat ; echo_another | sed_replace -concatenate=group_commands -parts=2 -part_0=cat_node -part_1=another_to_sed - -# Pipe from echo_foo to group_commands -pipe=foo_to_group -from=echo_foo -to=group_commands - -# Node 5: wc (final node) -node=word_count -command=wc - -# Pipe from group_commands to word_count -pipe=group_to_wc -from=group_commands -to=word_count diff --git a/flow b/flow new file mode 100755 index 0000000..1f2f904 Binary files /dev/null and b/flow differ diff --git a/flow.c b/flow.c deleted file mode 100644 index e384de1..0000000 --- a/flow.c +++ /dev/null @@ -1,305 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define MAX_COMMANDS 100 -#define MAX_NODES 100 -#define MAX_LEN 1024 - -// Structure for a node (command) -typedef struct { - char *name; - char *command[MAX_COMMANDS]; -} Node; - -// Structure for a pipe -typedef struct { - char *from; - char *to; -} FlowPipe; - -// Structure for a concatenation -typedef struct { - char *name; // Name of the concatenation - char *parts[MAX_NODES]; - int part_count; -} Concatenate; - -// Global arrays to store nodes, pipes, and concatenations -Node nodes[MAX_NODES]; -FlowPipe pipes[MAX_NODES]; -Concatenate concatenations[MAX_NODES]; -int node_count = 0, pipe_count = 0, concat_count = 0; - -// Function to find a node by its name -int find_node_by_name(char *name) { - printf("Debug: Entered find_node_by_name with name=%s\n", name); - for (int i = 0; i < node_count; i++) { - if (strcmp(nodes[i].name, name) == 0) { - printf("Debug: Found node %s\n", name); - return i; - } - } - printf("Debug: Node %s not found\n", name); - return -1; -} - -void parse_node(char *line, FILE *flow_file) { - printf("Debug: Entered parse_node with line=%s\n", line); - char name[MAX_LEN], command[MAX_LEN]; - - // Extract the node name - sscanf(line, "node=%s", name); - - // Read the command line from the flow file (not stdin) - if (fgets(line, MAX_LEN, flow_file) == NULL) { - printf("Debug: Error reading command line\n"); - return; - } - sscanf(line, "command=%[^\n]", command); - - // Store the node information - nodes[node_count].name = strdup(name); - char *token = strtok(command, " "); - int i = 0; - while (token != NULL) { - nodes[node_count].command[i++] = strdup(token); - token = strtok(NULL, " "); - } - nodes[node_count].command[i] = NULL; - printf("Debug: Parsed node %s with command %s\n", name, command); - node_count++; -} - -// Function to parse a pipe -void parse_pipe(char *line, FILE *flow_file) { - printf("Debug: Entered parse_pipe with line=%s\n", line); - char pipe_name[MAX_LEN], from[MAX_LEN], to[MAX_LEN]; - - // Parse the pipe name (if necessary) - if (sscanf(line, "pipe=%s", pipe_name) != 1) { - printf("Debug: Error parsing pipe name: %s\n", line); - return; - } - - // Read the 'from' line - if (fgets(line, MAX_LEN, flow_file) == NULL) { - printf("Debug: Error reading 'from' line\n"); - return; - } - sscanf(line, "from=%s", from); - - // Read the 'to' line - if (fgets(line, MAX_LEN, flow_file) == NULL) { - printf("Debug: Error reading 'to' line\n"); - return; - } - sscanf(line, "to=%s", to); - - pipes[pipe_count].from = strdup(from); - pipes[pipe_count].to = strdup(to); - printf("Debug: Parsed pipe from %s to %s\n", from, to); - pipe_count++; -} - -// Function to parse a concatenation -void parse_concatenate(char *line, FILE *flow_file) { - printf("Debug: Entered parse_concatenate with line=%s\n", line); - - int parts; - char name[MAX_LEN]; - - // Parse the concatenation name and the number of parts - if (sscanf(line, "concatenate=%s parts=%d", name, &parts) != 2) { - printf("Debug: Error parsing concatenate line: %s\n", line); - return; - } - - concatenations[concat_count].name = strdup(name); - concatenations[concat_count].part_count = parts; - - // Loop to parse each part of the concatenation - for (int i = 0; i < parts; i++) { - if (fgets(line, MAX_LEN, flow_file) == NULL) { - printf("Debug: Error reading part_%d line\n", i); - return; - } - - // Expect the format part_x= - char part[MAX_LEN]; - if (sscanf(line, "part_%d=%s", &i, part) != 2) { - printf("Debug: Error parsing part_%d line: %s\n", i, line); - return; - } - - concatenations[concat_count].parts[i] = strdup(part); - printf("Debug: Added part_%d: %s to concatenation %s\n", i, part, name); - } - - printf("Debug: Parsed concatenation %s with %d parts\n", name, parts); - concat_count++; -} - - -// Function to execute a single command -void execute_node(Node node) { - printf("Debug: Entered execute_node for node %s with command %s\n", node.name, node.command[0]); - pid_t pid = fork(); - if (pid == 0) { // Child process - printf("Debug: Forked child process to exec %s\n", node.command[0]); - execvp(node.command[0], node.command); - perror("execvp failed"); - exit(1); - } else if (pid > 0) { // Parent process - printf("Debug: Waiting for child process %d to finish\n", pid); - wait(NULL); // Wait for the child to finish - printf("Debug: Child process finished\n"); - } else { - perror("fork failed"); - } -} - -// Function to execute pipes -void execute_pipe(FlowPipe flow_pipe) { - printf("Debug: Entered execute_pipe from %s to %s\n", flow_pipe.from, flow_pipe.to); - int pipe_fds[2]; - if (pipe(pipe_fds) == -1) { - perror("pipe failed"); - exit(1); - } - printf("Debug: Pipe created successfully\n"); - - pid_t pid1 = fork(); - if (pid1 == 0) { - // First command: Redirect stdout to pipe - printf("Debug: Forked first child process for pipe, from %s\n", flow_pipe.from); - dup2(pipe_fds[1], STDOUT_FILENO); - close(pipe_fds[0]); - close(pipe_fds[1]); - - int node_index = find_node_by_name(flow_pipe.from); - if (node_index != -1) { - printf("Debug: Executing first command %s\n", nodes[node_index].command[0]); - execvp(nodes[node_index].command[0], nodes[node_index].command); - perror("execvp failed"); - exit(1); - } else { - printf("Debug: Node %s not found for first command in pipe\n", flow_pipe.from); - exit(1); - } - } else if (pid1 > 0) { - printf("Debug: First process for pipe created with pid=%d\n", pid1); - } else { - perror("fork failed"); - } - - pid_t pid2 = fork(); - if (pid2 == 0) { - // Second command: Redirect stdin from pipe - printf("Debug: Forked second child process for pipe, to %s\n", flow_pipe.to); - dup2(pipe_fds[0], STDIN_FILENO); - close(pipe_fds[0]); - close(pipe_fds[1]); - - int node_index = find_node_by_name(flow_pipe.to); - if (node_index != -1) { - printf("Debug: Executing second command %s\n", nodes[node_index].command[0]); - execvp(nodes[node_index].command[0], nodes[node_index].command); - perror("execvp failed"); - exit(1); - } else { - printf("Debug: Node %s not found for second command in pipe\n", flow_pipe.to); - exit(1); - } - } else if (pid2 > 0) { - printf("Debug: Second process for pipe created with pid=%d\n", pid2); - } else { - perror("fork failed"); - } - - close(pipe_fds[0]); - close(pipe_fds[1]); - wait(NULL); - wait(NULL); - printf("Debug: Pipe execution completed\n"); -} - -// Function to execute concatenations -void execute_concatenate(Concatenate concat) { - printf("Debug: Entered execute_concatenate for concatenation %s with %d parts\n", concat.name, concat.part_count); - for (int i = 0; i < concat.part_count; i++) { - printf("Debug: Executing part %d: %s\n", i, concat.parts[i]); - int node_index = find_node_by_name(concat.parts[i]); - if (node_index != -1) { - execute_node(nodes[node_index]); - } - } -} - -// Function to parse the flow file and execute a specific action (pipe or concatenation) -void parse_and_execute_flow_file(FILE *flow_file, const char *target) { - printf("Debug: Entered parse_and_execute_flow_file with target %s\n", target); - char line[MAX_LEN]; - int found = 0; - - // Parse the flow file line by line - while (fgets(line, MAX_LEN, flow_file) != NULL) { - printf("Debug: Read line %s\n", line); - if (strncmp(line, "node", 4) == 0) { - parse_node(line, flow_file); // Pass the file pointer - } else if (strncmp(line, "pipe", 4) == 0) { - parse_pipe(line, flow_file); // Pass the file pointer - } else if (strncmp(line, "concatenate", 11) == 0) { - parse_concatenate(line, flow_file); // Pass the file pointer - } - } - - // Execute the specific pipe or concatenation based on the target - printf("Debug: Looking for target %s in pipes and concatenations\n", target); - for (int i = 0; i < pipe_count; i++) { - if (strcmp(target, pipes[i].to) == 0 || strcmp(target, pipes[i].from) == 0) { - printf("Debug: Found pipe to execute, from %s to %s\n", pipes[i].from, pipes[i].to); - execute_pipe(pipes[i]); // Call the pipe execution logic - found = 1; - break; - } - } - - for (int i = 0; i < concat_count; i++) { - if (strcmp(target, concatenations[i].name) == 0) { - printf("Debug: Found concatenation to execute: %s\n", concatenations[i].name); - execute_concatenate(concatenations[i]); - found = 1; - break; - } - } - - if (!found) { - fprintf(stderr, "Error: Could not find target %s in the flow file.\n", target); - exit(1); - } -} - -int main(int argc, char *argv[]) { - printf("Debug: Entered main\n"); - if (argc != 3) { - fprintf(stderr, "Usage: %s \n", argv[0]); - exit(1); - } - - printf("Debug: Opening flow file %s\n", argv[1]); - FILE *flow_file = fopen(argv[1], "r"); - if (flow_file == NULL) { - perror("fopen failed"); - exit(1); - } - - parse_and_execute_flow_file(flow_file, argv[2]); - fclose(flow_file); - printf("Debug: Flow file execution completed\n"); - - return 0; -} diff --git a/flow.cpp b/flow.cpp new file mode 100644 index 0000000..e383fb7 --- /dev/null +++ b/flow.cpp @@ -0,0 +1,371 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Structs for nodes, pipes, concatenations, stderr captures, and file nodes +struct Node { + std::string name; + std::vector command; +}; + +struct FlowPipe { + std::string from; + std::string to; +}; + +struct Concatenation { + std::vector parts; +}; + +struct StderrCapture { + std::string name; + std::string from; +}; + +struct FileNode { + std::string name; + std::string filename; +}; + +// Maps for storing nodes, pipes, concatenations, stderr captures, and file nodes +std::unordered_map nodes; +std::unordered_map pipes; +std::unordered_map concatenations; +std::unordered_map stderrCaptures; +std::unordered_map fileNodes; + +// Helper function to execute commands or actions +void execute_command(const std::vector &command_args, int input_fd, int output_fd, bool redirect_stderr, bool suppress_error_messages) { + pid_t pid = fork(); + if (pid == -1) { + perror("[ERROR] fork failed"); + exit(EXIT_FAILURE); + } + if (pid == 0) { // Child process + if (input_fd != STDIN_FILENO) { + if (dup2(input_fd, STDIN_FILENO) == -1) { + perror("[ERROR] dup2 input_fd failed"); + exit(EXIT_FAILURE); + } + close(input_fd); + } + if (output_fd != STDOUT_FILENO) { + if (dup2(output_fd, STDOUT_FILENO) == -1) { + perror("[ERROR] dup2 output_fd failed"); + exit(EXIT_FAILURE); + } + close(output_fd); + } + if (redirect_stderr) { + if (dup2(STDOUT_FILENO, STDERR_FILENO) == -1) { + perror("[ERROR] dup2 STDERR failed"); + exit(EXIT_FAILURE); + } + } + std::vector args; + for (const auto &arg : command_args) { + args.push_back(const_cast(arg.c_str())); + } + args.push_back(nullptr); + execvp(args[0], args.data()); + perror("[ERROR] execvp failed"); + exit(EXIT_FAILURE); + } + // Parent process waits for the child + int status; + waitpid(pid, &status, 0); + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) != 0 && !suppress_error_messages) { + std::cerr << "[ERROR] Child process exited with error code: " << WEXITSTATUS(status) << std::endl; + } + } else if (WIFSIGNALED(status)) { + int sig = WTERMSIG(status); + if (sig != SIGPIPE && !suppress_error_messages) { + std::cerr << "[ERROR] Child process was terminated by signal: " << sig << std::endl; + } + } +} + +// Function Definitions + +/** + * Helper function to tokenize command strings, treating quoted strings as single tokens. + */ +std::vector tokenize_command(const std::string &command_line) { + std::vector tokens; + std::string token; + bool in_single_quote = false; + bool in_double_quote = false; + + for (char c : command_line) { + if (c == '\'' && !in_double_quote) { + in_single_quote = !in_single_quote; + continue; // Skip the quote character + } else if (c == '"' && !in_single_quote) { + in_double_quote = !in_double_quote; + continue; // Skip the quote character + } + + if (std::isspace(c) && !in_single_quote && !in_double_quote) { + if (!token.empty()) { + tokens.push_back(token); + token.clear(); + } + } else { + token += c; + } + } + + if (!token.empty()) { + tokens.push_back(token); + } + + return tokens; +} + +/** + * Helper function to execute any action (node, pipe, concatenation, stderr capture, or file node). + */ +void execute_action(const std::string &action_name, int input_fd = STDIN_FILENO, int output_fd = STDOUT_FILENO, bool suppress_error_messages = false) { + if (nodes.find(action_name) != nodes.end()) { + const Node &node = nodes[action_name]; + execute_command(node.command, input_fd, output_fd, false, suppress_error_messages); + } else if (pipes.find(action_name) != pipes.end()) { + const FlowPipe &flow_pipe = pipes[action_name]; + + // Handle if 'from' or 'to' is a file node + bool from_is_file = fileNodes.find(flow_pipe.from) != fileNodes.end(); + bool to_is_file = fileNodes.find(flow_pipe.to) != fileNodes.end(); + + if (from_is_file && to_is_file) { + std::cerr << "[ERROR] Both 'from' and 'to' cannot be file nodes in pipe: " << action_name << std::endl; + exit(EXIT_FAILURE); + } + + if (from_is_file) { + // 'from' is a file node; open the file and set as input_fd + const FileNode &fileNode = fileNodes[flow_pipe.from]; + int file_fd = open(fileNode.filename.c_str(), O_RDONLY); + if (file_fd == -1) { + perror("[ERROR] open failed"); + exit(EXIT_FAILURE); + } + execute_action(flow_pipe.to, file_fd, output_fd, suppress_error_messages); + close(file_fd); + } else if (to_is_file) { + // 'to' is a file node; open the file and set as output_fd + const FileNode &fileNode = fileNodes[flow_pipe.to]; + int file_fd = open(fileNode.filename.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (file_fd == -1) { + perror("[ERROR] open failed"); + exit(EXIT_FAILURE); + } + execute_action(flow_pipe.from, input_fd, file_fd, suppress_error_messages); + close(file_fd); + } else { + // Regular pipe between two actions + int fd[2]; + if (pipe(fd) == -1) { + perror("[ERROR] pipe creation failed"); + exit(EXIT_FAILURE); + } + + pid_t pid = fork(); + if (pid == -1) { + perror("[ERROR] fork failed"); + exit(EXIT_FAILURE); + } + + if (pid == 0) { // Child process + close(fd[0]); // Close read end + execute_action(flow_pipe.from, input_fd, fd[1], suppress_error_messages); + close(fd[1]); + exit(EXIT_SUCCESS); + } else { + close(fd[1]); // Close write end + execute_action(flow_pipe.to, fd[0], output_fd, suppress_error_messages); + close(fd[0]); + waitpid(pid, nullptr, 0); + } + } + } else if (concatenations.find(action_name) != concatenations.end()) { + const Concatenation &concat = concatenations[action_name]; + for (const auto &part_name : concat.parts) { + execute_action(part_name, input_fd, output_fd, suppress_error_messages); + } + } else if (stderrCaptures.find(action_name) != stderrCaptures.end()) { + const StderrCapture &stderrCapture = stderrCaptures[action_name]; + // Redirect stderr to stdout + int fd[2]; + if (pipe(fd) == -1) { + perror("[ERROR] pipe failed"); + exit(EXIT_FAILURE); + } + + pid_t pid = fork(); + if (pid == -1) { + perror("[ERROR] fork failed"); + exit(EXIT_FAILURE); + } + + if (pid == 0) { // Child process + dup2(fd[1], STDOUT_FILENO); + dup2(fd[1], STDERR_FILENO); + close(fd[0]); + close(fd[1]); + execute_action(stderrCapture.from, input_fd, STDOUT_FILENO, true); + exit(EXIT_FAILURE); + } else { + close(fd[1]); + execute_command({"cat"}, fd[0], output_fd, false, suppress_error_messages); + close(fd[0]); + waitpid(pid, nullptr, 0); + } + } else if (fileNodes.find(action_name) != fileNodes.end()) { + // For file nodes, output the file content + const FileNode &fileNode = fileNodes[action_name]; + int file_fd = open(fileNode.filename.c_str(), O_RDONLY); + if (file_fd == -1) { + perror("[ERROR] open failed"); + exit(EXIT_FAILURE); + } + execute_command({"cat"}, file_fd, output_fd, false, suppress_error_messages); + close(file_fd); + } else { + std::cerr << "[ERROR] Unknown action: " << action_name << std::endl; + exit(EXIT_FAILURE); + } +} + +/** + * Parse the .flow file and populate nodes, pipes, concatenations, stderr captures, and file nodes. + */ +void parse_flow_file(const std::string& filename) { + std::ifstream flow_file(filename); + if (!flow_file.is_open()) { + std::cerr << "[ERROR] Could not open flow file " << filename << "\n"; + exit(1); + } + + std::string line; + while (std::getline(flow_file, line)) { + if (line.empty()) + continue; + + if (line.substr(0, 5) == "node=") { + // Parse a node + std::string node_name = line.substr(5); + std::string command_line; + if (!std::getline(flow_file, command_line) || command_line.substr(0, 8) != "command=") { + std::cerr << "[ERROR] Missing command for node: " << node_name << "\n"; + exit(EXIT_FAILURE); + } + std::string command = command_line.substr(8); + Node node; + node.name = node_name; + node.command = tokenize_command(command); + nodes[node_name] = node; + } else if (line.substr(0, 5) == "pipe=") { + // Parse a pipe + std::string pipe_name = line.substr(5); + std::string from_line, to_line; + if (!std::getline(flow_file, from_line) || !std::getline(flow_file, to_line)) { + std::cerr << "[ERROR] Missing 'from' or 'to' for pipe: " << pipe_name << "\n"; + exit(EXIT_FAILURE); + } + if (from_line.substr(0, 5) != "from=" || to_line.substr(0, 3) != "to=") { + std::cerr << "[ERROR] Invalid 'from' or 'to' format for pipe: " << pipe_name << "\n"; + exit(EXIT_FAILURE); + } + std::string from = from_line.substr(5); + std::string to = to_line.substr(3); + FlowPipe pipe; + pipe.from = from; + pipe.to = to; + pipes[pipe_name] = pipe; + } else if (line.substr(0, 12) == "concatenate=") { + // Parse a concatenation + std::string concat_name = line.substr(12); + std::string parts_line; + if (!std::getline(flow_file, parts_line) || parts_line.substr(0, 6) != "parts=") { + std::cerr << "[ERROR] Missing 'parts' for concatenation: " << concat_name << "\n"; + exit(EXIT_FAILURE); + } + int num_parts = std::stoi(parts_line.substr(6)); + Concatenation concat; + for (int i = 0; i < num_parts; ++i) { + std::string part_line; + if (!std::getline(flow_file, part_line)) { + std::cerr << "[ERROR] Missing 'part_" << i << "' for concatenation: " << concat_name << "\n"; + exit(EXIT_FAILURE); + } + std::string part_prefix = "part_" + std::to_string(i) + "="; + if (part_line.substr(0, part_prefix.length()) != part_prefix) { + std::cerr << "[ERROR] Invalid 'part_" << i << "' format for concatenation: " << concat_name << "\n"; + exit(EXIT_FAILURE); + } + std::string part_name = part_line.substr(part_prefix.length()); + concat.parts.push_back(part_name); + } + concatenations[concat_name] = concat; + } else if (line.substr(0, 6) == "stderr") { + // Parse a stderr capture + std::string stderr_name = line.substr(6); + if (!stderr_name.empty() && stderr_name[0] == '=') { + stderr_name = stderr_name.substr(1); + } + std::string from_line; + if (!std::getline(flow_file, from_line) || from_line.substr(0, 5) != "from=") { + std::cerr << "[ERROR] Missing 'from' for stderr: " << stderr_name << "\n"; + exit(EXIT_FAILURE); + } + std::string from = from_line.substr(5); + StderrCapture stderrCapture; + stderrCapture.name = stderr_name; + stderrCapture.from = from; + stderrCaptures[stderr_name] = stderrCapture; + } else if (line.substr(0, 5) == "file=") { + // Parse a file node + std::string file_name = line.substr(5); + std::string name_line; + if (!std::getline(flow_file, name_line) || name_line.substr(0, 5) != "name=") { + std::cerr << "[ERROR] Missing 'name' for file: " << file_name << "\n"; + exit(EXIT_FAILURE); + } + std::string filename = name_line.substr(5); + FileNode fileNode; + fileNode.name = file_name; + fileNode.filename = filename; + fileNodes[file_name] = fileNode; + } + } +} + +/** + * Main function. + */ +int main(int argc, char* argv[]) { + if (argc != 3) { + std::cerr << "Usage: ./flow " << std::endl; + return EXIT_FAILURE; + } + + std::string flowFile = argv[1]; + std::string action = argv[2]; + + // Parse the flow file + parse_flow_file(flowFile); + + // Execute the action + execute_action(action); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/foo.txt b/foo.txt index 21cf5b3..4ee6ff6 100644 --- a/foo.txt +++ b/foo.txt @@ -1 +1 @@ -f o o +f o o \ No newline at end of file diff --git a/myrun.py b/myrun.py new file mode 100644 index 0000000..bdb3a50 --- /dev/null +++ b/myrun.py @@ -0,0 +1,67 @@ +import os +import subprocess +import datetime + +flow_tests = { + "0.flow": ("path", "pwd"), + "1.flow": ("doit", "ls | wc"), + "2.flow": ("doit", "ls -l | wc"), + "3.flow": ("doit", "ls -l | ls"), + "4.flow": ("doit", "echo foo | cat"), + "5.flow": ("doit", "echo 'foo' | cat"), + "6.flow": ("doit", "echo \"foo\" | cat"), + "7.flow": ("doit", "echo 'f o o' | cat"), + "8.flow": ("doit", "ls ; pwd"), + "9.flow": ("doit", "ls; ls ; ls -a"), + "10.flow": ("doit", "echo foo1 ; echo 'foo2' ; echo \"foo3\" ; echo 'f o o 4'"), + "11.flow": ("doit", "ls | wc ; pwd"), + "12.flow": ("doit", "( cat foo.txt ; cat foo.txt | sed s/o/u/g ) | wc"), + "13.flow": ("doit", "( seq 1 5 | awk '{print $1*$1}'; seq 1 5 | awk '{print $1*2}'; seq 1 5 | awk '{print $1+5}' ) | sort -n | uniq"), + "14.flow": ("doit", "mkdir a 2>&1"), + "15.flow": ("doit", "mkdir a 2>&1 | wc"), + "16.flow": ("doit", "ls > output.txt"), + "17.flow": ("doit", "cat output.txt | wc") +} + +def compile_flow_cpp(): + if os.path.exists('flow.cpp'): + print("flow.cpp file found.") + if os.path.exists('flow'): + os.remove('flow') + print("Removed existing 'flow' executable.") + print("Compiling flow.cpp...") + subprocess.run("g++ -std=c++11 flow.cpp -o flow", shell=True) + print("Compiled.") + return True + else: + print("flow.cpp file not found.") + return False + +def run_tests(): + current_time = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") + results_filename = f"TestResult_{current_time}.txt" + with open(results_filename, 'w') as result_file: + for i, (flow_file, (action, command)) in enumerate(flow_tests.items()): + flow_path = flow_file + result = subprocess.run(f"./flow files/{flow_path} {action}", shell=True, capture_output=True, text=True) + expected_output = subprocess.run(command, shell=True, capture_output=True, text=True) + + # Write detailed results to file + result_file.write(f"\nTest {i} : {command}\n") + result_file.write("------PROGRAM OUTPUT--------\n") + result_file.write(result.stdout + '\n') + result_file.write("-------ACTUAL OUTPUT-------\n") + result_file.write(expected_output.stdout + '\n') + result_file.write("*************************************************************************\n") + + # Print simple results to terminal + if result.stdout.strip() == expected_output.stdout.strip(): + print(f"Test {i} passed.") + else: + print(f"Test {i} failed.") + + print(f"\nAll tests completed. Results saved to {results_filename}.\n") + +if __name__ == "__main__": + if compile_flow_cpp(): + run_tests() \ No newline at end of file diff --git a/old Makefile b/old Makefile deleted file mode 100644 index 0882e9d..0000000 --- a/old Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# Variable to control the flow file and source file name (change this to flow1, flow2, etc.) -FLOWX = flow4 - -# Source and flow files are based on the FLOWX variable -SRC = $(FLOWX).cpp -EXEC = $(FLOWX) -FLOW1 = flow1.flow -FLOW2 = flow2.flow - -.PHONY: all clean compile run - -# Default target: clean, compile, and run -all: clean compile run - -# Clean target: delete the executable if it exists -clean: - @echo "Cleaning up $(EXEC)..." - @if [ -f $(EXEC) ]; then rm -f $(EXEC); fi - -# Compile target: compile the source file into an executable with the name $(EXEC) -compile: - @echo "Compiling $(SRC) into $(EXEC)..." - @g++ -std=c++11 $(SRC) -o $(EXEC) - -# Run target: run the flow1.flow and flow2.flow, and compare results with real commands -run: - @echo "\nRunning $(EXEC) with $(FLOW1)..." - ./$(EXEC) $(FLOW1) doit - @echo "\nComparing with real command: ls | wc" - @ls | wc - - @echo "\nRunning $(EXEC) with $(FLOW2)..." - ./$(EXEC) $(FLOW2) shenanigan - @echo "\nComparing with real command: ( cat foo.txt ; cat foo.txt | sed 's/o/u/g' ) | wc" - @( cat foo.txt ; cat foo.txt | sed 's/o/u/g' ) | wc diff --git a/old output 2.txt b/old output 2.txt deleted file mode 100644 index 6a3a091..0000000 --- a/old output 2.txt +++ /dev/null @@ -1,12 +0,0 @@ -total 64 --rw-r--r--@ 1 reetnandy staff 4029 Oct 24 17:30 CMakeLists.txt --rw-r--r--@ 1 reetnandy staff 166 Oct 16 15:44 README.md -drwxr-xr-x@ 2 reetnandy staff 64 Oct 24 16:35 a -drwxr-xr-x@ 22 reetnandy staff 704 Oct 28 19:49 build -drwxr-xr-x@ 18 reetnandy staff 576 Oct 28 19:54 files --rw-r--r--@ 1 reetnandy staff 9857 Oct 14 20:21 flow.c --rw-r--r--@ 1 reetnandy staff 1081 Oct 16 13:32 old Makefile --rw-r--r--@ 1 reetnandy staff 85 Oct 28 19:53 oldoutput.txt --rw-r--r--@ 1 reetnandy staff 0 Oct 28 19:55 output.txt --rw-r--r--@ 1 reetnandy staff 180 Oct 24 16:53 result.txt -drwxr-xr-x@ 15 reetnandy staff 480 Oct 24 16:29 src diff --git a/old output.txt b/old output.txt deleted file mode 100644 index ee3ec51..0000000 --- a/old output.txt +++ /dev/null @@ -1,10 +0,0 @@ -CMakeLists.txt -README.md -a -build -files -flow.c -old Makefile -output.txt -result.txt -src diff --git a/output.txt b/output.txt index b98b694..1e5434b 100644 --- a/output.txt +++ b/output.txt @@ -1,14 +1,10 @@ -total 80 --rw-r--r--@ 1 reetnandy staff 4029 Oct 24 17:30 CMakeLists.txt --rw-r--r--@ 1 reetnandy staff 1228 Oct 28 20:54 README.md -drwxr-xr-x@ 2 reetnandy staff 64 Oct 24 16:35 a -drwxr-xr-x@ 23 reetnandy staff 736 Oct 28 21:02 build -drwxr-xr-x@ 18 reetnandy staff 576 Oct 28 19:54 files --rw-r--r--@ 1 reetnandy staff 9857 Oct 14 20:21 flow.c --rw-r--r--@ 1 reetnandy staff 6 Oct 28 20:31 foo.txt --rw-r--r--@ 1 reetnandy staff 1081 Oct 16 13:32 old Makefile --rw-r--r--@ 1 reetnandy staff 669 Oct 28 19:55 old output 2.txt --rw-r--r--@ 1 reetnandy staff 85 Oct 28 19:53 old output.txt --rw-r--r--@ 1 reetnandy staff 0 Oct 28 21:22 output.txt --rw-r--r--@ 1 reetnandy staff 180 Oct 24 16:53 result.txt -drwxr-xr-x@ 16 reetnandy staff 512 Oct 28 21:00 src +README.md +TestResult_20241104_161345.txt +TestResult_20241111_150936.txt +a +files +flow +flow.cpp +foo.txt +output.txt +run.py diff --git a/result.txt b/result.txt deleted file mode 100644 index c699433..0000000 --- a/result.txt +++ /dev/null @@ -1,16 +0,0 @@ -node=read_file -command=cat - -file=input_file -name=result.txt - -node=word_count -command=wc - -pipe=read_pipe -from=input_file -to=read_file - -pipe=process_pipe -from=read_pipe -to=word_count \ No newline at end of file diff --git a/run.py b/run.py new file mode 100644 index 0000000..bdb3a50 --- /dev/null +++ b/run.py @@ -0,0 +1,67 @@ +import os +import subprocess +import datetime + +flow_tests = { + "0.flow": ("path", "pwd"), + "1.flow": ("doit", "ls | wc"), + "2.flow": ("doit", "ls -l | wc"), + "3.flow": ("doit", "ls -l | ls"), + "4.flow": ("doit", "echo foo | cat"), + "5.flow": ("doit", "echo 'foo' | cat"), + "6.flow": ("doit", "echo \"foo\" | cat"), + "7.flow": ("doit", "echo 'f o o' | cat"), + "8.flow": ("doit", "ls ; pwd"), + "9.flow": ("doit", "ls; ls ; ls -a"), + "10.flow": ("doit", "echo foo1 ; echo 'foo2' ; echo \"foo3\" ; echo 'f o o 4'"), + "11.flow": ("doit", "ls | wc ; pwd"), + "12.flow": ("doit", "( cat foo.txt ; cat foo.txt | sed s/o/u/g ) | wc"), + "13.flow": ("doit", "( seq 1 5 | awk '{print $1*$1}'; seq 1 5 | awk '{print $1*2}'; seq 1 5 | awk '{print $1+5}' ) | sort -n | uniq"), + "14.flow": ("doit", "mkdir a 2>&1"), + "15.flow": ("doit", "mkdir a 2>&1 | wc"), + "16.flow": ("doit", "ls > output.txt"), + "17.flow": ("doit", "cat output.txt | wc") +} + +def compile_flow_cpp(): + if os.path.exists('flow.cpp'): + print("flow.cpp file found.") + if os.path.exists('flow'): + os.remove('flow') + print("Removed existing 'flow' executable.") + print("Compiling flow.cpp...") + subprocess.run("g++ -std=c++11 flow.cpp -o flow", shell=True) + print("Compiled.") + return True + else: + print("flow.cpp file not found.") + return False + +def run_tests(): + current_time = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") + results_filename = f"TestResult_{current_time}.txt" + with open(results_filename, 'w') as result_file: + for i, (flow_file, (action, command)) in enumerate(flow_tests.items()): + flow_path = flow_file + result = subprocess.run(f"./flow files/{flow_path} {action}", shell=True, capture_output=True, text=True) + expected_output = subprocess.run(command, shell=True, capture_output=True, text=True) + + # Write detailed results to file + result_file.write(f"\nTest {i} : {command}\n") + result_file.write("------PROGRAM OUTPUT--------\n") + result_file.write(result.stdout + '\n') + result_file.write("-------ACTUAL OUTPUT-------\n") + result_file.write(expected_output.stdout + '\n') + result_file.write("*************************************************************************\n") + + # Print simple results to terminal + if result.stdout.strip() == expected_output.stdout.strip(): + print(f"Test {i} passed.") + else: + print(f"Test {i} failed.") + + print(f"\nAll tests completed. Results saved to {results_filename}.\n") + +if __name__ == "__main__": + if compile_flow_cpp(): + run_tests() \ No newline at end of file diff --git a/src/flow.cpp b/src/flow.cpp deleted file mode 100644 index 42dcdf5..0000000 --- a/src/flow.cpp +++ /dev/null @@ -1,241 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Structure to represent a node (a command) -struct Node { - std::string command; - std::vector args; -}; - -// Structure to represent a concatenation sequence -struct Concatenation { - int parts; - std::vector part_nodes; -}; - -// Maps to store nodes, pipes, and concatenations -std::map nodes; -std::map> pipes; -std::map concatenations; - -std::string current_node; // Temporary variable to store the current node - -// Function to parse the .flow file -void parseFlowFile(const std::string &filename) { - std::ifstream file(filename); - if (!file) { - std::cerr << "Error: Could not open file " << filename << std::endl; - exit(1); - } - - std::string line; - while (std::getline(file, line)) { - if (line.empty() || line.find_first_not_of(' ') == std::string::npos) { - continue; - } - - std::istringstream iss(line); - std::string key, value; - if (std::getline(iss, key, '=') && std::getline(iss, value)) { - if (key.rfind("node", 0) == 0) { - current_node = value; - } else if (key == "command" && !current_node.empty()) { - std::istringstream cmd_stream(value); - std::string cmd; - cmd_stream >> cmd; - Node node; - node.command = cmd; - - std::string arg; - while (cmd_stream >> arg) { - node.args.push_back(arg); - } - nodes[current_node] = node; - current_node.clear(); - } else if (key == "pipe") { - std::string pipe_name = value; - std::string from, to; - - if (std::getline(file, line)) { - std::istringstream from_line(line); - std::getline(from_line, key, '='); - std::getline(from_line, from); - } - - if (std::getline(file, line)) { - std::istringstream to_line(line); - std::getline(to_line, key, '='); - std::getline(to_line, to); - } - - pipes[pipe_name] = {from, to}; - } else if (key == "concatenate") { - Concatenation concat; - std::getline(file, line); - std::istringstream part_line(line); - part_line >> key >> concat.parts; - for (int i = 0; i < concat.parts; ++i) { - std::getline(file, line); - std::istringstream part_line(line); - std::string part_node; - part_line >> key >> part_node; - concat.part_nodes.push_back(part_node); - } - concatenations[value] = concat; - } - } - } -} - -// Function to prepare args and handle special cases like sed -std::vector prepareArgs(const Node &node) { - std::vector args; - args.push_back(const_cast(node.command.c_str())); - - for (const auto &arg : node.args) { - args.push_back(const_cast(arg.c_str())); - } - - args.push_back(nullptr); - return args; -} - -// Function to execute a node (command) -void executeNode(const Node &node) { - std::vector args = prepareArgs(node); - - // Debugging prints - std::cout << "Executing command: " << node.command << std::endl; - std::cout << "Arguments: "; - for (auto arg : args) { - if (arg != nullptr) { - std::cout << arg << " "; - } - } - std::cout << std::endl; - - if (execvp(args[0], args.data()) == -1) { - perror("execvp"); - exit(1); - } -} - -// Function to execute a concatenation of nodes -void executeConcatenation(const Concatenation &concat) { - int prev_fd[2]; // Previous pipe for chaining commands - int current_fd[2]; - - for (int i = 0; i < concat.parts; ++i) { - const std::string &node_name = concat.part_nodes[i]; - const Node &node = nodes[node_name]; - - if (i > 0) { - pipe(current_fd); - } - - pid_t pid = fork(); - if (pid == -1) { - perror("fork"); - exit(1); - } - - if (pid == 0) { // Child process - if (i > 0) { - close(prev_fd[1]); - dup2(prev_fd[0], STDIN_FILENO); - close(prev_fd[0]); - } - - if (i < concat.parts - 1) { - close(current_fd[0]); - dup2(current_fd[1], STDOUT_FILENO); - close(current_fd[1]); - } - - executeNode(node); - } - - if (i > 0) { - close(prev_fd[0]); - close(prev_fd[1]); - } - - if (i < concat.parts - 1) { - prev_fd[0] = current_fd[0]; - prev_fd[1] = current_fd[1]; - } - - wait(nullptr); - } -} - -// Function to execute a pipe -void executePipe(const std::string &pipe_name) { - auto pipe_info = pipes[pipe_name]; - int fd[2]; - if (pipe(fd) == -1) { - perror("pipe"); - exit(1); - } - - pid_t pid1 = fork(); - if (pid1 == -1) { - perror("fork"); - exit(1); - } - - if (pid1 == 0) { - close(fd[0]); - dup2(fd[1], STDOUT_FILENO); - close(fd[1]); - executeNode(nodes[pipe_info.first]); - } - - pid_t pid2 = fork(); - if (pid2 == -1) { - perror("fork"); - exit(1); - } - - if (pid2 == 0) { - close(fd[1]); - dup2(fd[0], STDIN_FILENO); - close(fd[0]); - executeNode(nodes[pipe_info.second]); - } - - close(fd[0]); - close(fd[1]); - waitpid(pid1, nullptr, 0); - waitpid(pid2, nullptr, 0); -} - -int main(int argc, char *argv[]) { - if (argc != 3) { - std::cerr << "Usage: " << argv[0] << " " << std::endl; - return 1; - } - - std::string flow_file = argv[1]; - std::string action = argv[2]; - - parseFlowFile(flow_file); - - if (pipes.find(action) != pipes.end()) { - executePipe(action); - } else if (concatenations.find(action) != concatenations.end()) { - executeConcatenation(concatenations[action]); - } else { - std::cerr << "Error: Unknown action '" << action << "'." << std::endl; - return 1; - } - - return 0; -} \ No newline at end of file diff --git a/src/flow2.cpp b/src/flow2.cpp deleted file mode 100644 index 49fb521..0000000 --- a/src/flow2.cpp +++ /dev/null @@ -1,302 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAX_LEN 1024 - -// Structs for nodes, pipes, and concatenations -struct Node { - std::string name; - std::vector command; -}; - -struct FlowPipe { - std::string from; - std::string to; -}; - -struct Concatenation { - std::string name; - std::vector parts; -}; - -// Maps for storing nodes, pipes, and concatenations -std::map nodes; -std::map pipes; -std::map concatenations; - -// Helper function to tokenize command strings -std::vector tokenize_command(const std::string &command_line) { - std::vector tokens; - std::istringstream iss(command_line); - std::string token; - while (iss >> token) { - tokens.push_back(token); - } - return tokens; -} - -// Function to parse and store a node -void parse_node(const std::string &line, std::ifstream &flow_file) { - std::string name, command_line; - - // Extract node name - std::string prefix = "node="; - if (line.substr(0, prefix.length()) == prefix) { - name = line.substr(prefix.length()); - } else { - std::cerr << "Error: Invalid node format: " << line << "\n"; - return; - } - - // Read command line - std::getline(flow_file, command_line); - - // Strip out 'command=' from the command line - std::string command_prefix = "command="; - if (command_line.substr(0, command_prefix.length()) == command_prefix) { - command_line = command_line.substr(command_prefix.length()); - } - - // Tokenize and store node command - Node node; - node.name = name; - node.command = tokenize_command(command_line); - - nodes[name] = node; - std::cout << "Parsed node: " << name << " with command: "; - for (const auto &cmd : node.command) { - std::cout << cmd << " "; - } - std::cout << "\n"; -} - -// Function to parse and store a pipe -void parse_pipe(const std::string &line, std::ifstream &flow_file) { - std::string pipe_name, from, to; - - // Extract pipe name - std::string prefix = "pipe="; - if (line.substr(0, prefix.length()) == prefix) { - pipe_name = line.substr(prefix.length()); - } else { - std::cerr << "Error: Invalid pipe format: " << line << "\n"; - return; - } - - // Read 'from' and 'to' lines - std::getline(flow_file, from); - from = from.substr(from.find('=') + 1); // Extract 'from' - - std::getline(flow_file, to); - to = to.substr(to.find('=') + 1); // Extract 'to' - - FlowPipe pipe; - pipe.from = from; - pipe.to = to; - - pipes[pipe_name] = pipe; - std::cout << "Parsed pipe: " << pipe_name << " from " << from << " to " << to << "\n"; -} - -// Function to parse and store a concatenation -void parse_concatenation(const std::string &line, std::ifstream &flow_file) { - std::string concat_name, parts_line; - int part_count; - - // Extract concatenation name - std::string prefix = "concatenate="; - if (line.substr(0, prefix.length()) == prefix) { - concat_name = line.substr(prefix.length()); - } else { - std::cerr << "Error: Invalid concatenation format: " << line << "\n"; - return; - } - - std::getline(flow_file, parts_line); - sscanf(parts_line.c_str(), "parts=%d", &part_count); - - Concatenation concat; - concat.name = concat_name; - - // Parse individual parts - for (int i = 0; i < part_count; ++i) { - std::string part; - std::getline(flow_file, part); - part = part.substr(part.find('=') + 1); // Extract part name - concat.parts.push_back(part); - std::cout << "Added part " << concat.parts[i] << " to concatenation " << concat_name << "\n"; - } - - concatenations[concat_name] = concat; - std::cout << "Parsed concatenation: " << concat_name << " with " << part_count << " parts\n"; -} - -// Function to execute a command and capture its output -void execute_command(const Node &node, int input_fd = STDIN_FILENO, int output_fd = STDOUT_FILENO) { - std::cout << "Executing command: " << node.name << "\n"; - for (const auto &cmd : node.command) { - std::cout << cmd << " "; - } - std::cout << std::endl; - - std::vector args; - for (auto &arg : node.command) { - args.push_back(const_cast(arg.c_str())); - } - args.push_back(NULL); // Null-terminate the argument list - - if (input_fd != STDIN_FILENO) { - dup2(input_fd, STDIN_FILENO); // Redirect stdin to the input_fd - close(input_fd); // Close the file descriptor - } - - if (output_fd != STDOUT_FILENO) { - dup2(output_fd, STDOUT_FILENO); // Redirect stdout to output_fd - close(output_fd); // Close the file descriptor - } - - if (execvp(args[0], args.data()) == -1) { - std::cerr << "Error: Failed to execute command: " << args[0] << "\n"; - exit(EXIT_FAILURE); - } -} - -// Function to capture and print data flow between commands -void capture_and_print(int input_fd, int output_fd) { - char buffer[256]; - ssize_t bytes_read; - while ((bytes_read = read(input_fd, buffer, sizeof(buffer) - 1)) > 0) { - buffer[bytes_read] = '\0'; // Null-terminate the buffer - write(output_fd, buffer, bytes_read); // Forward the output to the next command - std::cout << "Debug: Data passed: " << buffer << "\n"; // Print data flow - } -} - -// Function to set up and execute a pipe between two nodes -void execute_pipe(const FlowPipe &pipe) { - int pipe_fds[2]; - if (::pipe(pipe_fds) == -1) { - std::cerr << "Error: Failed to create pipe\n"; - exit(EXIT_FAILURE); - } - - pid_t pid1 = fork(); - if (pid1 == 0) { // First process - close(pipe_fds[0]); // Close read end - dup2(pipe_fds[1], STDOUT_FILENO); // Redirect stdout to write end - close(pipe_fds[1]); // Close write end - - std::cout << "Executing command: " << nodes[pipe.from].name << " (output redirected to pipe)\n"; - execute_command(nodes[pipe.from]); - } - - pid_t pid2 = fork(); - if (pid2 == 0) { // Second process - close(pipe_fds[1]); // Close write end - dup2(pipe_fds[0], STDIN_FILENO); // Redirect stdin to read end - close(pipe_fds[0]); // Close read end - - std::cout << "Executing command: " << nodes[pipe.to].name << " (input from pipe)\n"; - execute_command(nodes[pipe.to]); - } - - // Close pipes in parent process - close(pipe_fds[0]); - close(pipe_fds[1]); - - // Wait for both child processes to finish - waitpid(pid1, NULL, 0); - waitpid(pid2, NULL, 0); -} - -// Function to execute a concatenation of nodes or pipes -void execute_concatenation(const Concatenation &concat) { - for (size_t i = 0; i < concat.parts.size(); ++i) { - const std::string &part = concat.parts[i]; - - if (pipes.find(part) != pipes.end()) { - std::cout << "Executing pipe in concatenation: " << part << "\n"; - execute_pipe(pipes[part]); // Handle pipes in concatenation - } else if (nodes.find(part) != nodes.end()) { - int pipe_fds[2]; - if (i < concat.parts.size() - 1) { - // Create pipe for intermediate commands - if (::pipe(pipe_fds) == -1) { - std::cerr << "Error: Failed to create pipe\n"; - exit(EXIT_FAILURE); - } - } - - pid_t pid = fork(); - if (pid == 0) { - if (i < concat.parts.size() - 1) { - close(pipe_fds[0]); // Close read end of pipe - dup2(pipe_fds[1], STDOUT_FILENO); // Redirect output to pipe - close(pipe_fds[1]); - } - std::cout << "Executing command: " << nodes[part].name << " (part of concatenation)\n"; - execute_command(nodes[part]); - } - - if (i < concat.parts.size() - 1) { - close(pipe_fds[1]); // Close write end of pipe - dup2(pipe_fds[0], STDIN_FILENO); // Redirect input to next part - close(pipe_fds[0]); - } - - waitpid(pid, NULL, 0); - } - } -} - -// Function to parse the flow file and execute the given target (pipe or concatenation) -void parse_and_execute_flow_file(const std::string &flow_file_path, const std::string &target) { - std::ifstream flow_file(flow_file_path); - if (!flow_file.is_open()) { - std::cerr << "Error: Could not open flow file " << flow_file_path << "\n"; - exit(1); - } - - std::string line; - - // Parse the flow file line by line - while (std::getline(flow_file, line)) { - std::cout << "Read line: " << line << "\n"; - if (line.find("node=") == 0) { - parse_node(line, flow_file); - } else if (line.find("pipe=") == 0) { - parse_pipe(line, flow_file); - } else if (line.find("concatenate=") == 0) { - parse_concatenation(line, flow_file); - } - } - - // Execute based on the target (pipe or concatenation) - if (pipes.find(target) != pipes.end()) { - std::cout << "Executing pipe: " << target << "\n"; - execute_pipe(pipes[target]); - } else if (concatenations.find(target) != concatenations.end()) { - std::cout << "Executing concatenation: " << target << "\n"; - execute_concatenation(concatenations[target]); - } else { - std::cerr << "Error: Target " << target << " not found in pipes or concatenations!\n"; - exit(1); - } -} - -int main(int argc, char *argv[]) { - if (argc < 3) { - std::cerr << "Usage: " << argv[0] << " \n"; - exit(1); - } - - parse_and_execute_flow_file(argv[1], argv[2]); - return 0; -} \ No newline at end of file diff --git a/src/flow3.cpp b/src/flow3.cpp deleted file mode 100644 index aa9f038..0000000 --- a/src/flow3.cpp +++ /dev/null @@ -1,225 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Struct for nodes, pipes, and concatenations -struct Node { - std::string name; - std::vector command; -}; - -struct FlowPipe { - std::string from; - std::string to; -}; - -// Maps for storing nodes and pipes -std::map nodes; -std::map pipes; - -// Helper function to tokenize command strings, treating quoted strings as a single token -std::vector tokenize_command(const std::string &command_line) { - std::vector tokens; - std::istringstream iss(command_line); - std::string token; - - while (iss >> token) { - // Check if the token starts with a quote - if (token[0] == '"' || token[0] == '\'') { - char quote_char = token[0]; // Store the type of quote (either ' or ") - std::string quoted_token = token; // Start building the quoted token - - // Keep reading until we find the closing quote - while (quoted_token.back() != quote_char || quoted_token.length() == 1) { - std::string next_token; - if (!(iss >> next_token)) { - std::cerr << "Error: Mismatched quotes in command: " << command_line << "\n"; - return tokens; - } - quoted_token += " " + next_token; - } - - // Remove the surrounding quotes and add the token - quoted_token = quoted_token.substr(1, quoted_token.length() - 2); - tokens.push_back(quoted_token); - } else { - // Regular token, add it directly - tokens.push_back(token); - } - } - return tokens; -} - -// Function to prepare args for execvp -std::vector prepare_args(const Node &node) { - std::vector args; - for (const auto &arg : node.command) { - args.push_back(const_cast(arg.c_str())); - } - args.push_back(nullptr); // Null-terminated list of arguments - return args; -} - -// Function to execute a node command using execvp -void execute_node(const Node &node) { - std::vector args = prepare_args(node); - - // Execute the command with execvp - if (execvp(args[0], args.data()) == -1) { - perror("execvp"); - exit(EXIT_FAILURE); - } -} - -// Function to handle piping between two nodes (e.g., ls | wc) -void execute_pipe(const FlowPipe &pipe) { - int pipefd[2]; - if (::pipe(pipefd) == -1) { - perror("pipe"); - exit(EXIT_FAILURE); - } - - pid_t pid1 = fork(); - if (pid1 == -1) { - perror("fork"); - exit(EXIT_FAILURE); - } - - if (pid1 == 0) { // Child process 1 (producer - ls) - close(pipefd[0]); // Close unused read end - dup2(pipefd[1], STDOUT_FILENO); // Redirect stdout to pipe write end - close(pipefd[1]); // Close the pipe write end after redirecting - - // Execute the first command (ls) - execute_node(nodes[pipe.from]); - } - - pid_t pid2 = fork(); - if (pid2 == -1) { - perror("fork"); - exit(EXIT_FAILURE); - } - - if (pid2 == 0) { // Child process 2 (consumer - wc) - close(pipefd[1]); // Close unused write end - dup2(pipefd[0], STDIN_FILENO); // Redirect stdin to pipe read end - close(pipefd[0]); // Close the pipe read end after redirecting - - // Execute the second command (wc) - execute_node(nodes[pipe.to]); - } - - // Parent process - close(pipefd[0]); - close(pipefd[1]); - - // Wait for both processes to finish - waitpid(pid1, nullptr, 0); - waitpid(pid2, nullptr, 0); -} - -// Function to parse and store a node -void parse_node(const std::string &line, std::ifstream &flow_file) { - std::string name, command_line; - - // Extract node name - std::string prefix = "node="; - if (line.substr(0, prefix.length()) == prefix) { - name = line.substr(prefix.length()); - } else { - std::cerr << "Error: Invalid node format: " << line << "\n"; - return; - } - - // Read the next line for the command - std::getline(flow_file, command_line); - - // Strip out 'command=' from the command line - std::string command_prefix = "command="; - if (command_line.substr(0, command_prefix.length()) == command_prefix) { - command_line = command_line.substr(command_prefix.length()); - } - - // Tokenize and store node command - Node node; - node.name = name; - node.command = tokenize_command(command_line); - - nodes[name] = node; -} - -// Function to parse and store a pipe -void parse_pipe(const std::string &line, std::ifstream &flow_file) { - std::string pipe_name, from, to; - - // Extract pipe name - std::string prefix = "pipe="; - if (line.substr(0, prefix.length()) == prefix) { - pipe_name = line.substr(prefix.length()); - } else { - std::cerr << "Error: Invalid pipe format: " << line << "\n"; - return; - } - - // Read 'from' and 'to' lines - std::getline(flow_file, from); - from = from.substr(from.find('=') + 1); // Extract 'from' - - std::getline(flow_file, to); - to = to.substr(to.find('=') + 1); // Extract 'to' - - FlowPipe pipe; - pipe.from = from; - pipe.to = to; - - pipes[pipe_name] = pipe; -} - -// Function to parse the flow file -void parse_flow_file(std::ifstream &flow_file) { - std::string line; - - // Parse the flow file line by line - while (std::getline(flow_file, line)) { - if (line.find("node=") == 0) { - parse_node(line, flow_file); - } else if (line.find("pipe=") == 0) { - parse_pipe(line, flow_file); - } - } -} - -int main(int argc, char *argv[]) { - if (argc < 3) { - std::cerr << "Usage: " << argv[0] << " \n"; - exit(1); - } - - std::string flow_file_name = argv[1]; - std::string action = argv[2]; - - std::ifstream flow_file(flow_file_name); - if (!flow_file.is_open()) { - std::cerr << "Error: Could not open flow file " << flow_file_name << "\n"; - exit(1); - } - - // Parse the flow file - parse_flow_file(flow_file); - - // Execute the action (pipe) - if (pipes.find(action) != pipes.end()) { - execute_pipe(pipes[action]); - } else { - std::cerr << "Error: Unknown action '" << action << "'\n"; - return 1; - } - - return 0; -} \ No newline at end of file diff --git a/src/flow4.cpp b/src/flow4.cpp deleted file mode 100644 index 950e640..0000000 --- a/src/flow4.cpp +++ /dev/null @@ -1,370 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Struct for nodes, pipes, and concatenations -struct Node { - std::string name; - std::vector command; -}; - -struct FlowPipe { - std::string from; - std::string to; -}; - -struct Concatenation { - std::string name; - std::vector parts; -}; - -// Maps for storing nodes, pipes, and concatenations -std::map nodes; -std::map pipes; -std::map concatenations; - -// Helper function to tokenize command strings, treating quoted strings as a single token -std::vector tokenize_command(const std::string &command_line) { - std::vector tokens; - std::istringstream iss(command_line); - std::string token; - - while (iss >> token) { - if (token[0] == '"' || token[0] == '\'') { - char quote_char = token[0]; - std::string quoted_token = token; - - while (quoted_token.back() != quote_char || quoted_token.length() == 1) { - std::string next_token; - if (!(iss >> next_token)) { - std::cerr << "Error: Mismatched quotes in command: " << command_line << "\n"; - return tokens; - } - quoted_token += " " + next_token; - } - - quoted_token = quoted_token.substr(1, quoted_token.length() - 2); - tokens.push_back(quoted_token); - } else { - tokens.push_back(token); - } - } - return tokens; -} - -// Function to prepare args for execvp -std::vector prepare_args(const Node &node) { - std::vector args; - for (const auto &arg : node.command) { - args.push_back(const_cast(arg.c_str())); - } - args.push_back(nullptr); // Null-terminated list of arguments - return args; -} - -// Function to execute a node command using execvp and print the command being executed -void execute_node(const Node &node, int input_fd = -1, bool is_pipe = false) { - std::cout << "[DEBUG] Inside execute_node for command: "; - for (const auto &arg : node.command) { - std::cout << arg << " "; - } - std::cout << std::endl; - - if (input_fd != -1) { - std::cout << "[DEBUG] Reading input from previous command\n"; - dup2(input_fd, STDIN_FILENO); // Redirect input from previous command - close(input_fd); - } - - std::vector args = prepare_args(node); - - // Debug: Check the arguments before calling execvp - std::cout << "[DEBUG] About to execute execvp with: " << args[0] << std::endl; - for (int i = 0; args[i] != nullptr; i++) { - std::cout << "[DEBUG] Arg[" << i << "]: " << args[i] << std::endl; - } - - if (execvp(args[0], args.data()) == -1) { // Execute the command - perror("[ERROR] execvp failed"); - std::cout << "[DEBUG] execvp failed for command: " << node.command[0] << std::endl; - exit(EXIT_FAILURE); // Exit if execvp fails - } -} - - -// Function to handle piping between two nodes (e.g., ls | wc) with output capture -void execute_pipe(const FlowPipe &pipe) { - std::cout << "[DEBUG] Executing pipe from " << pipe.from << " to " << pipe.to << std::endl; - - int pipefd[2]; // Create a pipe - if (::pipe(pipefd) == -1) { - perror("pipe"); - exit(EXIT_FAILURE); - } - - std::cout << "[DEBUG] Pipe created successfully" << std::endl; - - // Fork for the producer (first command) - pid_t pid1 = fork(); - if (pid1 == -1) { - perror("fork"); - exit(EXIT_FAILURE); - } - - if (pid1 == 0) { // Child process 1 (producer) - std::cout << "[DEBUG] Entering producer child process: " << pipe.from << std::endl; - - // Debug before closing the pipe's read end - std::cout << "[DEBUG] Closing read end of the pipe in producer" << std::endl; - if (close(pipefd[0]) == -1) { - perror("[ERROR] close(pipefd[0]) failed in producer"); - _exit(EXIT_FAILURE); // Exit if closing fails - } - - // Debug before redirecting stdout to the pipe's write end - std::cout << "[DEBUG] Redirecting stdout to the pipe's write end" << std::endl; - if (dup2(pipefd[1], STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed in producer"); - _exit(EXIT_FAILURE); // Exit if redirection fails - } - - // Debug after dup2 - std::cout << "[DEBUG] Closing write end of the pipe in producer" << std::endl; - if (close(pipefd[1]) == -1) { - perror("[ERROR] close(pipefd[1]) failed in producer"); - _exit(EXIT_FAILURE); // Exit if closing fails - } - - // Debug: Check if we're about to call execute_node for the producer - std::cout << "[DEBUG] Calling execute_node for producer: " << pipe.from << std::endl; - - // Execute the first command (producer) - execute_node(nodes[pipe.from]); // This should execute the 'ls -l' command - - std::cerr << "[ERROR] execvp failed for producer: " << pipe.from << std::endl; - _exit(EXIT_FAILURE); // Ensure child process exits if execvp fails - } - - - - // Parent closes the write end after forking producer (no need for parent to keep it open) - close(pipefd[1]); - - // Wait for the producer to finish before starting the consumer - std::cout << "[DEBUG] Waiting for producer (pid1) to finish...\n"; - waitpid(pid1, nullptr, 0); - std::cout << "[DEBUG] Producer (pid1) finished\n"; - - // Fork for the consumer (second command) - pid_t pid2 = fork(); - if (pid2 == -1) { - perror("fork"); - exit(EXIT_FAILURE); - } - - if (pid2 == 0) { // Child process 2 (consumer) - std::cout << "[DEBUG] Entering consumer child process: " << pipe.to << std::endl; - close(pipefd[0]); // Close write end in the consumer - dup2(pipefd[0], STDIN_FILENO); // Redirect stdin to pipe's read end - close(pipefd[0]); // Close the read end after redirection - - // Execute the second command (consumer) - execute_node(nodes[pipe.to]); // This should execute the 'ls' command - _exit(EXIT_SUCCESS); // Ensure child process exits after execvp - } - - close(pipefd[0]); // Parent closes the read end after forking consumer - - // Wait for the consumer to finish - std::cout << "[DEBUG] Waiting for consumer (pid2) to finish...\n"; - waitpid(pid2, nullptr, 0); - std::cout << "[DEBUG] Both producer and consumer finished\n"; -} - - - -// Function to handle concatenation of multiple parts (cat foo.txt ; cat foo.txt | sed 's/o/u/g' | wc) -void execute_concatenation(const Concatenation &concat, const std::string &pipe_to) { - std::cout << "[DEBUG] Executing concatenation: " << concat.name << std::endl; - - int temp_fd[2]; - if (pipe(temp_fd) == -1) { - perror("pipe"); - exit(EXIT_FAILURE); - } - - // Debug: Track each part of the concatenation - std::cout << "[DEBUG] Number of parts in concatenation: " << concat.parts.size() << std::endl; - - for (size_t i = 0; i < concat.parts.size(); ++i) { - const std::string &part_name = concat.parts[i]; - std::cout << "[DEBUG] Executing part: " << part_name << std::endl; - - if (nodes.find(part_name) != nodes.end()) { - std::cout << "[DEBUG] Part " << part_name << " is a node" << std::endl; - execute_node(nodes[part_name], temp_fd[0], i < concat.parts.size() - 1); - } else if (pipes.find(part_name) != pipes.end()) { - std::cout << "[DEBUG] Part " << part_name << " is a pipe" << std::endl; - execute_pipe(pipes[part_name]); - } - } - - // Debug: Output after concatenation before passing to wc - std::cout << "[DEBUG] Concatenation output before final command" << std::endl; - - // Now pipe the concatenated output into wc (or any other final command) - pid_t pid_wc = fork(); - if (pid_wc == 0) { - // Redirect the concatenated output (temp_fd[0]) to wc's stdin - dup2(temp_fd[0], STDIN_FILENO); // wc reads from temp_fd[0] - close(temp_fd[0]); - - // Execute the final command (e.g., wc) - std::cout << "[DEBUG] Executing final command: " << pipe_to << std::endl; - execute_node(nodes[pipe_to]); - } - - close(temp_fd[0]); - close(temp_fd[1]); - - // Debug: Wait for the final command to finish - std::cout << "[DEBUG] Waiting for final command to finish" << std::endl; - waitpid(pid_wc, nullptr, 0); - std::cout << "[DEBUG] Final command finished" << std::endl; -} - - -// Function to parse and store a node -void parse_node(const std::string &line, std::ifstream &flow_file) { - std::string name, command_line; - - std::string prefix = "node="; - if (line.substr(0, prefix.length()) == prefix) { - name = line.substr(prefix.length()); - } else { - std::cerr << "[DEBUG] Error: Invalid node format: " << line << "\n"; - return; - } - - std::getline(flow_file, command_line); - - std::string command_prefix = "command="; - if (command_line.substr(0, command_prefix.length()) == command_prefix) { - command_line = command_line.substr(command_prefix.length()); - } - - Node node; - node.name = name; - node.command = tokenize_command(command_line); - - nodes[name] = node; - std::cout << "[DEBUG] Parsed node: " << name << " with command: " << command_line << std::endl; -} - -// Function to parse and store a pipe -void parse_pipe(const std::string &line, std::ifstream &flow_file) { - std::string pipe_name, from, to; - - std::string prefix = "pipe="; - if (line.substr(0, prefix.length()) == prefix) { - pipe_name = line.substr(prefix.length()); - } else { - std::cerr << "[DEBUG] Error: Invalid pipe format: " << line << "\n"; - return; - } - - std::getline(flow_file, from); - from = from.substr(from.find('=') + 1); - - std::getline(flow_file, to); - to = to.substr(to.find('=') + 1); - - FlowPipe pipe; - pipe.from = from; - pipe.to = to; - - pipes[pipe_name] = pipe; - std::cout << "[DEBUG] Parsed pipe: " << pipe_name << " from " << from << " to " << to << std::endl; -} - -// Function to parse and store a concatenation -void parse_concatenation(const std::string &line, std::ifstream &flow_file) { - std::string concat_name, parts_line; - int part_count; - - std::string prefix = "concatenate="; - if (line.substr(0, prefix.length()) == prefix) { - concat_name = line.substr(prefix.length()); - } else { - std::cerr << "[DEBUG] Error: Invalid concatenation format: " << line << "\n"; - return; - } - - std::getline(flow_file, parts_line); - sscanf(parts_line.c_str(), "parts=%d", &part_count); - - Concatenation concat; - concat.name = concat_name; - - for (int i = 0; i < part_count; ++i) { - std::string part; - std::getline(flow_file, part); - part = part.substr(part.find('=') + 1); - concat.parts.push_back(part); - } - - concatenations[concat_name] = concat; - std::cout << "[DEBUG] Parsed concatenation: " << concat_name << " with " << part_count << " parts" << std::endl; -} - -// Function to parse the flow file -void parse_flow_file(std::ifstream &flow_file) { - std::string line; - - while (std::getline(flow_file, line)) { - if (line.find("node=") == 0) { - parse_node(line, flow_file); - } else if (line.find("pipe=") == 0) { - parse_pipe(line, flow_file); - } else if (line.find("concatenate=") == 0) { - parse_concatenation(line, flow_file); - } - } -} - -int main(int argc, char *argv[]) { - if (argc < 3) { - std::cerr << "Usage: " << argv[0] << " \n"; - exit(1); - } - - std::string flow_file_name = argv[1]; - std::string action = argv[2]; - - std::ifstream flow_file(flow_file_name); - if (!flow_file.is_open()) { - std::cerr << "[DEBUG] Error: Could not open flow file " << flow_file_name << "\n"; - exit(1); - } - - parse_flow_file(flow_file); - - if (pipes.find(action) != pipes.end()) { - std::cout << "[DEBUG] Executing pipe: " << action << std::endl; - execute_pipe(pipes[action]); - } else if (concatenations.find(action) != concatenations.end()) { - std::cout << "[DEBUG] Executing concatenation: " << action << std::endl; - execute_concatenation(concatenations[action], action); - } else { - std::cerr << "[DEBUG] Error: Unknown action '" << action << "'\n"; - return 1; - } - - return 0; -} diff --git a/src/flow5.cpp b/src/flow5.cpp deleted file mode 100644 index 1c8b78c..0000000 --- a/src/flow5.cpp +++ /dev/null @@ -1,301 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Struct for nodes (commands) -struct Node { - std::string name; - std::vector command; -}; - -// Struct to represent pipes between nodes -struct FlowPipe { - std::string from; - std::string to; -}; - -// Maps to store nodes and pipes -std::map nodes; -std::map pipes; - -// Global variable to store intermediate pipe input/output -std::string global_pipe_input = ""; - -// Helper function to tokenize command strings, handling quoted strings -std::vector tokenize_command(const std::string &command_line) { - std::vector tokens; - std::istringstream iss(command_line); - std::string token; - - while (iss >> token) { - if (token[0] == '"' || token[0] == '\'') { - char quote_char = token[0]; - std::string quoted_token = token; - - while (quoted_token.back() != quote_char || quoted_token.length() == 1) { - std::string next_token; - if (!(iss >> next_token)) { - std::cerr << "Error: Mismatched quotes in command: " << command_line << "\n"; - return tokens; - } - quoted_token += " " + next_token; - } - - quoted_token = quoted_token.substr(1, quoted_token.length() - 2); - tokens.push_back(quoted_token); - } else { - tokens.push_back(token); - } - } - return tokens; -} - -// Function to prepare args for execvp -std::vector prepare_args(const Node &node) { - std::vector args; - for (const auto &arg : node.command) { - args.push_back(const_cast(arg.c_str())); - } - args.push_back(nullptr); // Null-terminated list of arguments - return args; -} - -// Function to execute a node command using execvp -void execute_node(const Node &node) { - std::vector args = prepare_args(node); - if (execvp(args[0], args.data()) == -1) { - perror("[ERROR] execvp failed"); - exit(EXIT_FAILURE); - } -} - -// Function to capture the output from a file descriptor (pipe) -std::string capture_output(int fd) { - std::string output; - char buffer[1024]; - ssize_t bytes_read; - while ((bytes_read = read(fd, buffer, sizeof(buffer) - 1)) > 0) { - buffer[bytes_read] = '\0'; - output += buffer; - } - return output; -} - -// Function to execute a pipe -std::string execute_pipe(const FlowPipe &flow_pipe) { - std::cout << "[DEBUG] Executing pipe from " << flow_pipe.from << " to " << flow_pipe.to << std::endl; - - int pipefd[2]; - if (pipe(pipefd) == -1) { - perror("[ERROR] pipe creation failed"); - exit(EXIT_FAILURE); - } - - // Fork for the producer (first command) - pid_t pid1 = fork(); - if (pid1 == -1) { - perror("[ERROR] fork failed for producer"); - exit(EXIT_FAILURE); - } - - if (pid1 == 0) { // Child process 1 (producer) - std::cout << "[DEBUG] Entering producer child process: " << flow_pipe.from << std::endl; - close(pipefd[0]); // Close unused read end - dup2(pipefd[1], STDOUT_FILENO); // Redirect stdout to pipe write end - close(pipefd[1]); // Close the write end after redirection - - // Check if the producer (flow_pipe.from) is a pipe or node - if (pipes.find(flow_pipe.from) != pipes.end()) { - // It's a pipe, execute the pipe recursively - std::string producer_output = execute_pipe(pipes[flow_pipe.from]); - // Write producer output to the current pipe (so that consumer gets this output) - write(STDOUT_FILENO, producer_output.c_str(), producer_output.size()); - } else if (nodes.find(flow_pipe.from) != nodes.end()) { - // It's a node, execute the node - execute_node(nodes[flow_pipe.from]); - } else { - std::cerr << "[ERROR] Unknown producer (from): " << flow_pipe.from << std::endl; - _exit(EXIT_FAILURE); - } - - std::cerr << "[ERROR] execvp failed for producer\n"; - _exit(EXIT_FAILURE); // Exit if execvp fails - } - - close(pipefd[1]); // Parent closes the write end of the pipe (no need to write anymore) - - // Wait for the producer to finish - std::cout << "[DEBUG] Waiting for producer (pid1) to finish...\n"; - waitpid(pid1, nullptr, 0); - std::cout << "[DEBUG] Producer (pid1) finished\n"; - - // Capture the output from the producer - std::string producer_output = capture_output(pipefd[0]); // Read from the pipe connected to producer's stdout - close(pipefd[0]); // Parent closes the read end of the pipe - - std::cout << "[DEBUG] Producer finished. Captured output: \n" << producer_output << std::endl; - - // Create a new pipe for the consumer process - int consumer_pipefd[2]; - if (pipe(consumer_pipefd) == -1) { - perror("[ERROR] pipe creation failed for consumer_pipefd"); - exit(EXIT_FAILURE); - } - - // Fork for the consumer (second command) - pid_t pid2 = fork(); - if (pid2 == -1) { - perror("[ERROR] fork failed for consumer"); - exit(EXIT_FAILURE); - } - - if (pid2 == 0) { // Child process 2 (consumer) - std::cout << "[DEBUG] Entering consumer child process: " << flow_pipe.to << std::endl; - close(consumer_pipefd[0]); // Close unused read end of the consumer pipe - dup2(consumer_pipefd[1], STDOUT_FILENO); // Redirect stdout to the consumer pipe (to capture output) - close(consumer_pipefd[1]); // Close the write end after redirection - - // Redirect the producer's output to the consumer's stdin - int temp_pipefd[2]; - if (pipe(temp_pipefd) == -1) { - perror("[ERROR] temp pipe creation failed"); - exit(EXIT_FAILURE); - } - write(temp_pipefd[1], producer_output.c_str(), producer_output.size()); // Write producer output to a temp pipe - close(temp_pipefd[1]); // Close write end of temp pipe after writing - - dup2(temp_pipefd[0], STDIN_FILENO); // Redirect the temp pipe to the consumer's stdin - close(temp_pipefd[0]); // Close read end after redirection - - // Check if the consumer (flow_pipe.to) is a pipe or node - if (pipes.find(flow_pipe.to) != pipes.end()) { - // It's a pipe, execute the pipe recursively - execute_pipe(pipes[flow_pipe.to]); - } else if (nodes.find(flow_pipe.to) != nodes.end()) { - // It's a node, execute the node - execute_node(nodes[flow_pipe.to]); - } else { - std::cerr << "[ERROR] Unknown consumer (to): " << flow_pipe.to << std::endl; - _exit(EXIT_FAILURE); - } - - std::cerr << "[ERROR] execvp failed for consumer\n"; - _exit(EXIT_FAILURE); // Exit if execvp fails - } - - close(consumer_pipefd[1]); // Parent closes the write end of the consumer pipe - - // Wait for the consumer to finish - std::cout << "[DEBUG] Waiting for consumer (pid2) to finish...\n"; - waitpid(pid2, nullptr, 0); - std::cout << "[DEBUG] Consumer (pid2) finished\n"; - - // Capture the consumer's output - std::string consumer_output = capture_output(consumer_pipefd[0]); // Read from the consumer pipe - close(consumer_pipefd[0]); // Close read end after capturing output - - std::cout << "[DEBUG] Consumer finished. Captured output: \n" << consumer_output << std::endl; - - return consumer_output; // Return the consumer's output -} - -// Function to parse and store a node -void parse_node(const std::string &line, std::ifstream &flow_file) { - std::string name, command_line; - - std::string prefix = "node="; - if (line.substr(0, prefix.length()) == prefix) { - name = line.substr(prefix.length()); - } else { - std::cerr << "[ERROR] Invalid node format: " << line << "\n"; - return; - } - - std::getline(flow_file, command_line); - - std::string command_prefix = "command="; - if (command_line.substr(0, command_prefix.length()) == command_prefix) { - command_line = command_line.substr(command_prefix.length()); - } - - Node node; - node.name = name; - node.command = tokenize_command(command_line); - - nodes[name] = node; - std::cout << "[DEBUG] Parsed node: " << name << " with command: " << command_line << std::endl; -} - -// Function to parse and store a pipe -void parse_pipe(const std::string &line, std::ifstream &flow_file) { - std::string pipe_name, from, to; - - std::string prefix = "pipe="; - if (line.substr(0, prefix.length()) == prefix) { - pipe_name = line.substr(prefix.length()); - } else { - std::cerr << "[ERROR] Invalid pipe format: " << line << "\n"; - return; - } - - std::getline(flow_file, from); - from = from.substr(from.find('=') + 1); - - std::getline(flow_file, to); - to = to.substr(to.find('=') + 1); - - FlowPipe pipe; - pipe.from = from; - pipe.to = to; - - pipes[pipe_name] = pipe; - std::cout << "[DEBUG] Parsed pipe: " << pipe_name << " from " << from << " to " << to << std::endl; -} - -// Function to parse the flow file -void parse_flow_file(std::ifstream &flow_file) { - std::string line; - - while (std::getline(flow_file, line)) { - if (line.find("node=") == 0) { - parse_node(line, flow_file); - } else if (line.find("pipe=") == 0) { - parse_pipe(line, flow_file); - } - } -} - -int main(int argc, char *argv[]) { - if (argc < 3) { - std::cerr << "Usage: " << argv[0] << " \n"; - exit(1); - } - - std::string flow_file_name = argv[1]; - std::string action = argv[2]; - - std::ifstream flow_file(flow_file_name); - if (!flow_file.is_open()) { - std::cerr << "[ERROR] Could not open flow file " << flow_file_name << "\n"; - exit(1); - } - - parse_flow_file(flow_file); - - if (pipes.find(action) != pipes.end()) { - std::cout << "[DEBUG] Executing pipe: " << action << std::endl; - std::string result = execute_pipe(pipes[action]); - std::cout << "Final Output:\n" << result << std::endl; - } else { - std::cerr << "[ERROR] Unknown action '" << action << "'\n"; - return 1; - } - - return 0; -} diff --git a/src/flow6.cpp b/src/flow6.cpp deleted file mode 100644 index 8cc6d03..0000000 --- a/src/flow6.cpp +++ /dev/null @@ -1,277 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Struct for nodes, pipes, and concatenations -struct Node { - std::string name; - std::vector command; -}; - -struct FlowPipe { - std::string from; - std::string to; -}; - -// Maps for storing nodes and pipes -std::map nodes; -std::map pipes; - -// Global variable to maintain intermediate output -std::string global_pipe_input; - -// Helper function to tokenize command strings, treating quoted strings as a single token -std::vector tokenize_command(const std::string &command_line) { - std::vector tokens; - std::istringstream iss(command_line); - std::string token; - - while (iss >> token) { - if (token[0] == '"' || token[0] == '\'') { - char quote_char = token[0]; - std::string quoted_token = token; - - while (quoted_token.back() != quote_char || quoted_token.length() == 1) { - std::string next_token; - if (!(iss >> next_token)) { - std::cerr << "Error: Mismatched quotes in command: " << command_line << "\n"; - return tokens; - } - quoted_token += " " + next_token; - } - - quoted_token = quoted_token.substr(1, quoted_token.length() - 2); - tokens.push_back(quoted_token); - } else { - tokens.push_back(token); - } - } - return tokens; -} - -// Function to prepare args for execvp -std::vector prepare_args(const Node &node) { - std::vector args; - for (const auto &arg : node.command) { - args.push_back(const_cast(arg.c_str())); - } - args.push_back(nullptr); // Null-terminated list of arguments - return args; -} - -// Function to execute a node command using execvp -void execute_node(const Node &node) { - std::vector args = prepare_args(node); - execvp(args[0], args.data()); // Execute the command - perror("[ERROR] execvp failed"); // Only reached if execvp fails - _exit(EXIT_FAILURE); // Exit if execvp fails -} - -// Function to capture output from a file descriptor -std::string capture_output(int fd) { - char buffer[4096]; - std::string output; - ssize_t bytes_read; - - while ((bytes_read = read(fd, buffer, sizeof(buffer) - 1)) > 0) { - buffer[bytes_read] = '\0'; - output += buffer; - } - return output; -} - -// Function to execute a pipe (from-to pair, where from and to can be either nodes or pipes) -std::string execute_pipe(const FlowPipe &flow_pipe) { - std::cout << "[DEBUG] Executing pipe from " << flow_pipe.from << " to " << flow_pipe.to << std::endl; - - // Recursively execute 'from' part (which can be a pipe or node) - std::string producer_output; - if (pipes.find(flow_pipe.from) != pipes.end()) { - // 'from' is another pipe, recursively call execute_pipe - producer_output = execute_pipe(pipes[flow_pipe.from]); - } else if (nodes.find(flow_pipe.from) != nodes.end()) { - // 'from' is a node, execute it and capture output - int pipefd[2]; - if (pipe(pipefd) == -1) { - perror("[ERROR] pipe creation failed"); - exit(EXIT_FAILURE); - } - - pid_t pid1 = fork(); - if (pid1 == -1) { - perror("[ERROR] fork failed for producer"); - exit(EXIT_FAILURE); - } - - if (pid1 == 0) { // Child process 1 (producer) - close(pipefd[0]); // Close unused read end - dup2(pipefd[1], STDOUT_FILENO); // Redirect stdout to pipe write end - close(pipefd[1]); // Close the write end after redirection - - execute_node(nodes[flow_pipe.from]); // Execute the node (producer) - _exit(EXIT_SUCCESS); // Exit the child process - } - - close(pipefd[1]); // Parent closes the write end of the pipe - - // Wait for the producer to finish - waitpid(pid1, nullptr, 0); - - // Capture the output from the producer - producer_output = capture_output(pipefd[0]); // Read from the pipe connected to producer's stdout - close(pipefd[0]); // Parent closes the read end of the pipe - } - - // Recursively execute 'to' part (which can be a pipe or node) - if (pipes.find(flow_pipe.to) != pipes.end()) { - // 'to' is another pipe, recursively call execute_pipe - global_pipe_input = producer_output; // Store the output in the global variable - return execute_pipe(pipes[flow_pipe.to]); // Recursive call for the 'to' part if it's a pipe - } else if (nodes.find(flow_pipe.to) != nodes.end()) { - // 'to' is a node, execute the node with the producer output as input - int pipefd[2]; - if (pipe(pipefd) == -1) { - perror("[ERROR] pipe creation failed"); - exit(EXIT_FAILURE); - } - - pid_t pid2 = fork(); - if (pid2 == -1) { - perror("[ERROR] fork failed for consumer"); - exit(EXIT_FAILURE); - } - - if (pid2 == 0) { // Child process 2 (consumer) - close(pipefd[0]); // Close unused read end - dup2(pipefd[1], STDOUT_FILENO); // Redirect stdout to pipe write end - close(pipefd[1]); // Close the write end after redirection - - // Pass the producer's output to the consumer's stdin - int temp_pipefd[2]; - if (pipe(temp_pipefd) == -1) { - perror("[ERROR] temp pipe creation failed"); - exit(EXIT_FAILURE); - } - write(temp_pipefd[1], producer_output.c_str(), producer_output.size()); // Write producer output to a temp pipe - close(temp_pipefd[1]); // Close write end after writing - dup2(temp_pipefd[0], STDIN_FILENO); // Redirect temp pipe to consumer's stdin - close(temp_pipefd[0]); // Close read end after redirection - - execute_node(nodes[flow_pipe.to]); // Execute the node (consumer) - _exit(EXIT_SUCCESS); // Exit the child process - } - - close(pipefd[1]); // Parent closes the write end of the pipe - - // Wait for the consumer to finish - waitpid(pid2, nullptr, 0); - - // Capture the consumer's output - std::string consumer_output = capture_output(pipefd[0]); // Read from the consumer pipe - close(pipefd[0]); // Parent closes the read end of the pipe - return consumer_output; - } - - return ""; // Return empty string if no valid pipe or node is found -} - -// Function to parse and store a node -void parse_node(const std::string &line, std::ifstream &flow_file) { - std::string name, command_line; - - std::string prefix = "node="; - if (line.substr(0, prefix.length()) == prefix) { - name = line.substr(prefix.length()); - } else { - std::cerr << "[DEBUG] Error: Invalid node format: " << line << "\n"; - return; - } - - std::getline(flow_file, command_line); - - std::string command_prefix = "command="; - if (command_line.substr(0, command_prefix.length()) == command_prefix) { - command_line = command_line.substr(command_prefix.length()); - } - - Node node; - node.name = name; - node.command = tokenize_command(command_line); - - nodes[name] = node; - std::cout << "[DEBUG] Parsed node: " << name << " with command: " << command_line << std::endl; -} - -// Function to parse and store a pipe -void parse_pipe(const std::string &line, std::ifstream &flow_file) { - std::string pipe_name, from, to; - - std::string prefix = "pipe="; - if (line.substr(0, prefix.length()) == prefix) { - pipe_name = line.substr(prefix.length()); - } else { - std::cerr << "[DEBUG] Error: Invalid pipe format: " << line << "\n"; - return; - } - - std::getline(flow_file, from); - from = from.substr(from.find('=') + 1); - - std::getline(flow_file, to); - to = to.substr(to.find('=') + 1); - - FlowPipe pipe; - pipe.from = from; - pipe.to = to; - - pipes[pipe_name] = pipe; - std::cout << "[DEBUG] Parsed pipe: " << pipe_name << " from " << from << " to " << to << std::endl; -} - -// Function to parse the flow file -void parse_flow_file(std::ifstream &flow_file) { - std::string line; - - while (std::getline(flow_file, line)) { - if (line.find("node=") == 0) { - parse_node(line, flow_file); - } else if (line.find("pipe=") == 0) { - parse_pipe(line, flow_file); - } - } -} - -int main(int argc, char *argv[]) { - if (argc < 3) { - std::cerr << "Usage: " << argv[0] << " \n"; - exit(1); - } - - std::string flow_file_name = argv[1]; - std::string action = argv[2]; - - std::ifstream flow_file(flow_file_name); - if (!flow_file.is_open()) { - std::cerr << "[DEBUG] Error: Could not open flow file " << flow_file_name << "\n"; - exit(1); - } - - parse_flow_file(flow_file); - - if (pipes.find(action) != pipes.end()) { - std::cout << "[DEBUG] Executing pipe: " << action << std::endl; - std::string final_output = execute_pipe(pipes[action]); - std::cout << "Final Output:\n" << final_output; - } else { - std::cerr << "[DEBUG] Error: Unknown action '" << action << "'\n"; - return 1; - } - - return 0; -} \ No newline at end of file diff --git a/src/flow7.cpp b/src/flow7.cpp deleted file mode 100644 index 84c4ada..0000000 --- a/src/flow7.cpp +++ /dev/null @@ -1,275 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Struct for nodes and pipes -struct Node { - std::string name; - std::vector command; -}; - -struct FlowPipe { - std::string from; - std::string to; -}; - -// Maps for storing nodes and pipes -std::map nodes; -std::map pipes; - -// Helper function to tokenize command strings, treating quoted strings as a single token -std::vector tokenize_command(const std::string &command_line) { - std::vector tokens; - std::istringstream iss(command_line); - std::string token; - - while (iss >> token) { - if (token[0] == '"' || token[0] == '\'') { - char quote_char = token[0]; - std::string quoted_token = token; - - while (quoted_token.back() != quote_char || quoted_token.length() == 1) { - std::string next_token; - if (!(iss >> next_token)) { - std::cerr << "Error: Mismatched quotes in command: " << command_line << "\n"; - return tokens; - } - quoted_token += " " + next_token; - } - - quoted_token = quoted_token.substr(1, quoted_token.length() - 2); - tokens.push_back(quoted_token); - } else { - tokens.push_back(token); - } - } - return tokens; -} - -// Function to prepare args for execvp -std::vector prepare_args(const Node &node) { - std::vector args; - for (const auto &arg : node.command) { - args.push_back(const_cast(arg.c_str())); - } - args.push_back(nullptr); // Null-terminated list of arguments - return args; -} - -// Function to execute a node command using execvp -void execute_node(const Node &node) { - std::vector args = prepare_args(node); - execvp(args[0], args.data()); // Execute the command - perror("[ERROR] execvp failed"); // Only reached if execvp fails - _exit(EXIT_FAILURE); // Exit if execvp fails -} - -// Function to capture output from a file descriptor -std::string capture_output(int fd) { - char buffer[4096]; - std::string output; - ssize_t bytes_read; - - while ((bytes_read = read(fd, buffer, sizeof(buffer) - 1)) > 0) { - buffer[bytes_read] = '\0'; - output += buffer; - } - return output; -} - -// Function to handle recursive pipe execution -std::string execute_pipe(const FlowPipe &flow_pipe) { - std::cout << "[DEBUG] Executing pipe from " << flow_pipe.from << " to " << flow_pipe.to << std::endl; - - // Recursively execute 'from' part (which can be a pipe or node) - std::string producer_output; - if (pipes.find(flow_pipe.from) != pipes.end()) { - // 'from' is another pipe, recursively call execute_pipe - producer_output = execute_pipe(pipes[flow_pipe.from]); - } else if (nodes.find(flow_pipe.from) != nodes.end()) { - // 'from' is a node, execute it and capture output - int pipefd[2]; - if (pipe(pipefd) == -1) { - perror("[ERROR] pipe creation failed"); - exit(EXIT_FAILURE); - } - - pid_t pid1 = fork(); - if (pid1 == -1) { - perror("[ERROR] fork failed for producer"); - exit(EXIT_FAILURE); - } - - if (pid1 == 0) { // Child process 1 (producer) - close(pipefd[0]); // Close unused read end - dup2(pipefd[1], STDOUT_FILENO); // Redirect stdout to pipe write end - close(pipefd[1]); // Close the write end after redirection - - execute_node(nodes[flow_pipe.from]); // Execute the node (producer) - _exit(EXIT_SUCCESS); // Exit the child process - } - - close(pipefd[1]); // Parent closes the write end of the pipe - - // Wait for the producer to finish - waitpid(pid1, nullptr, 0); - - // Capture the output from the producer - producer_output = capture_output(pipefd[0]); // Read from the pipe connected to producer's stdout - close(pipefd[0]); // Parent closes the read end of the pipe - - std::cout << "[DEBUG] Producer finished. Captured output: \n" << producer_output << std::endl; - } - - // Recursively execute 'to' part (which can be a pipe or node) - if (pipes.find(flow_pipe.to) != pipes.end()) { - // 'to' is another pipe, recursively call execute_pipe - return execute_pipe(pipes[flow_pipe.to]); - } else if (nodes.find(flow_pipe.to) != nodes.end()) { - // 'to' is a node, execute the node with the producer output as input - int pipefd[2]; - if (pipe(pipefd) == -1) { - perror("[ERROR] pipe creation failed"); - exit(EXIT_FAILURE); - } - - pid_t pid2 = fork(); - if (pid2 == -1) { - perror("[ERROR] fork failed for consumer"); - exit(EXIT_FAILURE); - } - - if (pid2 == 0) { // Child process 2 (consumer) - close(pipefd[0]); // Close unused read end - dup2(pipefd[1], STDOUT_FILENO); // Redirect stdout to pipe write end - close(pipefd[1]); // Close the write end after redirection - - // Pass the producer's output to the consumer's stdin - int temp_pipefd[2]; - if (pipe(temp_pipefd) == -1) { - perror("[ERROR] temp pipe creation failed"); - exit(EXIT_FAILURE); - } - write(temp_pipefd[1], producer_output.c_str(), producer_output.size()); // Write producer output to a temp pipe - close(temp_pipefd[1]); // Close write end after writing - dup2(temp_pipefd[0], STDIN_FILENO); // Redirect temp pipe to consumer's stdin - close(temp_pipefd[0]); // Close read end after redirection - - execute_node(nodes[flow_pipe.to]); // Execute the node (consumer) - _exit(EXIT_SUCCESS); // Exit the child process - } - - close(pipefd[1]); // Parent closes the write end of the pipe - - // Wait for the consumer to finish - waitpid(pid2, nullptr, 0); - - // Capture the consumer's output - std::string consumer_output = capture_output(pipefd[0]); // Read from the consumer pipe - close(pipefd[0]); // Parent closes the read end of the pipe - return consumer_output; - } - - return ""; // Return empty string if no valid pipe or node is found -} - -// Function to parse and store a node -void parse_node(const std::string &line, std::ifstream &flow_file) { - std::string name, command_line; - - std::string prefix = "node="; - if (line.substr(0, prefix.length()) == prefix) { - name = line.substr(prefix.length()); - } else { - std::cerr << "[DEBUG] Error: Invalid node format: " << line << "\n"; - return; - } - - std::getline(flow_file, command_line); - - std::string command_prefix = "command="; - if (command_line.substr(0, command_prefix.length()) == command_prefix) { - command_line = command_line.substr(command_prefix.length()); - } - - Node node; - node.name = name; - node.command = tokenize_command(command_line); - - nodes[name] = node; - std::cout << "[DEBUG] Parsed node: " << name << " with command: " << command_line << std::endl; -} - -// Function to parse and store a pipe -void parse_pipe(const std::string &line, std::ifstream &flow_file) { - std::string pipe_name, from, to; - - std::string prefix = "pipe="; - if (line.substr(0, prefix.length()) == prefix) { - pipe_name = line.substr(prefix.length()); - } else { - std::cerr << "[DEBUG] Error: Invalid pipe format: " << line << "\n"; - return; - } - - std::getline(flow_file, from); - from = from.substr(from.find('=') + 1); - - std::getline(flow_file, to); - to = to.substr(to.find('=') + 1); - - FlowPipe pipe; - pipe.from = from; - pipe.to = to; - - pipes[pipe_name] = pipe; - std::cout << "[DEBUG] Parsed pipe: " << pipe_name << " from " << from << " to " << to << std::endl; -} - -// Function to parse the flow file -void parse_flow_file(std::ifstream &flow_file) { - std::string line; - - while (std::getline(flow_file, line)) { - if (line.find("node=") == 0) { - parse_node(line, flow_file); - } else if (line.find("pipe=") == 0) { - parse_pipe(line, flow_file); - } - } -} - -int main(int argc, char *argv[]) { - if (argc < 3) { - std::cerr << "Usage: " << argv[0] << " \n"; - exit(1); - } - - std::string flow_file_name = argv[1]; - std::string action = argv[2]; - - std::ifstream flow_file(flow_file_name); - if (!flow_file.is_open()) { - std::cerr << "[DEBUG] Error: Could not open flow file " << flow_file_name << "\n"; - exit(1); - } - - parse_flow_file(flow_file); - - if (pipes.find(action) != pipes.end()) { - std::cout << "[DEBUG] Executing pipe: " << action << std::endl; - std::string final_output = execute_pipe(pipes[action]); - std::cout << "Final Output:\n" << final_output; - } else { - std::cerr << "[DEBUG] Error: Unknown action '" << action << "'\n"; - return 1; - } - - return 0; -} diff --git a/src/flow7_1.cpp b/src/flow7_1.cpp deleted file mode 100644 index 3d86d6f..0000000 --- a/src/flow7_1.cpp +++ /dev/null @@ -1,341 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Structs for nodes and pipes -struct Node { - std::string name; - std::vector command; -}; - -struct FlowPipe { - std::string from; - std::string to; -}; - -// Maps for storing nodes and pipes -std::map nodes; -std::map pipes; - -// Helper function to tokenize command strings, treating quoted strings as single tokens -std::vector tokenize_command(const std::string &command_line) { - std::vector tokens; - std::istringstream iss(command_line); - std::string token; - char quote_char = '\0'; - bool in_quotes = false; - - while (iss) { - char c = iss.get(); - - if (c == EOF) { - if (!token.empty()) { - tokens.push_back(token); - token.clear(); - } - break; - } - - if (in_quotes) { - if (c == quote_char) { - in_quotes = false; - } else { - token += c; - } - } else { - if (c == '\'' || c == '"') { - in_quotes = true; - quote_char = c; - } else if (isspace(c)) { - if (!token.empty()) { - tokens.push_back(token); - token.clear(); - } - } else { - token += c; - } - } - } - - if (in_quotes) { - std::cerr << "[ERROR] Mismatched quotes in command: " << command_line << "\n"; - exit(EXIT_FAILURE); - } - - return tokens; -} - -// Function to prepare args for execvp -std::vector prepare_args(const Node &node) { - std::vector args; - for (const auto &arg : node.command) { - args.push_back(const_cast(arg.c_str())); - } - args.push_back(nullptr); // Null-terminated list of arguments - return args; -} - -// Function to execute a node command using execvp -void execute_node(const Node &node) { - std::vector args = prepare_args(node); - execvp(args[0], args.data()); // Execute the command - perror("[ERROR] execvp failed"); // Only reached if execvp fails - _exit(EXIT_FAILURE); // Exit if execvp fails -} - -// Function to handle recursive pipe execution with concurrent processes -void execute_pipe(const FlowPipe &flow_pipe) { - std::cout << "[DEBUG] Executing pipe from " << flow_pipe.from << " to " << flow_pipe.to << std::endl; - - // Vector to store commands - std::vector command_nodes; - - // Set to keep track of visited nodes/pipes to prevent circular dependencies - std::set visited; - - // Recursive function to build command chain - std::function build_command_chain = [&](const std::string& name) { - if (visited.count(name)) { - std::cerr << "[ERROR] Detected circular dependency involving: " << name << std::endl; - exit(EXIT_FAILURE); - } - visited.insert(name); - - if (nodes.find(name) != nodes.end()) { - command_nodes.push_back(nodes[name]); - } else if (pipes.find(name) != pipes.end()) { - build_command_chain(pipes[name].from); - build_command_chain(pipes[name].to); - } else { - std::cerr << "[ERROR] Unknown node or pipe: " << name << std::endl; - exit(EXIT_FAILURE); - } - }; - - // Build the command chain - build_command_chain(flow_pipe.from); - build_command_chain(flow_pipe.to); - - int num_commands = command_nodes.size(); - std::vector pipefds; - - // Create the necessary pipes - for (int i = 0; i < num_commands - 1; ++i) { - int fd[2]; - if (pipe(fd) == -1) { - perror("[ERROR] pipe creation failed"); - exit(EXIT_FAILURE); - } - pipefds.push_back(fd[0]); // read end - pipefds.push_back(fd[1]); // write end - } - - // Fork and execute commands - for (int i = 0; i < num_commands; ++i) { - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } else if (pid == 0) { - // Child process - - // If not the first command, set stdin to the previous pipe's read end - if (i > 0) { - if (dup2(pipefds[(i - 1) * 2], STDIN_FILENO) == -1) { - perror("[ERROR] dup2 stdin failed"); - exit(EXIT_FAILURE); - } - } - - // If not the last command, set stdout to the current pipe's write end - if (i < num_commands - 1) { - if (dup2(pipefds[i * 2 + 1], STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 stdout failed"); - exit(EXIT_FAILURE); - } - } - - // Close all pipe fds in child - for (size_t j = 0; j < pipefds.size(); ++j) { - close(pipefds[j]); - } - - // Execute the command - execute_node(command_nodes[i]); - _exit(EXIT_FAILURE); // Should not reach here - } - } - - // Parent process closes all pipe fds - for (size_t i = 0; i < pipefds.size(); ++i) { - close(pipefds[i]); - } - - // Wait for all child processes - int status; - for (int i = 0; i < num_commands; ++i) { - wait(&status); - if (WIFEXITED(status)) { - if (WEXITSTATUS(status) != 0) { - std::cerr << "[ERROR] Child process exited with error code: " << WEXITSTATUS(status) << std::endl; - } - } else if (WIFSIGNALED(status)) { - int sig = WTERMSIG(status); - if (sig != SIGPIPE) { - std::cerr << "[ERROR] Child process was terminated by signal: " << sig << std::endl; - } - // Else, silently ignore SIGPIPE - } - } -} - -// Function to parse and store a node -void parse_node(const std::string &line, std::ifstream &flow_file) { - std::string name, command_line; - - std::string prefix = "node="; - if (line.substr(0, prefix.length()) == prefix) { - name = line.substr(prefix.length()); - } else { - std::cerr << "[ERROR] Invalid node format: " << line << "\n"; - exit(EXIT_FAILURE); - } - - if (!std::getline(flow_file, command_line)) { - std::cerr << "[ERROR] Missing command for node: " << name << "\n"; - exit(EXIT_FAILURE); - } - - std::string command_prefix = "command="; - if (command_line.substr(0, command_prefix.length()) == command_prefix) { - command_line = command_line.substr(command_prefix.length()); - } else { - std::cerr << "[ERROR] Invalid command format for node: " << name << "\n"; - exit(EXIT_FAILURE); - } - - Node node; - node.name = name; - node.command = tokenize_command(command_line); - - nodes[name] = node; - std::cout << "[DEBUG] Parsed node: " << name << " with command: " << command_line << std::endl; -} - -// Function to parse and store a pipe -void parse_pipe(const std::string &line, std::ifstream &flow_file) { - std::string pipe_name, from_line, to_line; - - std::string prefix = "pipe="; - if (line.substr(0, prefix.length()) == prefix) { - pipe_name = line.substr(prefix.length()); - } else { - std::cerr << "[ERROR] Invalid pipe format: " << line << "\n"; - exit(EXIT_FAILURE); - } - - if (!std::getline(flow_file, from_line) || !std::getline(flow_file, to_line)) { - std::cerr << "[ERROR] Missing 'from' or 'to' for pipe: " << pipe_name << "\n"; - exit(EXIT_FAILURE); - } - - std::string from_prefix = "from="; - std::string to_prefix = "to="; - - if (from_line.substr(0, from_prefix.length()) != from_prefix || - to_line.substr(0, to_prefix.length()) != to_prefix) { - std::cerr << "[ERROR] Invalid 'from' or 'to' format for pipe: " << pipe_name << "\n"; - exit(EXIT_FAILURE); - } - - std::string from = from_line.substr(from_prefix.length()); - std::string to = to_line.substr(to_prefix.length()); - - FlowPipe pipe; - pipe.from = from; - pipe.to = to; - - pipes[pipe_name] = pipe; - std::cout << "[DEBUG] Parsed pipe: " << pipe_name << " from " << from << " to " << to << std::endl; -} - -// Function to parse the flow file -void parse_flow_file(std::ifstream &flow_file) { - std::string line; - - while (std::getline(flow_file, line)) { - if (line.empty()) continue; - - if (line.find("node=") == 0) { - parse_node(line, flow_file); - } else if (line.find("pipe=") == 0) { - parse_pipe(line, flow_file); - } - } -} - -int main(int argc, char *argv[]) { - if (argc < 3) { - std::cerr << "Usage: " << argv[0] << " \n"; - exit(1); - } - - std::string flow_file_name = argv[1]; - std::string action = argv[2]; - - std::ifstream flow_file(flow_file_name); - if (!flow_file.is_open()) { - std::cerr << "[ERROR] Could not open flow file " << flow_file_name << "\n"; - exit(1); - } - - parse_flow_file(flow_file); - - if (pipes.find(action) != pipes.end()) { - std::cout << "[DEBUG] Executing pipe: " << action << std::endl; - execute_pipe(pipes[action]); - } else if (nodes.find(action) != nodes.end()) { - std::cout << "[DEBUG] Executing node: " << action << std::endl; - - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } - - if (pid == 0) { // Child process - execute_node(nodes[action]); // Execute the node - _exit(EXIT_FAILURE); // Should not reach here - } - - // Wait for the child process to finish - int status; - waitpid(pid, &status, 0); - if (WIFEXITED(status)) { - if (WEXITSTATUS(status) != 0) { - std::cerr << "[ERROR] Child process exited with error code: " << WEXITSTATUS(status) << std::endl; - } - } else if (WIFSIGNALED(status)) { - int sig = WTERMSIG(status); - if (sig != SIGPIPE) { - std::cerr << "[ERROR] Child process was terminated by signal: " << sig << std::endl; - } - // Else, silently ignore SIGPIPE - } - } else { - std::cerr << "[ERROR] Unknown action '" << action << "'\n"; - return 1; - } - - return 0; -} \ No newline at end of file diff --git a/src/flow8.cpp b/src/flow8.cpp deleted file mode 100644 index 4269f1d..0000000 --- a/src/flow8.cpp +++ /dev/null @@ -1,213 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct Concatenation { - std::vector parts; -}; - -std::unordered_map nodes; // Maps node names to commands -std::unordered_map concatenations; // Maps concatenation names to their parts - -/** - * Split a string into tokens based on whitespace, respecting quotes. - */ -std::vector split(const std::string& s) { - std::vector tokens; - std::string token; - bool in_single_quote = false; - bool in_double_quote = false; - - for (size_t i = 0; i < s.length(); ++i) { - char c = s[i]; - - if (c == '\'' && !in_double_quote) { - in_single_quote = !in_single_quote; - continue; // Skip the quote character - } else if (c == '"' && !in_single_quote) { - in_double_quote = !in_double_quote; - continue; // Skip the quote character - } - - if (std::isspace(c) && !in_single_quote && !in_double_quote) { - if (!token.empty()) { - tokens.push_back(token); - token.clear(); - } - } else { - token += c; - } - } - - if (!token.empty()) { - tokens.push_back(token); - } - - return tokens; -} - -/** - * Parse the .flow file and populate nodes and concatenations. - */ -bool parseFlowFile(const std::string& filename) { - std::ifstream infile(filename); - if (!infile) { - std::cerr << "Error opening flow file: " << filename << std::endl; - return false; - } - - std::string line; - std::string currentNode; - std::string currentConcat; - while (std::getline(infile, line)) { - if (line.empty()) - continue; - - if (line.substr(0, 5) == "node=") { - currentNode = line.substr(5); - } else if (line.substr(0, 8) == "command=") { - if (currentNode.empty()) { - std::cerr << "Command defined without a node." << std::endl; - return false; - } - nodes[currentNode] = line.substr(8); - currentNode.clear(); - } else if (line.substr(0, 12) == "concatenate=") { - currentConcat = line.substr(12); - concatenations[currentConcat] = Concatenation(); - } else if (line.substr(0, 6) == "parts=") { - // Number of parts, can be ignored as we use dynamic vectors - } else if (line.substr(0, 5) == "part_") { - if (currentConcat.empty()) { - std::cerr << "Part defined without a concatenation." << std::endl; - return false; - } - size_t pos = line.find('='); - if (pos == std::string::npos) { - std::cerr << "Invalid part definition." << std::endl; - return false; - } - std::string partName = line.substr(pos + 1); - concatenations[currentConcat].parts.push_back(partName); - } - // Ignore other lines or add more parsing as needed - } - return true; -} - -/** - * Execute a command represented by a node. - */ -int executeNode(const std::string& nodeName) { - auto it = nodes.find(nodeName); - if (it == nodes.end()) { - std::cerr << "Node not found: " << nodeName << std::endl; - return -1; - } - - std::string command = it->second; - std::vector args = split(command); - - // Convert args to char* array for execvp - std::vector argv; - for (const auto& arg : args) { - argv.push_back(const_cast(arg.c_str())); - } - argv.push_back(nullptr); // Null-terminate the array - - pid_t pid = fork(); - if (pid == -1) { - perror("fork"); - return -1; - } else if (pid == 0) { - // Child process - execvp(argv[0], argv.data()); - // If execvp returns, an error occurred - perror("execvp"); - exit(EXIT_FAILURE); - } else { - // Parent process - int status; - waitpid(pid, &status, 0); - return status; - } -} - -/** - * Execute a concatenation action. - */ -int executeConcatenation(const std::string& concatName) { - auto it = concatenations.find(concatName); - if (it == concatenations.end()) { - std::cerr << "Concatenation not found: " << concatName << std::endl; - return -1; - } - - for (const auto& partName : it->second.parts) { - // Check if the part is a node - if (nodes.find(partName) != nodes.end()) { - int status = executeNode(partName); - if (status != 0) { - std::cerr << "Command failed: " << partName << std::endl; - return status; - } - } else if (concatenations.find(partName) != concatenations.end()) { - // If the part is another concatenation, execute it recursively - int status = executeConcatenation(partName); - if (status != 0) { - std::cerr << "Concatenation failed: " << partName << std::endl; - return status; - } - } else { - std::cerr << "Unknown part: " << partName << std::endl; - return -1; - } - } - return 0; -} - -/** - * Main function. - */ -int main(int argc, char* argv[]) { - if (argc != 3) { - std::cerr << "Usage: ./flow " << std::endl; - return EXIT_FAILURE; - } - - std::string flowFile = argv[1]; - std::string action = argv[2]; - - // Parse the flow file - if (!parseFlowFile(flowFile)) { - return EXIT_FAILURE; - } - - // Check if the action is a concatenation - if (concatenations.find(action) != concatenations.end()) { - int status = executeConcatenation(action); - if (status != 0) { - std::cerr << "Execution failed for action: " << action << std::endl; - return EXIT_FAILURE; - } - } else if (nodes.find(action) != nodes.end()) { - // If the action is a node, execute it directly - int status = executeNode(action); - if (status != 0) { - std::cerr << "Execution failed for node: " << action << std::endl; - return EXIT_FAILURE; - } - } else { - std::cerr << "Action not found: " << action << std::endl; - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; -} \ No newline at end of file diff --git a/src/mix.cpp b/src/mix.cpp deleted file mode 100644 index a744573..0000000 --- a/src/mix.cpp +++ /dev/null @@ -1,382 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Structs for nodes, pipes, and concatenations -struct Node { - std::string name; - std::vector command; -}; - -struct FlowPipe { - std::string from; - std::string to; -}; - -struct Concatenation { - std::vector parts; -}; - -// Maps for storing nodes, pipes, and concatenations -std::unordered_map nodes; // Maps node names to Node structs -std::unordered_map pipes; // Maps pipe names to FlowPipe structs -std::unordered_map concatenations; // Maps concatenation names to Concatenation structs - -// Function Declarations (Prototypes) - -// Helper function to tokenize command strings, treating quoted strings as single tokens. -std::vector tokenize_command(const std::string &command_line); - -// Function to prepare args for execvp. -std::vector prepare_args(const Node &node); - -// Function to execute a node command using execvp. -void execute_node(const Node &node); - -// Function to execute a single node, with optional output redirection. -void execute_single_node(const std::string &node_name, int output_fd = STDOUT_FILENO); - -// Function to execute a concatenation. -void execute_concatenation(const std::string &concat_name, int output_fd = STDOUT_FILENO); - -// Helper function to execute any action (node, pipe, or concatenation). -void execute_action(const std::string &action_name, int output_fd = STDOUT_FILENO); - -// Function to execute a pipe. -void execute_pipe(const std::string &pipe_name, int output_fd = STDOUT_FILENO); - -// Parse the .flow file and populate nodes, pipes, and concatenations. -void parse_flow_file(const std::string& filename); - -// Main function. -int main(int argc, char* argv[]); - -// Function Definitions - -/** - * Helper function to tokenize command strings, treating quoted strings as single tokens. - */ -std::vector tokenize_command(const std::string &command_line) { - std::vector tokens; - std::string token; - bool in_single_quote = false; - bool in_double_quote = false; - - for (size_t i = 0; i < command_line.length(); ++i) { - char c = command_line[i]; - - if (c == '\'' && !in_double_quote) { - in_single_quote = !in_single_quote; - continue; // Skip the quote character - } else if (c == '"' && !in_single_quote) { - in_double_quote = !in_double_quote; - continue; // Skip the quote character - } - - if (std::isspace(c) && !in_single_quote && !in_double_quote) { - if (!token.empty()) { - tokens.push_back(token); - token.clear(); - } - } else { - token += c; - } - } - - if (!token.empty()) { - tokens.push_back(token); - } - - return tokens; -} - -/** - * Function to prepare args for execvp. - */ -std::vector prepare_args(const Node &node) { - std::vector args; - for (const auto &arg : node.command) { - args.push_back(const_cast(arg.c_str())); - } - args.push_back(nullptr); // Null-terminated list of arguments - return args; -} - -/** - * Function to execute a node command using execvp. - */ -void execute_node(const Node &node) { - std::vector args = prepare_args(node); - execvp(args[0], args.data()); // Execute the command - perror("[ERROR] execvp failed"); // Only reached if execvp fails - _exit(EXIT_FAILURE); // Exit if execvp fails -} - -/** - * Function to execute a single node, with optional output redirection. - */ -void execute_single_node(const std::string &node_name, int output_fd) { - auto it = nodes.find(node_name); - if (it == nodes.end()) { - std::cerr << "[ERROR] Node not found: " << node_name << std::endl; - exit(EXIT_FAILURE); - } - - const Node &node = it->second; - - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } - - if (pid == 0) { // Child process - if (output_fd != STDOUT_FILENO) { - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); // Close after duplication - } - execute_node(node); // Execute the node - _exit(EXIT_FAILURE); // Should not reach here - } - - // Parent process waits for the child - int status; - waitpid(pid, &status, 0); - if (WIFEXITED(status)) { - if (WEXITSTATUS(status) != 0) { - std::cerr << "[ERROR] Child process exited with error code: " << WEXITSTATUS(status) << std::endl; - } - } else if (WIFSIGNALED(status)) { - int sig = WTERMSIG(status); - if (sig != SIGPIPE) { - std::cerr << "[ERROR] Child process was terminated by signal: " << sig << std::endl; - } - // Else, silently ignore SIGPIPE - } -} - -/** - * Function to execute a concatenation. - */ -void execute_concatenation(const std::string &concat_name, int output_fd) { - auto it = concatenations.find(concat_name); - if (it == concatenations.end()) { - std::cerr << "[ERROR] Concatenation not found: " << concat_name << std::endl; - exit(EXIT_FAILURE); - } - - const Concatenation &concat = it->second; - - for (const auto &part_name : concat.parts) { - // Execute each part - if (nodes.find(part_name) != nodes.end()) { - execute_single_node(part_name, output_fd); - } else if (pipes.find(part_name) != pipes.end()) { - execute_pipe(part_name, output_fd); - } else if (concatenations.find(part_name) != concatenations.end()) { - execute_concatenation(part_name, output_fd); - } else { - std::cerr << "[ERROR] Unknown part: " << part_name << std::endl; - exit(EXIT_FAILURE); - } - } -} - -/** - * Helper function to execute any action (node, pipe, or concatenation). - */ -void execute_action(const std::string &action_name, int output_fd) { - if (nodes.find(action_name) != nodes.end()) { - execute_single_node(action_name, output_fd); - } else if (pipes.find(action_name) != pipes.end()) { - execute_pipe(action_name, output_fd); - } else if (concatenations.find(action_name) != concatenations.end()) { - execute_concatenation(action_name, output_fd); - } else { - std::cerr << "[ERROR] Unknown action: " << action_name << std::endl; - exit(EXIT_FAILURE); - } -} - -/** - * Function to execute a pipe. - */ -void execute_pipe(const std::string &pipe_name, int output_fd) { - auto it = pipes.find(pipe_name); - if (it == pipes.end()) { - std::cerr << "[ERROR] Pipe not found: " << pipe_name << std::endl; - exit(EXIT_FAILURE); - } - - const FlowPipe &flow_pipe = it->second; - - int fd[2]; - if (pipe(fd) == -1) { - perror("[ERROR] pipe creation failed"); - exit(EXIT_FAILURE); - } - - pid_t pid_to = fork(); - if (pid_to == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } else if (pid_to == 0) { // Child process for 'to' - close(fd[1]); // Close write end - if (dup2(fd[0], STDIN_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(fd[0]); - - if (output_fd != STDOUT_FILENO) { - // Redirect output if necessary - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); - } - - // Corrected line: pass output_fd instead of STDOUT_FILENO - execute_action(flow_pipe.to, STDOUT_FILENO); - - _exit(EXIT_FAILURE); - } - - pid_t pid_from = fork(); - if (pid_from == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } else if (pid_from == 0) { // Child process for 'from' - close(fd[0]); // Close read end - if (dup2(fd[1], STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(fd[1]); - - execute_action(flow_pipe.from, STDOUT_FILENO); - - _exit(EXIT_FAILURE); - } - - // Parent process closes unused pipe ends and waits for child processes - close(fd[0]); - close(fd[1]); - - int status; - waitpid(pid_from, &status, 0); - waitpid(pid_to, &status, 0); -} - -/** - * Parse the .flow file and populate nodes, pipes, and concatenations. - */ -void parse_flow_file(const std::string& filename) { - std::ifstream flow_file(filename); - if (!flow_file.is_open()) { - std::cerr << "[ERROR] Could not open flow file " << filename << "\n"; - exit(1); - } - - std::string line; - while (std::getline(flow_file, line)) { - if (line.empty()) - continue; - - if (line.substr(0, 5) == "node=") { - std::string node_name = line.substr(5); - std::string command_line; - if (!std::getline(flow_file, command_line) || command_line.substr(0, 8) != "command=") { - std::cerr << "[ERROR] Missing command for node: " << node_name << "\n"; - exit(EXIT_FAILURE); - } - std::string command = command_line.substr(8); - Node node; - node.name = node_name; - node.command = tokenize_command(command); - nodes[node_name] = node; - std::cout << "[DEBUG] Parsed node: " << node_name << " with command: " << command << std::endl; - } else if (line.substr(0, 5) == "pipe=") { - std::string pipe_name = line.substr(5); - std::string from_line, to_line; - if (!std::getline(flow_file, from_line) || !std::getline(flow_file, to_line)) { - std::cerr << "[ERROR] Missing 'from' or 'to' for pipe: " << pipe_name << "\n"; - exit(EXIT_FAILURE); - } - if (from_line.substr(0, 5) != "from=" || to_line.substr(0, 3) != "to=") { - std::cerr << "[ERROR] Invalid 'from' or 'to' format for pipe: " << pipe_name << "\n"; - exit(EXIT_FAILURE); - } - std::string from = from_line.substr(5); - std::string to = to_line.substr(3); - FlowPipe pipe; - pipe.from = from; - pipe.to = to; - pipes[pipe_name] = pipe; - std::cout << "[DEBUG] Parsed pipe: " << pipe_name << " from " << from << " to " << to << std::endl; - } else if (line.substr(0, 12) == "concatenate=") { - std::string concat_name = line.substr(12); - std::string parts_line; - if (!std::getline(flow_file, parts_line) || parts_line.substr(0, 6) != "parts=") { - std::cerr << "[ERROR] Missing 'parts' for concatenation: " << concat_name << "\n"; - exit(EXIT_FAILURE); - } - int num_parts = std::stoi(parts_line.substr(6)); - Concatenation concat; - for (int i = 0; i < num_parts; ++i) { - std::string part_line; - if (!std::getline(flow_file, part_line)) { - std::cerr << "[ERROR] Missing 'part_" << i << "' for concatenation: " << concat_name << "\n"; - exit(EXIT_FAILURE); - } - std::string part_prefix = "part_" + std::to_string(i) + "="; - if (part_line.substr(0, part_prefix.length()) != part_prefix) { - std::cerr << "[ERROR] Invalid 'part_" << i << "' format for concatenation: " << concat_name << "\n"; - exit(EXIT_FAILURE); - } - std::string part_name = part_line.substr(part_prefix.length()); - concat.parts.push_back(part_name); - } - concatenations[concat_name] = concat; - std::cout << "[DEBUG] Parsed concatenation: " << concat_name << " with " << num_parts << " parts" << std::endl; - } - // Ignore other lines or add more parsing as needed - } -} - -/** - * Main function. - */ -int main(int argc, char* argv[]) { - if (argc != 3) { - std::cerr << "Usage: ./flow " << std::endl; - return EXIT_FAILURE; - } - - std::string flowFile = argv[1]; - std::string action = argv[2]; - - // Parse the flow file - parse_flow_file(flowFile); - - // Execute the action - std::cout << "[DEBUG] Executing action: " << action << std::endl; - execute_action(action, STDOUT_FILENO); - - return EXIT_SUCCESS; -} \ No newline at end of file diff --git a/src/mix2.cpp b/src/mix2.cpp deleted file mode 100644 index a3c4da6..0000000 --- a/src/mix2.cpp +++ /dev/null @@ -1,584 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Structs for nodes, pipes, concatenations, stderr captures, and file nodes -struct Node { - std::string name; - std::vector command; -}; - -struct FlowPipe { - std::string from; - std::string to; -}; - -struct Concatenation { - std::vector parts; -}; - -struct StderrCapture { - std::string name; - std::string from; -}; - -struct FileNode { - std::string name; - std::string filename; -}; - -// Maps for storing nodes, pipes, concatenations, stderr captures, and file nodes -std::unordered_map nodes; -std::unordered_map pipes; -std::unordered_map concatenations; -std::unordered_map stderrCaptures; -std::unordered_map fileNodes; - -// Function Declarations -std::vector tokenize_command(const std::string &command_line); -std::vector prepare_args(const Node &node); -void execute_node(const Node &node); -void execute_single_node(const std::string &node_name, int output_fd = STDOUT_FILENO); -void execute_concatenation(const std::string &concat_name, int output_fd = STDOUT_FILENO); -void execute_action(const std::string &action_name, int output_fd = STDOUT_FILENO); -void execute_pipe(const std::string &pipe_name, int output_fd = STDOUT_FILENO); -void execute_stderr_capture(const std::string &stderr_name, int output_fd = STDOUT_FILENO); -void execute_file_node(const std::string &file_node_name, int output_fd = STDOUT_FILENO); -void parse_flow_file(const std::string& filename); -int main(int argc, char* argv[]); - -// Function Definitions - -/** - * Helper function to tokenize command strings, treating quoted strings as single tokens. - */ -std::vector tokenize_command(const std::string &command_line) { - std::vector tokens; - std::string token; - bool in_single_quote = false; - bool in_double_quote = false; - - for (size_t i = 0; i < command_line.length(); ++i) { - char c = command_line[i]; - - if (c == '\'' && !in_double_quote) { - in_single_quote = !in_single_quote; - continue; // Skip the quote character - } else if (c == '"' && !in_single_quote) { - in_double_quote = !in_double_quote; - continue; // Skip the quote character - } - - if (std::isspace(c) && !in_single_quote && !in_double_quote) { - if (!token.empty()) { - tokens.push_back(token); - token.clear(); - } - } else { - token += c; - } - } - - if (!token.empty()) { - tokens.push_back(token); - } - - return tokens; -} - -/** - * Function to prepare args for execvp. - */ -std::vector prepare_args(const Node &node) { - std::vector args; - for (const auto &arg : node.command) { - args.push_back(const_cast(arg.c_str())); - } - args.push_back(nullptr); // Null-terminated list of arguments - return args; -} - -/** - * Function to execute a node command using execvp. - */ -void execute_node(const Node &node) { - std::vector args = prepare_args(node); - execvp(args[0], args.data()); // Execute the command - perror("[ERROR] execvp failed"); // Only reached if execvp fails - _exit(EXIT_FAILURE); // Exit if execvp fails -} - -/** - * Function to execute a single node, with optional output redirection. - */ -void execute_single_node(const std::string &node_name, int output_fd) { - auto it = nodes.find(node_name); - if (it == nodes.end()) { - std::cerr << "[ERROR] Node not found: " << node_name << std::endl; - exit(EXIT_FAILURE); - } - - const Node &node = it->second; - - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } - - if (pid == 0) { // Child process - if (output_fd != STDOUT_FILENO) { - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); // Close after duplication - } - execute_node(node); // Execute the node - _exit(EXIT_FAILURE); // Should not reach here - } - - // Parent process waits for the child - int status; - waitpid(pid, &status, 0); - if (WIFEXITED(status)) { - if (WEXITSTATUS(status) != 0) { - std::cerr << "[ERROR] Child process exited with error code: " << WEXITSTATUS(status) << std::endl; - } - } else if (WIFSIGNALED(status)) { - int sig = WTERMSIG(status); - if (sig != SIGPIPE) { - std::cerr << "[ERROR] Child process was terminated by signal: " << sig << std::endl; - } - } -} - -/** - * Function to execute a concatenation. - */ -void execute_concatenation(const std::string &concat_name, int output_fd) { - auto it = concatenations.find(concat_name); - if (it == concatenations.end()) { - std::cerr << "[ERROR] Concatenation not found: " << concat_name << std::endl; - exit(EXIT_FAILURE); - } - - const Concatenation &concat = it->second; - - for (const auto &part_name : concat.parts) { - // Execute each part - execute_action(part_name, output_fd); - } -} - -/** - * Helper function to execute any action (node, pipe, concatenation, stderr capture, or file node). - */ -void execute_action(const std::string &action_name, int output_fd) { - if (nodes.find(action_name) != nodes.end()) { - execute_single_node(action_name, output_fd); - } else if (pipes.find(action_name) != pipes.end()) { - execute_pipe(action_name, output_fd); - } else if (concatenations.find(action_name) != concatenations.end()) { - execute_concatenation(action_name, output_fd); - } else if (stderrCaptures.find(action_name) != stderrCaptures.end()) { - execute_stderr_capture(action_name, output_fd); - } else if (fileNodes.find(action_name) != fileNodes.end()) { - // Do nothing here; file nodes are handled in execute_pipe - execute_file_node(action_name, output_fd); - } else { - std::cerr << "[ERROR] Unknown action: " << action_name << std::endl; - exit(EXIT_FAILURE); - } -} - -/** - * Function to execute a pipe. - */ -void execute_pipe(const std::string &pipe_name, int output_fd) { - auto it = pipes.find(pipe_name); - if (it == pipes.end()) { - std::cerr << "[ERROR] Pipe not found: " << pipe_name << std::endl; - exit(EXIT_FAILURE); - } - - const FlowPipe &flow_pipe = it->second; - - // Handle if 'from' or 'to' is a file node - bool from_is_file = fileNodes.find(flow_pipe.from) != fileNodes.end(); - bool to_is_file = fileNodes.find(flow_pipe.to) != fileNodes.end(); - - if (from_is_file && to_is_file) { - std::cerr << "[ERROR] Both 'from' and 'to' cannot be file nodes in pipe: " << pipe_name << std::endl; - exit(EXIT_FAILURE); - } - - if (from_is_file) { - // 'from' is a file node; redirect file contents to 'to' action - auto file_it = fileNodes.find(flow_pipe.from); - const FileNode &fileNode = file_it->second; - - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } else if (pid == 0) { // Child process - // Open the file for reading - int fd = open(fileNode.filename.c_str(), O_RDONLY); - if (fd == -1) { - perror("[ERROR] open failed"); - exit(EXIT_FAILURE); - } - // Redirect file to stdin - if (dup2(fd, STDIN_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - close(fd); - exit(EXIT_FAILURE); - } - close(fd); - - // Redirect output if necessary - if (output_fd != STDOUT_FILENO) { - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); - } - - // Execute the 'to' action - execute_action(flow_pipe.to, STDOUT_FILENO); - _exit(EXIT_FAILURE); - } - - // Parent process waits for the child - int status; - waitpid(pid, &status, 0); - } else if (to_is_file) { - // 'to' is a file node; redirect output of 'from' action to file - auto file_it = fileNodes.find(flow_pipe.to); - const FileNode &fileNode = file_it->second; - - // Open the file for writing - int fd = open(fileNode.filename.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0644); - if (fd == -1) { - perror("[ERROR] open failed"); - exit(EXIT_FAILURE); - } - - // Execute 'from' action, redirecting its output to the file - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - close(fd); - exit(EXIT_FAILURE); - } else if (pid == 0) { // Child process - // Redirect stdout to file - if (dup2(fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - close(fd); - exit(EXIT_FAILURE); - } - close(fd); - - // Execute the 'from' action - execute_action(flow_pipe.from, STDOUT_FILENO); - _exit(EXIT_FAILURE); - } - - close(fd); - - // Parent process waits for the child - int status; - waitpid(pid, &status, 0); - } else { - // Regular pipe between two actions - int fd[2]; - if (pipe(fd) == -1) { - perror("[ERROR] pipe creation failed"); - exit(EXIT_FAILURE); - } - - pid_t pid_to = fork(); - if (pid_to == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } else if (pid_to == 0) { // Child process for 'to' - close(fd[1]); // Close write end - if (dup2(fd[0], STDIN_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(fd[0]); - - if (output_fd != STDOUT_FILENO) { - // Redirect output if necessary - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); - } - - execute_action(flow_pipe.to, STDOUT_FILENO); - _exit(EXIT_FAILURE); - } - - pid_t pid_from = fork(); - if (pid_from == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } else if (pid_from == 0) { // Child process for 'from' - close(fd[0]); // Close read end - if (dup2(fd[1], STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(fd[1]); - - execute_action(flow_pipe.from, STDOUT_FILENO); - _exit(EXIT_FAILURE); - } - - // Parent process closes unused pipe ends and waits for child processes - close(fd[0]); - close(fd[1]); - - int status; - waitpid(pid_from, &status, 0); - waitpid(pid_to, &status, 0); - } -} - -/** - * Function to execute a stderr capture. - */ -void execute_stderr_capture(const std::string &stderr_name, int output_fd) { - auto it = stderrCaptures.find(stderr_name); - if (it == stderrCaptures.end()) { - std::cerr << "[ERROR] Stderr capture not found: " << stderr_name << std::endl; - exit(EXIT_FAILURE); - } - - const StderrCapture &stderrCapture = it->second; - - // Execute the 'from' action, redirecting its stderr to stdout - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } - - if (pid == 0) { // Child process - // Redirect stderr to stdout - if (dup2(STDOUT_FILENO, STDERR_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - - if (output_fd != STDOUT_FILENO) { - // Redirect output if necessary - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); - } - - // Execute the 'from' action - execute_action(stderrCapture.from, STDOUT_FILENO); - _exit(EXIT_FAILURE); - } - - // Parent process waits for the child - int status; - waitpid(pid, &status, 0); -} - -/** - * Function to execute a file node. - */ -void execute_file_node(const std::string &file_node_name, int output_fd) { - auto it = fileNodes.find(file_node_name); - if (it == fileNodes.end()) { - std::cerr << "[ERROR] File node not found: " << file_node_name << std::endl; - exit(EXIT_FAILURE); - } - - const FileNode &fileNode = it->second; - - // For file nodes, we can output the file content if used directly - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } - - if (pid == 0) { // Child process - // Open the file for reading - int fd = open(fileNode.filename.c_str(), O_RDONLY); - if (fd == -1) { - perror("[ERROR] open failed"); - exit(EXIT_FAILURE); - } - // Redirect file to stdin - if (dup2(fd, STDIN_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - close(fd); - exit(EXIT_FAILURE); - } - close(fd); - - if (output_fd != STDOUT_FILENO) { - // Redirect output if necessary - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); - } - - // Execute 'cat' to output file contents - execlp("cat", "cat", (char *)NULL); - perror("[ERROR] execlp failed"); - exit(EXIT_FAILURE); - } - - // Parent process waits for the child - int status; - waitpid(pid, &status, 0); -} - -/** - * Parse the .flow file and populate nodes, pipes, concatenations, stderr captures, and file nodes. - */ -void parse_flow_file(const std::string& filename) { - std::ifstream flow_file(filename); - if (!flow_file.is_open()) { - std::cerr << "[ERROR] Could not open flow file " << filename << "\n"; - exit(1); - } - - std::string line; - while (std::getline(flow_file, line)) { - if (line.empty()) - continue; - - if (line.substr(0, 5) == "node=") { - // Parse a node - std::string node_name = line.substr(5); - std::string command_line; - if (!std::getline(flow_file, command_line) || command_line.substr(0, 8) != "command=") { - std::cerr << "[ERROR] Missing command for node: " << node_name << "\n"; - exit(EXIT_FAILURE); - } - std::string command = command_line.substr(8); - Node node; - node.name = node_name; - node.command = tokenize_command(command); - nodes[node_name] = node; - } else if (line.substr(0, 5) == "pipe=") { - // Parse a pipe - std::string pipe_name = line.substr(5); - std::string from_line, to_line; - if (!std::getline(flow_file, from_line) || !std::getline(flow_file, to_line)) { - std::cerr << "[ERROR] Missing 'from' or 'to' for pipe: " << pipe_name << "\n"; - exit(EXIT_FAILURE); - } - if (from_line.substr(0, 5) != "from=" || to_line.substr(0, 3) != "to=") { - std::cerr << "[ERROR] Invalid 'from' or 'to' format for pipe: " << pipe_name << "\n"; - exit(EXIT_FAILURE); - } - std::string from = from_line.substr(5); - std::string to = to_line.substr(3); - FlowPipe pipe; - pipe.from = from; - pipe.to = to; - pipes[pipe_name] = pipe; - } else if (line.substr(0, 12) == "concatenate=") { - // Parse a concatenation - std::string concat_name = line.substr(12); - std::string parts_line; - if (!std::getline(flow_file, parts_line) || parts_line.substr(0, 6) != "parts=") { - std::cerr << "[ERROR] Missing 'parts' for concatenation: " << concat_name << "\n"; - exit(EXIT_FAILURE); - } - int num_parts = std::stoi(parts_line.substr(6)); - Concatenation concat; - for (int i = 0; i < num_parts; ++i) { - std::string part_line; - if (!std::getline(flow_file, part_line)) { - std::cerr << "[ERROR] Missing 'part_" << i << "' for concatenation: " << concat_name << "\n"; - exit(EXIT_FAILURE); - } - std::string part_prefix = "part_" + std::to_string(i) + "="; - if (part_line.substr(0, part_prefix.length()) != part_prefix) { - std::cerr << "[ERROR] Invalid 'part_" << i << "' format for concatenation: " << concat_name << "\n"; - exit(EXIT_FAILURE); - } - std::string part_name = part_line.substr(part_prefix.length()); - concat.parts.push_back(part_name); - } - concatenations[concat_name] = concat; - } else if (line.substr(0, 6) == "stderr") { - // Parse a stderr capture - std::string stderr_name = line.substr(6); - if (!stderr_name.empty() && stderr_name[0] == '=') { - stderr_name = stderr_name.substr(1); - } - std::string from_line; - if (!std::getline(flow_file, from_line) || from_line.substr(0, 5) != "from=") { - std::cerr << "[ERROR] Missing 'from' for stderr: " << stderr_name << "\n"; - exit(EXIT_FAILURE); - } - std::string from = from_line.substr(5); - StderrCapture stderrCapture; - stderrCapture.name = stderr_name; - stderrCapture.from = from; - stderrCaptures[stderr_name] = stderrCapture; - } else if (line.substr(0, 5) == "file=") { - // Parse a file node - std::string file_name = line.substr(5); - std::string name_line; - if (!std::getline(flow_file, name_line) || name_line.substr(0, 5) != "name=") { - std::cerr << "[ERROR] Missing 'name' for file: " << file_name << "\n"; - exit(EXIT_FAILURE); - } - std::string filename = name_line.substr(5); - FileNode fileNode; - fileNode.name = file_name; - fileNode.filename = filename; - fileNodes[file_name] = fileNode; - } - // Ignore other lines or add more parsing as needed - } -} - -/** - * Main function. - */ -int main(int argc, char* argv[]) { - if (argc != 3) { - std::cerr << "Usage: ./flow " << std::endl; - return EXIT_FAILURE; - } - - std::string flowFile = argv[1]; - std::string action = argv[2]; - - // Parse the flow file - parse_flow_file(flowFile); - - // Execute the action - execute_action(action, STDOUT_FILENO); - - return EXIT_SUCCESS; -} diff --git a/src/mix3.cpp b/src/mix3.cpp deleted file mode 100644 index 15232e3..0000000 --- a/src/mix3.cpp +++ /dev/null @@ -1,583 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Structs for nodes, pipes, concatenations, stderr captures, and file nodes -struct Node { - std::string name; - std::vector command; -}; - -struct FlowPipe { - std::string from; - std::string to; -}; - -struct Concatenation { - std::vector parts; -}; - -struct StderrCapture { - std::string name; - std::string from; -}; - -struct FileNode { - std::string name; - std::string filename; -}; - -// Maps for storing nodes, pipes, concatenations, stderr captures, and file nodes -std::unordered_map nodes; -std::unordered_map pipes; -std::unordered_map concatenations; -std::unordered_map stderrCaptures; -std::unordered_map fileNodes; - -// Function Declarations -std::vector tokenize_command(const std::string &command_line); -std::vector prepare_args(const Node &node); -void execute_node(const Node &node); -void execute_single_node(const std::string &node_name, int output_fd = STDOUT_FILENO, bool suppress_error_messages = false); -void execute_concatenation(const std::string &concat_name, int output_fd = STDOUT_FILENO, bool suppress_error_messages = false); -void execute_action(const std::string &action_name, int output_fd = STDOUT_FILENO, bool suppress_error_messages = false); -void execute_pipe(const std::string &pipe_name, int output_fd = STDOUT_FILENO, bool suppress_error_messages = false); -void execute_stderr_capture(const std::string &stderr_name, int output_fd = STDOUT_FILENO, bool suppress_error_messages = false); -void execute_file_node(const std::string &file_node_name, int output_fd = STDOUT_FILENO, bool suppress_error_messages = false); -void parse_flow_file(const std::string& filename); -int main(int argc, char* argv[]); - -// Function Definitions - -/** - * Helper function to tokenize command strings, treating quoted strings as single tokens. - */ -std::vector tokenize_command(const std::string &command_line) { - std::vector tokens; - std::string token; - bool in_single_quote = false; - bool in_double_quote = false; - - for (size_t i = 0; i < command_line.length(); ++i) { - char c = command_line[i]; - - if (c == '\'' && !in_double_quote) { - in_single_quote = !in_single_quote; - continue; // Skip the quote character - } else if (c == '"' && !in_single_quote) { - in_double_quote = !in_double_quote; - continue; // Skip the quote character - } - - if (std::isspace(c) && !in_single_quote && !in_double_quote) { - if (!token.empty()) { - tokens.push_back(token); - token.clear(); - } - } else { - token += c; - } - } - - if (!token.empty()) { - tokens.push_back(token); - } - - return tokens; -} - -/** - * Function to prepare args for execvp. - */ -std::vector prepare_args(const Node &node) { - std::vector args; - for (const auto &arg : node.command) { - args.push_back(const_cast(arg.c_str())); - } - args.push_back(nullptr); // Null-terminated list of arguments - return args; -} - -/** - * Function to execute a node command using execvp. - */ -void execute_node(const Node &node) { - std::vector args = prepare_args(node); - execvp(args[0], args.data()); // Execute the command - perror("[ERROR] execvp failed"); // Only reached if execvp fails - _exit(EXIT_FAILURE); // Exit if execvp fails -} - -/** - * Function to execute a single node, with optional output redirection and error suppression. - */ -void execute_single_node(const std::string &node_name, int output_fd, bool suppress_error_messages) { - auto it = nodes.find(node_name); - if (it == nodes.end()) { - std::cerr << "[ERROR] Node not found: " << node_name << std::endl; - exit(EXIT_FAILURE); - } - - const Node &node = it->second; - - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } - - if (pid == 0) { // Child process - if (output_fd != STDOUT_FILENO) { - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); // Close after duplication - } - execute_node(node); // Execute the node - _exit(EXIT_FAILURE); // Should not reach here - } - - // Parent process waits for the child - int status; - waitpid(pid, &status, 0); - if (WIFEXITED(status)) { - if (WEXITSTATUS(status) != 0 && !suppress_error_messages) { - std::cerr << "[ERROR] Child process exited with error code: " << WEXITSTATUS(status) << std::endl; - } - } else if (WIFSIGNALED(status)) { - int sig = WTERMSIG(status); - if (sig != SIGPIPE && !suppress_error_messages) { - std::cerr << "[ERROR] Child process was terminated by signal: " << sig << std::endl; - } - } -} - -/** - * Function to execute a concatenation. - */ -void execute_concatenation(const std::string &concat_name, int output_fd, bool suppress_error_messages) { - auto it = concatenations.find(concat_name); - if (it == concatenations.end()) { - std::cerr << "[ERROR] Concatenation not found: " << concat_name << std::endl; - exit(EXIT_FAILURE); - } - - const Concatenation &concat = it->second; - - for (const auto &part_name : concat.parts) { - // Execute each part - execute_action(part_name, output_fd, suppress_error_messages); - } -} - -/** - * Helper function to execute any action (node, pipe, concatenation, stderr capture, or file node). - */ -void execute_action(const std::string &action_name, int output_fd, bool suppress_error_messages) { - if (nodes.find(action_name) != nodes.end()) { - execute_single_node(action_name, output_fd, suppress_error_messages); - } else if (pipes.find(action_name) != pipes.end()) { - execute_pipe(action_name, output_fd, suppress_error_messages); - } else if (concatenations.find(action_name) != concatenations.end()) { - execute_concatenation(action_name, output_fd, suppress_error_messages); - } else if (stderrCaptures.find(action_name) != stderrCaptures.end()) { - execute_stderr_capture(action_name, output_fd, suppress_error_messages); - } else if (fileNodes.find(action_name) != fileNodes.end()) { - execute_file_node(action_name, output_fd, suppress_error_messages); - } else { - std::cerr << "[ERROR] Unknown action: " << action_name << std::endl; - exit(EXIT_FAILURE); - } -} - -/** - * Function to execute a pipe. - */ -void execute_pipe(const std::string &pipe_name, int output_fd, bool suppress_error_messages) { - auto it = pipes.find(pipe_name); - if (it == pipes.end()) { - std::cerr << "[ERROR] Pipe not found: " << pipe_name << std::endl; - exit(EXIT_FAILURE); - } - - const FlowPipe &flow_pipe = it->second; - - // Handle if 'from' or 'to' is a file node - bool from_is_file = fileNodes.find(flow_pipe.from) != fileNodes.end(); - bool to_is_file = fileNodes.find(flow_pipe.to) != fileNodes.end(); - - if (from_is_file && to_is_file) { - std::cerr << "[ERROR] Both 'from' and 'to' cannot be file nodes in pipe: " << pipe_name << std::endl; - exit(EXIT_FAILURE); - } - - if (from_is_file) { - // 'from' is a file node; redirect file contents to 'to' action - auto file_it = fileNodes.find(flow_pipe.from); - const FileNode &fileNode = file_it->second; - - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } else if (pid == 0) { // Child process - // Open the file for reading - int fd = open(fileNode.filename.c_str(), O_RDONLY); - if (fd == -1) { - perror("[ERROR] open failed"); - exit(EXIT_FAILURE); - } - // Redirect file to stdin - if (dup2(fd, STDIN_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - close(fd); - exit(EXIT_FAILURE); - } - close(fd); - - // Redirect output if necessary - if (output_fd != STDOUT_FILENO) { - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); - } - - // Execute the 'to' action - execute_action(flow_pipe.to, STDOUT_FILENO, suppress_error_messages); - _exit(EXIT_FAILURE); - } - - // Parent process waits for the child - int status; - waitpid(pid, &status, 0); - } else if (to_is_file) { - // 'to' is a file node; redirect output of 'from' action to file - auto file_it = fileNodes.find(flow_pipe.to); - const FileNode &fileNode = file_it->second; - - // Open the file for writing - int fd = open(fileNode.filename.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0644); - if (fd == -1) { - perror("[ERROR] open failed"); - exit(EXIT_FAILURE); - } - - // Execute 'from' action, redirecting its output to the file - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - close(fd); - exit(EXIT_FAILURE); - } else if (pid == 0) { // Child process - // Redirect stdout to file - if (dup2(fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - close(fd); - exit(EXIT_FAILURE); - } - close(fd); - - // Execute the 'from' action - execute_action(flow_pipe.from, STDOUT_FILENO, suppress_error_messages); - _exit(EXIT_FAILURE); - } - - close(fd); - - // Parent process waits for the child - int status; - waitpid(pid, &status, 0); - } else { - // Regular pipe between two actions - int fd[2]; - if (pipe(fd) == -1) { - perror("[ERROR] pipe creation failed"); - exit(EXIT_FAILURE); - } - - pid_t pid_to = fork(); - if (pid_to == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } else if (pid_to == 0) { // Child process for 'to' - close(fd[1]); // Close write end - if (dup2(fd[0], STDIN_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(fd[0]); - - if (output_fd != STDOUT_FILENO) { - // Redirect output if necessary - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); - } - - execute_action(flow_pipe.to, STDOUT_FILENO, suppress_error_messages); - _exit(EXIT_FAILURE); - } - - pid_t pid_from = fork(); - if (pid_from == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } else if (pid_from == 0) { // Child process for 'from' - close(fd[0]); // Close read end - if (dup2(fd[1], STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(fd[1]); - - execute_action(flow_pipe.from, STDOUT_FILENO, suppress_error_messages); - _exit(EXIT_FAILURE); - } - - // Parent process closes unused pipe ends and waits for child processes - close(fd[0]); - close(fd[1]); - - int status; - waitpid(pid_from, &status, 0); - waitpid(pid_to, &status, 0); - } -} - -/** - * Function to execute a stderr capture. - */ -void execute_stderr_capture(const std::string &stderr_name, int output_fd, bool suppress_error_messages) { - auto it = stderrCaptures.find(stderr_name); - if (it == stderrCaptures.end()) { - std::cerr << "[ERROR] Stderr capture not found: " << stderr_name << std::endl; - exit(EXIT_FAILURE); - } - - const StderrCapture &stderrCapture = it->second; - - // Execute the 'from' action, redirecting its stderr to stdout - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } - - if (pid == 0) { // Child process - // Redirect stderr to stdout - if (dup2(STDOUT_FILENO, STDERR_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - - if (output_fd != STDOUT_FILENO) { - // Redirect output if necessary - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); - } - - // Execute the 'from' action with suppress_error_messages = true - execute_action(stderrCapture.from, STDOUT_FILENO, true); - _exit(EXIT_FAILURE); - } - - // Parent process waits for the child - int status; - waitpid(pid, &status, 0); -} - -/** - * Function to execute a file node. - */ -void execute_file_node(const std::string &file_node_name, int output_fd, bool suppress_error_messages) { - auto it = fileNodes.find(file_node_name); - if (it == fileNodes.end()) { - std::cerr << "[ERROR] File node not found: " << file_node_name << std::endl; - exit(EXIT_FAILURE); - } - - const FileNode &fileNode = it->second; - - // For file nodes, we can output the file content if used directly - pid_t pid = fork(); - if (pid == -1) { - perror("[ERROR] fork failed"); - exit(EXIT_FAILURE); - } - - if (pid == 0) { // Child process - // Open the file for reading - int fd = open(fileNode.filename.c_str(), O_RDONLY); - if (fd == -1) { - perror("[ERROR] open failed"); - exit(EXIT_FAILURE); - } - // Redirect file to stdin - if (dup2(fd, STDIN_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - close(fd); - exit(EXIT_FAILURE); - } - close(fd); - - if (output_fd != STDOUT_FILENO) { - // Redirect output if necessary - if (dup2(output_fd, STDOUT_FILENO) == -1) { - perror("[ERROR] dup2 failed"); - exit(EXIT_FAILURE); - } - close(output_fd); - } - - // Execute 'cat' to output file contents - execlp("cat", "cat", (char *)NULL); - perror("[ERROR] execlp failed"); - exit(EXIT_FAILURE); - } - - // Parent process waits for the child - int status; - waitpid(pid, &status, 0); -} - -/** - * Parse the .flow file and populate nodes, pipes, concatenations, stderr captures, and file nodes. - */ -void parse_flow_file(const std::string& filename) { - std::ifstream flow_file(filename); - if (!flow_file.is_open()) { - std::cerr << "[ERROR] Could not open flow file " << filename << "\n"; - exit(1); - } - - std::string line; - while (std::getline(flow_file, line)) { - if (line.empty()) - continue; - - if (line.substr(0, 5) == "node=") { - // Parse a node - std::string node_name = line.substr(5); - std::string command_line; - if (!std::getline(flow_file, command_line) || command_line.substr(0, 8) != "command=") { - std::cerr << "[ERROR] Missing command for node: " << node_name << "\n"; - exit(EXIT_FAILURE); - } - std::string command = command_line.substr(8); - Node node; - node.name = node_name; - node.command = tokenize_command(command); - nodes[node_name] = node; - } else if (line.substr(0, 5) == "pipe=") { - // Parse a pipe - std::string pipe_name = line.substr(5); - std::string from_line, to_line; - if (!std::getline(flow_file, from_line) || !std::getline(flow_file, to_line)) { - std::cerr << "[ERROR] Missing 'from' or 'to' for pipe: " << pipe_name << "\n"; - exit(EXIT_FAILURE); - } - if (from_line.substr(0, 5) != "from=" || to_line.substr(0, 3) != "to=") { - std::cerr << "[ERROR] Invalid 'from' or 'to' format for pipe: " << pipe_name << "\n"; - exit(EXIT_FAILURE); - } - std::string from = from_line.substr(5); - std::string to = to_line.substr(3); - FlowPipe pipe; - pipe.from = from; - pipe.to = to; - pipes[pipe_name] = pipe; - } else if (line.substr(0, 12) == "concatenate=") { - // Parse a concatenation - std::string concat_name = line.substr(12); - std::string parts_line; - if (!std::getline(flow_file, parts_line) || parts_line.substr(0, 6) != "parts=") { - std::cerr << "[ERROR] Missing 'parts' for concatenation: " << concat_name << "\n"; - exit(EXIT_FAILURE); - } - int num_parts = std::stoi(parts_line.substr(6)); - Concatenation concat; - for (int i = 0; i < num_parts; ++i) { - std::string part_line; - if (!std::getline(flow_file, part_line)) { - std::cerr << "[ERROR] Missing 'part_" << i << "' for concatenation: " << concat_name << "\n"; - exit(EXIT_FAILURE); - } - std::string part_prefix = "part_" + std::to_string(i) + "="; - if (part_line.substr(0, part_prefix.length()) != part_prefix) { - std::cerr << "[ERROR] Invalid 'part_" << i << "' format for concatenation: " << concat_name << "\n"; - exit(EXIT_FAILURE); - } - std::string part_name = part_line.substr(part_prefix.length()); - concat.parts.push_back(part_name); - } - concatenations[concat_name] = concat; - } else if (line.substr(0, 6) == "stderr") { - // Parse a stderr capture - std::string stderr_name = line.substr(6); - if (!stderr_name.empty() && stderr_name[0] == '=') { - stderr_name = stderr_name.substr(1); - } - std::string from_line; - if (!std::getline(flow_file, from_line) || from_line.substr(0, 5) != "from=") { - std::cerr << "[ERROR] Missing 'from' for stderr: " << stderr_name << "\n"; - exit(EXIT_FAILURE); - } - std::string from = from_line.substr(5); - StderrCapture stderrCapture; - stderrCapture.name = stderr_name; - stderrCapture.from = from; - stderrCaptures[stderr_name] = stderrCapture; - } else if (line.substr(0, 5) == "file=") { - // Parse a file node - std::string file_name = line.substr(5); - std::string name_line; - if (!std::getline(flow_file, name_line) || name_line.substr(0, 5) != "name=") { - std::cerr << "[ERROR] Missing 'name' for file: " << file_name << "\n"; - exit(EXIT_FAILURE); - } - std::string filename = name_line.substr(5); - FileNode fileNode; - fileNode.name = file_name; - fileNode.filename = filename; - fileNodes[file_name] = fileNode; - } - // Ignore other lines or add more parsing as needed - } -} - -/** - * Main function. - */ -int main(int argc, char* argv[]) { - if (argc != 3) { - std::cerr << "Usage: ./flow " << std::endl; - return EXIT_FAILURE; - } - - std::string flowFile = argv[1]; - std::string action = argv[2]; - - // Parse the flow file - parse_flow_file(flowFile); - - // Execute the action - execute_action(action, STDOUT_FILENO); - - return EXIT_SUCCESS; -} \ No newline at end of file diff --git a/src/parse.cpp b/src/parse.cpp deleted file mode 100644 index 6012e62..0000000 --- a/src/parse.cpp +++ /dev/null @@ -1,172 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define MAX_LEN 1024 - -// Struct for nodes, pipes, and concatenations -struct Node { - std::string name; - std::vector command; -}; - -struct FlowPipe { - std::string from; - std::string to; -}; - -struct Concatenation { - std::string name; - std::vector parts; -}; - -// Maps for storing nodes, pipes, and concatenations -std::map nodes; -std::map pipes; -std::map concatenations; - -// Helper function to tokenize command strings -std::vector tokenize_command(const std::string &command_line) { - std::vector tokens; - std::istringstream iss(command_line); - std::string token; - while (iss >> token) { - tokens.push_back(token); - } - return tokens; -} - -// Function to parse and store a node -// Function to parse and store a node -void parse_node(const std::string &line, std::ifstream &flow_file) { - std::string name, command_line; - - // Extract node name - std::string prefix = "node="; - if (line.substr(0, prefix.length()) == prefix) { - name = line.substr(prefix.length()); - } else { - std::cerr << "Error: Invalid node format: " << line << "\n"; - return; - } - - // Read the next line for the command - std::getline(flow_file, command_line); - - // Strip out 'command=' from the command line - std::string command_prefix = "command="; - if (command_line.substr(0, command_prefix.length()) == command_prefix) { - command_line = command_line.substr(command_prefix.length()); - } - - // Tokenize and store node command - Node node; - node.name = name; - node.command = tokenize_command(command_line); - - nodes[name] = node; - std::cout << "Parsed node: " << name << " with command: "; - for (const auto &cmd : node.command) { - std::cout << cmd << " "; - } - std::cout << "\n"; -} - -// Function to parse and store a pipe -void parse_pipe(const std::string &line, std::ifstream &flow_file) { - std::string pipe_name, from, to; - - // Extract pipe name - std::string prefix = "pipe="; - if (line.substr(0, prefix.length()) == prefix) { - pipe_name = line.substr(prefix.length()); - } else { - std::cerr << "Error: Invalid pipe format: " << line << "\n"; - return; - } - - // Read 'from' and 'to' lines - std::getline(flow_file, from); - from = from.substr(from.find('=') + 1); // Extract 'from' - - std::getline(flow_file, to); - to = to.substr(to.find('=') + 1); // Extract 'to' - - FlowPipe pipe; - pipe.from = from; - pipe.to = to; - - pipes[pipe_name] = pipe; - std::cout << "Parsed pipe: " << pipe_name << " from " << from << " to " << to << "\n"; -} - -// Function to parse and store a concatenation -void parse_concatenation(const std::string &line, std::ifstream &flow_file) { - std::string concat_name, parts_line; - int part_count; - - // Extract concatenation name - std::string prefix = "concatenate="; - if (line.substr(0, prefix.length()) == prefix) { - concat_name = line.substr(prefix.length()); - } else { - std::cerr << "Error: Invalid concatenation format: " << line << "\n"; - return; - } - - std::getline(flow_file, parts_line); - sscanf(parts_line.c_str(), "parts=%d", &part_count); - - Concatenation concat; - concat.name = concat_name; - - // Parse individual parts - for (int i = 0; i < part_count; ++i) { - std::string part; - std::getline(flow_file, part); - part = part.substr(part.find('=') + 1); // Extract part name - concat.parts.push_back(part); - std::cout << "Added part " << concat.parts[i] << " to concatenation " << concat_name << "\n"; - } - - concatenations[concat_name] = concat; - std::cout << "Parsed concatenation: " << concat_name << " with " << part_count << " parts\n"; -} - -// Function to parse the flow file -void parse_flow_file(std::ifstream &flow_file) { - std::string line; - - // Parse the flow file line by line - while (std::getline(flow_file, line)) { - std::cout << "Read line: " << line << "\n"; - if (line.find("node=") == 0) { - parse_node(line, flow_file); - } else if (line.find("pipe=") == 0) { - parse_pipe(line, flow_file); - } else if (line.find("concatenate=") == 0) { - parse_concatenation(line, flow_file); - } - } -} - -int main(int argc, char *argv[]) { - if (argc < 2) { - std::cerr << "Usage: " << argv[0] << " \n"; - exit(1); - } - - std::ifstream flow_file(argv[1]); - if (!flow_file.is_open()) { - std::cerr << "Error: Could not open flow file " << argv[1] << "\n"; - exit(1); - } - - std::cout << "Debug: Opening flow file " << argv[1] << "\n"; - parse_flow_file(flow_file); - - return 0; -}