summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-06-27 14:46:26 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-06-27 14:47:00 +0200
commit0be66c2f14812f192e139f6d24bddc4f574c059d (patch)
treeb2f70743da944d84add7c6bd99f63562a8c0e33a /examples
parent29a31b73183f97b792d0585dca9a305b083f93d8 (diff)
feat: SNU C++ Library (v1.0.0)
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/cgi/cgi.cc6
-rw-r--r--examples/equiv/Makefile181
-rw-r--r--examples/equiv/equiv.cc8
-rw-r--r--examples/must_pass/must_pass.cc4
4 files changed, 9 insertions, 190 deletions
diff --git a/examples/cgi/cgi.cc b/examples/cgi/cgi.cc
index 6b45841..f850c9f 100644
--- a/examples/cgi/cgi.cc
+++ b/examples/cgi/cgi.cc
@@ -6,7 +6,7 @@
#include <fstream>
#include <sstream>
-#include <astdx/cgi.hpp>
+#include <lib/cgi.hpp>
#include <string>
#include <filesystem>
@@ -63,7 +63,7 @@ const std::string g_not_found = R"(
<tr><td colspan="3"><hr></td></tr>
</table>
- <address>astdx's Common Gateway Server.</address>
+ <address>snu's Common Gateway Server.</address>
</body>
</html>
)";
@@ -74,7 +74,7 @@ int main(int argc, char** argv)
{
// ... let's assume we serve data.
- astdx::web::cgi_writer writer;
+ snu::web::cgi_writer writer;
std::stringstream ss_file;
std::ifstream fp("index.html");
diff --git a/examples/equiv/Makefile b/examples/equiv/Makefile
deleted file mode 100644
index 9243de2..0000000
--- a/examples/equiv/Makefile
+++ /dev/null
@@ -1,181 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.28
-
-# 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/bin/cmake
-
-# The command to remove a file.
-RM = /usr/bin/cmake -E rm -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /home/amlal/amlal-el-mahrouss/astdx/examples/equiv
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/amlal/amlal-el-mahrouss/astdx/examples/equiv
-
-#=============================================================================
-# Targets provided globally by CMake.
-
-# Special rule for the target edit_cache
-edit_cache:
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "No interactive CMake dialog available..."
- /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
-.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/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 /home/amlal/amlal-el-mahrouss/astdx/examples/equiv/CMakeFiles /home/amlal/amlal-el-mahrouss/astdx/examples/equiv//CMakeFiles/progress.marks
- $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all
- $(CMAKE_COMMAND) -E cmake_progress_start /home/amlal/amlal-el-mahrouss/astdx/examples/equiv/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 Equiv
-
-# Build rule for target.
-Equiv: cmake_check_build_system
- $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 Equiv
-.PHONY : Equiv
-
-# fast build rule for target.
-Equiv/fast:
- $(MAKE) $(MAKESILENT) -f CMakeFiles/Equiv.dir/build.make CMakeFiles/Equiv.dir/build
-.PHONY : Equiv/fast
-
-equiv.o: equiv.cc.o
-.PHONY : equiv.o
-
-# target to build an object file
-equiv.cc.o:
- $(MAKE) $(MAKESILENT) -f CMakeFiles/Equiv.dir/build.make CMakeFiles/Equiv.dir/equiv.cc.o
-.PHONY : equiv.cc.o
-
-equiv.i: equiv.cc.i
-.PHONY : equiv.i
-
-# target to preprocess a source file
-equiv.cc.i:
- $(MAKE) $(MAKESILENT) -f CMakeFiles/Equiv.dir/build.make CMakeFiles/Equiv.dir/equiv.cc.i
-.PHONY : equiv.cc.i
-
-equiv.s: equiv.cc.s
-.PHONY : equiv.s
-
-# target to generate assembly for a file
-equiv.cc.s:
- $(MAKE) $(MAKESILENT) -f CMakeFiles/Equiv.dir/build.make CMakeFiles/Equiv.dir/equiv.cc.s
-.PHONY : equiv.cc.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 "... Equiv"
- @echo "... equiv.o"
- @echo "... equiv.i"
- @echo "... equiv.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/examples/equiv/equiv.cc b/examples/equiv/equiv.cc
index 01674c6..482266a 100644
--- a/examples/equiv/equiv.cc
+++ b/examples/equiv/equiv.cc
@@ -4,16 +4,16 @@
licensed under GPL-2 license
*/
-#include <astdx/equiv.hpp>
+#include <lib/equiv.hpp>
#include <iostream>
/* finally test it */
int main(int argc, char** argv)
{
std::cout << std::boolalpha;
- std::cout << astdx::is_same<bool, int>::value << std::endl;
- std::cout << astdx::is_same<bool, bool>::value << std::endl;
- std::cout << astdx::is_same<int, int>::value << std::endl;
+ std::cout << snu::is_same<bool, int>::value << std::endl;
+ std::cout << snu::is_same<bool, bool>::value << std::endl;
+ std::cout << snu::is_same<int, int>::value << std::endl;
return 0;
}
diff --git a/examples/must_pass/must_pass.cc b/examples/must_pass/must_pass.cc
index ba927f0..eac3130 100644
--- a/examples/must_pass/must_pass.cc
+++ b/examples/must_pass/must_pass.cc
@@ -4,7 +4,7 @@
licensed under GPL-2 license
*/
-#include <astdx/opt.hpp>
+#include <lib/opt.hpp>
#include <string>
static const char do_hash(const std::string& in)
@@ -24,7 +24,7 @@ static auto do_some(const std::string recv_data, const std::string check_data)
const int hash_to_check = do_hash(check_data); /* here we assume this should match opt_hash */
const int opt_hash = do_hash(recv_data); /* we assume that the hash is correct */
- auto opt = astdx::opt(astdx::eval_eq(hash_to_check, opt_hash)); /* do the compute */
+ auto opt = snu::opt(snu::eval_eq(hash_to_check, opt_hash)); /* do the compute */
return opt;
}