Compare commits
	
		
			9 Commits
		
	
	
		
			8d7a055b08
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						02f87e1604
	
				 | 
					
					
						|||
| 
						
						
							
						
						042bd29094
	
				 | 
					
					
						|||
| 
						
						
							
						
						d0af81c08d
	
				 | 
					
					
						|||
| 
						
						
							
						
						cabd2bad9b
	
				 | 
					
					
						|||
| 
						
						
							
						
						f0583e3d1a
	
				 | 
					
					
						|||
| 
						
						
							
						
						c420e3ce86
	
				 | 
					
					
						|||
| 
						
						
							
						
						11567dc05c
	
				 | 
					
					
						|||
| 
						
						
							
						
						462280fd2f
	
				 | 
					
					
						|||
| 
						
						
							
						
						c8eb6433cb
	
				 | 
					
					
						
							
								
								
									
										32
									
								
								.clang-format
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								.clang-format
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
				
			|||||||
 | 
					# clang-format is fairly limited, and these rules are approximate:
 | 
				
			||||||
 | 
					#  - array initializers can get terribly mangled with clang-format 12.0,
 | 
				
			||||||
 | 
					#  - sometimes it still aligns with space characters,
 | 
				
			||||||
 | 
					#  - struct name NL { NL ... NL } NL name; is unachievable.
 | 
				
			||||||
 | 
					BasedOnStyle: GNU
 | 
				
			||||||
 | 
					ColumnLimit: 80
 | 
				
			||||||
 | 
					IndentWidth: 4
 | 
				
			||||||
 | 
					TabWidth: 4
 | 
				
			||||||
 | 
					UseTab: ForContinuationAndIndentation
 | 
				
			||||||
 | 
					BreakBeforeBraces: Allman
 | 
				
			||||||
 | 
					SpaceAfterCStyleCast: true
 | 
				
			||||||
 | 
					AlignAfterOpenBracket: DontAlign
 | 
				
			||||||
 | 
					AlignOperands: DontAlign
 | 
				
			||||||
 | 
					AlignConsecutiveMacros: Consecutive
 | 
				
			||||||
 | 
					AllowAllArgumentsOnNextLine: false
 | 
				
			||||||
 | 
					AllowAllParametersOfDeclarationOnNextLine: false
 | 
				
			||||||
 | 
					IndentGotoLabels: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# IncludeCategories has some potential, but it may also break the build.
 | 
				
			||||||
 | 
					# Note that the documentation says the value should be "Never".
 | 
				
			||||||
 | 
					SortIncludes: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This is a compromise, it generally works out aesthetically better.
 | 
				
			||||||
 | 
					BinPackArguments: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Unfortunately, this can't be told to align to column 40 or so.
 | 
				
			||||||
 | 
					SpacesBeforeTrailingComments: 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# liberty-specific macro body wrappers.
 | 
				
			||||||
 | 
					MacroBlockBegin: "BLOCK_START"
 | 
				
			||||||
 | 
					MacroBlockEnd: "BLOCK_END"
 | 
				
			||||||
 | 
					ForEachMacros: ["LIST_FOR_EACH"]
 | 
				
			||||||
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -7,3 +7,5 @@
 | 
				
			|||||||
/ponymap.files
 | 
					/ponymap.files
 | 
				
			||||||
/ponymap.creator*
 | 
					/ponymap.creator*
 | 
				
			||||||
/ponymap.includes
 | 
					/ponymap.includes
 | 
				
			||||||
 | 
					/ponymap.cflags
 | 
				
			||||||
 | 
					/ponymap.cxxflags
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							@@ -1,6 +1,6 @@
 | 
				
			|||||||
[submodule "http-parser"]
 | 
					[submodule "http-parser"]
 | 
				
			||||||
	path = http-parser
 | 
						path = http-parser
 | 
				
			||||||
	url = git://github.com/joyent/http-parser.git
 | 
						url = https://github.com/nodejs/http-parser.git
 | 
				
			||||||
[submodule "liberty"]
 | 
					[submodule "liberty"]
 | 
				
			||||||
	path = liberty
 | 
						path = liberty
 | 
				
			||||||
	url = https://git.janouch.name/p/liberty.git
 | 
						url = https://git.janouch.name/p/liberty.git
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
cmake_minimum_required (VERSION 3.0)
 | 
					cmake_minimum_required (VERSION 3.0...3.27)
 | 
				
			||||||
project (ponymap VERSION 0.1.0 LANGUAGES C)
 | 
					project (ponymap VERSION 0.1.0 LANGUAGES C)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Moar warnings
 | 
					# Moar warnings
 | 
				
			||||||
@@ -13,10 +13,10 @@ set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/liberty/cmake)
 | 
				
			|||||||
include (AddThreads)
 | 
					include (AddThreads)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
find_package (Curses)
 | 
					find_package (Curses)
 | 
				
			||||||
 | 
					find_package (Ncursesw)
 | 
				
			||||||
find_package (PkgConfig REQUIRED)
 | 
					find_package (PkgConfig REQUIRED)
 | 
				
			||||||
pkg_check_modules (jansson REQUIRED jansson)
 | 
					pkg_check_modules (jansson REQUIRED jansson)
 | 
				
			||||||
pkg_check_modules (libssl REQUIRED libssl libcrypto)
 | 
					pkg_check_modules (libssl REQUIRED libssl libcrypto)
 | 
				
			||||||
pkg_check_modules (ncursesw ncursesw)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
 | 
					if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
 | 
				
			||||||
	# Need this in FreeBSD and OpenBSD respectively;
 | 
						# Need this in FreeBSD and OpenBSD respectively;
 | 
				
			||||||
@@ -24,10 +24,10 @@ if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
 | 
				
			|||||||
	add_definitions (-D__BSD_VISIBLE=1 -D_BSD_SOURCE=1)
 | 
						add_definitions (-D__BSD_VISIBLE=1 -D_BSD_SOURCE=1)
 | 
				
			||||||
endif ()
 | 
					endif ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (ncursesw_FOUND)
 | 
					if (Ncursesw_FOUND)
 | 
				
			||||||
	set (project_libraries ${ncursesw_LIBRARIES})
 | 
						set (project_libraries ${Ncursesw_LIBRARIES})
 | 
				
			||||||
	include_directories (${ncursesw_INCLUDE_DIRS})
 | 
						include_directories (${Ncursesw_INCLUDE_DIRS})
 | 
				
			||||||
	link_directories (${ncursesw_LIBRARY_DIRS})
 | 
						link_directories (${Ncursesw_LIBRARY_DIRS})
 | 
				
			||||||
elseif (CURSES_FOUND)
 | 
					elseif (CURSES_FOUND)
 | 
				
			||||||
	set (project_libraries ${CURSES_LIBRARY})
 | 
						set (project_libraries ${CURSES_LIBRARY})
 | 
				
			||||||
	include_directories (${CURSES_INCLUDE_DIR})
 | 
						include_directories (${CURSES_INCLUDE_DIR})
 | 
				
			||||||
@@ -59,7 +59,7 @@ link_directories (${libssl_LIBRARY_DIRS} ${jansson_LIBRARY_DIRS})
 | 
				
			|||||||
foreach (extra iconv dl rt)
 | 
					foreach (extra iconv dl rt)
 | 
				
			||||||
	find_library (extra_lib_${extra} ${extra})
 | 
						find_library (extra_lib_${extra} ${extra})
 | 
				
			||||||
	if (extra_lib_${extra})
 | 
						if (extra_lib_${extra})
 | 
				
			||||||
		list (APPEND project_libraries ${extra})
 | 
							list (APPEND project_libraries ${extra_lib_${extra}})
 | 
				
			||||||
	endif ()
 | 
						endif ()
 | 
				
			||||||
endforeach ()
 | 
					endforeach ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -70,6 +70,7 @@ set (project_headers ${PROJECT_BINARY_DIR}/config.h)
 | 
				
			|||||||
# Generate a configuration file
 | 
					# Generate a configuration file
 | 
				
			||||||
include (GNUInstallDirs)
 | 
					include (GNUInstallDirs)
 | 
				
			||||||
set (plugin_dir ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME})
 | 
					set (plugin_dir ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME})
 | 
				
			||||||
 | 
					set (full_plugin_dir ${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME})
 | 
				
			||||||
configure_file (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h)
 | 
					configure_file (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h)
 | 
				
			||||||
include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
 | 
					include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,8 +17,10 @@ the maximum number of concurrent connections.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Packages
 | 
					Packages
 | 
				
			||||||
--------
 | 
					--------
 | 
				
			||||||
Regular releases are sporadic.  git master should be stable enough.  You can get
 | 
					Regular releases are sporadic.  git master should be stable enough.
 | 
				
			||||||
a package with the latest development version from Archlinux's AUR.
 | 
					You can get a package with the latest development version using Arch Linux's
 | 
				
			||||||
 | 
					https://aur.archlinux.org/packages/ponymap-git[AUR],
 | 
				
			||||||
 | 
					or as a https://git.janouch.name/p/nixexprs[Nix derivation].
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Building and Usage
 | 
					Building and Usage
 | 
				
			||||||
------------------
 | 
					------------------
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,6 @@
 | 
				
			|||||||
#define PROGRAM_VERSION "${PROJECT_VERSION}"
 | 
					#define PROGRAM_VERSION "${PROJECT_VERSION}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#cmakedefine WITH_LUA
 | 
					#cmakedefine WITH_LUA
 | 
				
			||||||
#define PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/${plugin_dir}"
 | 
					#define PLUGIN_DIR "${full_plugin_dir}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif  // ! CONFIG_H
 | 
					#endif  // ! CONFIG_H
 | 
				
			||||||
 
 | 
				
			|||||||
 Submodule http-parser updated: 0b43367131...ec8b5ee63f
									
								
							
							
								
								
									
										2
									
								
								liberty
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								liberty
									
									
									
									
									
								
							 Submodule liberty updated: d71c47f8ce...49d7cb12bb
									
								
							@@ -840,6 +840,7 @@ load_one_plugin (struct app_context *ctx, const char *name, const char *path)
 | 
				
			|||||||
	void *table = dlopen (path, RTLD_LAZY | RTLD_LOCAL);
 | 
						void *table = dlopen (path, RTLD_LAZY | RTLD_LOCAL);
 | 
				
			||||||
	if (!table)
 | 
						if (!table)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
							print_debug ("%s", path);
 | 
				
			||||||
		print_error ("could not load `%s': %s", name, dlerror ());
 | 
							print_error ("could not load `%s': %s", name, dlerror ());
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -874,6 +875,7 @@ load_plugins (struct app_context *ctx)
 | 
				
			|||||||
	DIR *dir = opendir (plugin_dir);
 | 
						DIR *dir = opendir (plugin_dir);
 | 
				
			||||||
	if (!dir)
 | 
						if (!dir)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
							print_debug ("%s", plugin_dir);
 | 
				
			||||||
		print_fatal ("%s: %s",
 | 
							print_fatal ("%s: %s",
 | 
				
			||||||
			"cannot open plugin directory", strerror (errno));
 | 
								"cannot open plugin directory", strerror (errno));
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user