From efee6f689e6789eaa0a8e2e16e03f3538fc5c4a7 Mon Sep 17 00:00:00 2001 From: Ariel Abreu Date: Thu, 22 Apr 2021 09:18:09 -0400 Subject: [PATCH] Add license headers everywhere and fix small issues --- include/os/transaction_private.h | 19 ++++ include/xpc/private.h | 44 ++++----- include/xpc/private/bundle.h | 27 ++++++ include/xpc/private/date.h | 19 ++++ include/xpc/private/endpoint.h | 19 ++++ include/xpc/private/mach_recv.h | 27 ++++++ include/xpc/private/mach_send.h | 27 ++++++ include/xpc/private/pipe.h | 23 +++++ include/xpc/private/plist.h | 19 ++++ internal-include/xpc/generic_array.h | 19 ++++ internal-include/xpc/internal.h | 42 ++++---- internal-include/xpc/internal_base.h | 19 ++++ internal-include/xpc/objects/activity.h | 19 ++++ internal-include/xpc/objects/array.h | 19 ++++ internal-include/xpc/objects/base.h | 19 ++++ internal-include/xpc/objects/bool.h | 19 ++++ internal-include/xpc/objects/bundle.h | 21 ++++ internal-include/xpc/objects/connection.h | 19 ++++ internal-include/xpc/objects/data.h | 19 ++++ internal-include/xpc/objects/date.h | 19 ++++ internal-include/xpc/objects/deserializer.h | 19 ++++ internal-include/xpc/objects/dictionary.h | 19 ++++ internal-include/xpc/objects/double.h | 19 ++++ internal-include/xpc/objects/endpoint.h | 19 ++++ internal-include/xpc/objects/error.h | 19 ++++ internal-include/xpc/objects/fd.h | 19 ++++ internal-include/xpc/objects/file_transfer.h | 19 ++++ internal-include/xpc/objects/int64.h | 19 ++++ internal-include/xpc/objects/mach_recv.h | 21 ++++ internal-include/xpc/objects/mach_send.h | 21 ++++ internal-include/xpc/objects/null.h | 19 ++++ internal-include/xpc/objects/pipe.h | 19 ++++ .../objects/plist_binary_v0_deserializer.h | 19 ++++ .../xpc/objects/plist_xml_element.h | 19 ++++ internal-include/xpc/objects/pointer.h | 19 ++++ internal-include/xpc/objects/serializer.h | 19 ++++ internal-include/xpc/objects/service.h | 19 ++++ .../xpc/objects/service_instance.h | 19 ++++ internal-include/xpc/objects/shmem.h | 19 ++++ internal-include/xpc/objects/string.h | 37 +++++-- internal-include/xpc/objects/uint64.h | 19 ++++ internal-include/xpc/objects/uuid.h | 19 ++++ internal-include/xpc/plist.h | 19 ++++ internal-include/xpc/prefix.h | 19 ++++ internal-include/xpc/util.h | 25 ++++- scripts/bin2hdr.py | 19 ++++ src/activity.m | 19 ++++ src/array.m | 19 ++++ src/base.m | 26 ++++- src/bool.m | 19 ++++ src/bundle.m | 51 +++++++--- src/coalition.m | 19 ++++ src/connection.m | 19 ++++ src/data.m | 19 ++++ src/date.m | 19 ++++ src/dictionary.m | 19 ++++ src/double.m | 19 ++++ src/endpoint.m | 19 ++++ src/error.m | 21 +++- src/event.m | 19 ++++ src/fd.m | 19 ++++ src/file_transfer.m | 19 ++++ src/init.c | 19 ++++ src/int64.m | 19 ++++ src/launchd.m | 19 ++++ src/mach_recv.m | 19 ++++ src/mach_send.m | 19 ++++ src/misc.m | 19 ++++ src/null.m | 19 ++++ src/pipe.m | 19 ++++ src/plist.m | 35 +++++-- src/pointer.m | 19 ++++ src/reboot3.c | 19 ++++ src/runtime.m | 23 ++++- src/service.m | 19 ++++ src/service_instance.m | 19 ++++ src/shmem.m | 19 ++++ src/string.m | 97 +++++++++++-------- src/transaction.m | 19 ++++ src/type.m | 19 ++++ src/uint64.m | 19 ++++ src/util.m | 19 ++++ src/uuid.m | 19 ++++ test/array.m | 19 ++++ test/base.m | 19 ++++ test/bool.c | 19 ++++ test/bundle.c | 19 ++++ test/bundled-service/service.c | 19 ++++ test/ctest-plus.h | 19 ++++ test/data.c | 19 ++++ test/dictionary.m | 19 ++++ test/launchd-service/client.c | 19 ++++ test/launchd-service/client_common.h | 19 ++++ test/launchd-service/pipe_client.c | 19 ++++ test/launchd-service/server.c | 19 ++++ test/launchd-service/server_common.h | 19 ++++ test/launchd-service/service.h | 19 ++++ test/main.c | 19 ++++ test/plist.c | 19 ++++ test/string.c | 19 ++++ test/test-util.h | 19 ++++ test/type.c | 19 ++++ 102 files changed, 2054 insertions(+), 129 deletions(-) diff --git a/include/os/transaction_private.h b/include/os/transaction_private.h index a5de6d0..840cd43 100644 --- a/include/os/transaction_private.h +++ b/include/os/transaction_private.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _OS_TRANSACTION_PRIVATE_H_ #define _OS_TRANSACTION_PRIVATE_H_ diff --git a/include/xpc/private.h b/include/xpc/private.h index 7b22fd2..d11047b 100644 --- a/include/xpc/private.h +++ b/include/xpc/private.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef XPC_PRIVATE_H_ #define XPC_PRIVATE_H_ @@ -14,31 +33,12 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - - -XPC_EXPORT -XPC_TYPE(_xpc_type_mach_send); -#define XPC_TYPE_MACH_SEND (&_xpc_type_mach_send) - -XPC_EXPORT -XPC_TYPE(_xpc_type_mach_recv); -#define XPC_TYPE_MACH_RECV (&_xpc_type_mach_recv) +__BEGIN_DECLS XPC_EXPORT XPC_TYPE(_xpc_type_serializer); #define XPC_TYPE_SERIALIZER (&_xpc_type_serializer) -XPC_EXPORT -XPC_TYPE(_xpc_type_pipe); -#define XPC_TYPE_PIPE (&_xpc_type_pipe) - -XPC_EXPORT -XPC_TYPE(_xpc_type_bundle); -#define XPC_TYPE_BUNDLE (&_xpc_type_bundle) - XPC_EXPORT XPC_TYPE(_xpc_type_service); #define XPC_TYPE_SERVICE (&_xpc_type_service) @@ -137,9 +137,7 @@ const char* xpc_type_get_name(xpc_type_t xtype); xpc_connection_t xpc_connection_create_listener(const char* name, dispatch_queue_t queue); -#ifdef __cplusplus -} -#endif +__END_DECLS #endif diff --git a/include/xpc/private/bundle.h b/include/xpc/private/bundle.h index 1d5b7cc..fa004d9 100644 --- a/include/xpc/private/bundle.h +++ b/include/xpc/private/bundle.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_PRIVATE_BUNDLE_H_ #define _XPC_PRIVATE_BUNDLE_H_ @@ -5,6 +24,14 @@ __BEGIN_DECLS +XPC_EXPORT +XPC_TYPE(_xpc_type_bundle); +#define XPC_TYPE_BUNDLE (&_xpc_type_bundle) + +XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH; +XPC_DECL(xpc_bundle); +XPC_IGNORE_DUPLICATE_PROTOCOL_POP; + OS_ENUM(xpc_bundle_error, int, xpc_bundle_error_success, xpc_bundle_error_failed_to_read_plist = -1, diff --git a/include/xpc/private/date.h b/include/xpc/private/date.h index e667efb..740a77e 100644 --- a/include/xpc/private/date.h +++ b/include/xpc/private/date.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_PRIVATE_DATE_H_ #define _XPC_PRIVATE_DATE_H_ diff --git a/include/xpc/private/endpoint.h b/include/xpc/private/endpoint.h index 7df2a80..64adc83 100644 --- a/include/xpc/private/endpoint.h +++ b/include/xpc/private/endpoint.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_PRIVATE_ENDPOINT_H_ #define _XPC_PRIVATE_ENDPOINT_H_ diff --git a/include/xpc/private/mach_recv.h b/include/xpc/private/mach_recv.h index 775d064..924fa15 100644 --- a/include/xpc/private/mach_recv.h +++ b/include/xpc/private/mach_recv.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_PRIVATE_MACH_RECV_H_ #define _XPC_PRIVATE_MACH_RECV_H_ @@ -6,6 +25,14 @@ __BEGIN_DECLS +XPC_EXPORT +XPC_TYPE(_xpc_type_mach_recv); +#define XPC_TYPE_MACH_RECV (&_xpc_type_mach_recv) + +XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH; +XPC_DECL(xpc_mach_recv); +XPC_IGNORE_DUPLICATE_PROTOCOL_POP; + xpc_object_t xpc_mach_recv_create(mach_port_t recv); mach_port_t xpc_mach_recv_extract_right(xpc_object_t xrecv); diff --git a/include/xpc/private/mach_send.h b/include/xpc/private/mach_send.h index 1e8b5e5..a5527bb 100644 --- a/include/xpc/private/mach_send.h +++ b/include/xpc/private/mach_send.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_PRIVATE_MACH_SEND_H_ #define _XPC_PRIVATE_MACH_SEND_H_ @@ -6,6 +25,14 @@ __BEGIN_DECLS +XPC_EXPORT +XPC_TYPE(_xpc_type_mach_send); +#define XPC_TYPE_MACH_SEND (&_xpc_type_mach_send) + +XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH; +XPC_DECL(xpc_mach_send); +XPC_IGNORE_DUPLICATE_PROTOCOL_POP; + xpc_object_t xpc_mach_send_create(mach_port_t send); xpc_object_t xpc_mach_send_create_with_disposition(mach_port_t send, unsigned int disposition); mach_port_t xpc_mach_send_copy_right(xpc_object_t xsend); diff --git a/include/xpc/private/pipe.h b/include/xpc/private/pipe.h index 27378ce..d994a73 100644 --- a/include/xpc/private/pipe.h +++ b/include/xpc/private/pipe.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_PRIVATE_PIPE_H_ #define _XPC_PRIVATE_PIPE_H_ @@ -9,6 +28,10 @@ __BEGIN_DECLS +XPC_EXPORT +XPC_TYPE(_xpc_type_pipe); +#define XPC_TYPE_PIPE (&_xpc_type_pipe) + XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH; XPC_DECL(xpc_pipe); XPC_IGNORE_DUPLICATE_PROTOCOL_POP; diff --git a/include/xpc/private/plist.h b/include/xpc/private/plist.h index 249660a..f28b7e3 100644 --- a/include/xpc/private/plist.h +++ b/include/xpc/private/plist.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_PRIVATE_PLIST_H_ #define _XPC_PRIVATE_PLIST_H_ diff --git a/internal-include/xpc/generic_array.h b/internal-include/xpc/generic_array.h index ac78ffc..57c2d4c 100644 --- a/internal-include/xpc/generic_array.h +++ b/internal-include/xpc/generic_array.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_GENERIC_ARRAY_H_ #define _XPC_GENERIC_ARRAY_H_ diff --git a/internal-include/xpc/internal.h b/internal-include/xpc/internal.h index b423c2e..721ed7c 100644 --- a/internal-include/xpc/internal.h +++ b/internal-include/xpc/internal.h @@ -1,32 +1,24 @@ -/* - * Copyright 2014-2015 iXsystems, Inc. - * All rights reserved +/** + * This file is part of Darling. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted providing that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * Copyright (C) 2021 Darling developers * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . */ -#ifndef _LIBXPC_XPC_INTERNAL_H -#define _LIBXPC_XPC_INTERNAL_H +#ifndef _XPC_INTERNAL_H +#define _XPC_INTERNAL_H #include @@ -62,4 +54,4 @@ #import #import -#endif /* _LIBXPC_XPC_INTERNAL_H */ +#endif /* _XPC_INTERNAL_H */ diff --git a/internal-include/xpc/internal_base.h b/internal-include/xpc/internal_base.h index 6a2a6ad..72926d1 100644 --- a/internal-include/xpc/internal_base.h +++ b/internal-include/xpc/internal_base.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_INTERNAL_BASE_H_ #define _XPC_INTERNAL_BASE_H_ diff --git a/internal-include/xpc/objects/activity.h b/internal-include/xpc/objects/activity.h index 86d5ba7..8ccd037 100644 --- a/internal-include/xpc/objects/activity.h +++ b/internal-include/xpc/objects/activity.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_ACTIVITY_H_ #define _XPC_OBJECTS_ACTIVITY_H_ diff --git a/internal-include/xpc/objects/array.h b/internal-include/xpc/objects/array.h index 83e51b5..bd5814c 100644 --- a/internal-include/xpc/objects/array.h +++ b/internal-include/xpc/objects/array.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_ARRAY_H_ #define _XPC_OBJECTS_ARRAY_H_ diff --git a/internal-include/xpc/objects/base.h b/internal-include/xpc/objects/base.h index 71460af..14c866f 100644 --- a/internal-include/xpc/objects/base.h +++ b/internal-include/xpc/objects/base.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_BASE_H_ #define _XPC_OBJECTS_BASE_H_ diff --git a/internal-include/xpc/objects/bool.h b/internal-include/xpc/objects/bool.h index 58c58ad..1669fa6 100644 --- a/internal-include/xpc/objects/bool.h +++ b/internal-include/xpc/objects/bool.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_BOOL_H_ #define _XPC_OBJECTS_BOOL_H_ diff --git a/internal-include/xpc/objects/bundle.h b/internal-include/xpc/objects/bundle.h index c097cb5..9bcedd9 100644 --- a/internal-include/xpc/objects/bundle.h +++ b/internal-include/xpc/objects/bundle.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_BUNDLE_H_ #define _XPC_OBJECTS_BUNDLE_H_ @@ -5,7 +24,9 @@ #include +XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH; XPC_CLASS_DECL(bundle); +XPC_IGNORE_DUPLICATE_PROTOCOL_POP; @class XPC_CLASS(string); @class XPC_CLASS(dictionary); diff --git a/internal-include/xpc/objects/connection.h b/internal-include/xpc/objects/connection.h index 3e84f0a..3887700 100644 --- a/internal-include/xpc/objects/connection.h +++ b/internal-include/xpc/objects/connection.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_CONNECTION_H_ #define _XPC_OBJECTS_CONNECTION_H_ diff --git a/internal-include/xpc/objects/data.h b/internal-include/xpc/objects/data.h index aa0bd95..9d7b774 100644 --- a/internal-include/xpc/objects/data.h +++ b/internal-include/xpc/objects/data.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_DATA_H_ #define _XPC_OBJECTS_DATA_H_ diff --git a/internal-include/xpc/objects/date.h b/internal-include/xpc/objects/date.h index d823f29..b439a92 100644 --- a/internal-include/xpc/objects/date.h +++ b/internal-include/xpc/objects/date.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_DATE_H_ #define _XPC_OBJECTS_DATE_H_ diff --git a/internal-include/xpc/objects/deserializer.h b/internal-include/xpc/objects/deserializer.h index 6338d82..b5ba327 100644 --- a/internal-include/xpc/objects/deserializer.h +++ b/internal-include/xpc/objects/deserializer.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_DESERIALIZER_H_ #define _XPC_OBJECTS_DESERIALIZER_H_ diff --git a/internal-include/xpc/objects/dictionary.h b/internal-include/xpc/objects/dictionary.h index 103da5b..df38b39 100644 --- a/internal-include/xpc/objects/dictionary.h +++ b/internal-include/xpc/objects/dictionary.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_DICTIONARY_H_ #define _XPC_OBJECTS_DICTIONARY_H_ diff --git a/internal-include/xpc/objects/double.h b/internal-include/xpc/objects/double.h index 229c3fe..85caeb3 100644 --- a/internal-include/xpc/objects/double.h +++ b/internal-include/xpc/objects/double.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_DOUBLE_H_ #define _XPC_OBJECTS_DOUBLE_H_ diff --git a/internal-include/xpc/objects/endpoint.h b/internal-include/xpc/objects/endpoint.h index 8fa080c..3f2cb27 100644 --- a/internal-include/xpc/objects/endpoint.h +++ b/internal-include/xpc/objects/endpoint.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_ENDPOINT_H_ #define _XPC_OBJECTS_ENDPOINT_H_ diff --git a/internal-include/xpc/objects/error.h b/internal-include/xpc/objects/error.h index f7df719..0fcec1b 100644 --- a/internal-include/xpc/objects/error.h +++ b/internal-include/xpc/objects/error.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_ERROR_H_ #define _XPC_OBJECTS_ERROR_H_ diff --git a/internal-include/xpc/objects/fd.h b/internal-include/xpc/objects/fd.h index 7649dd2..9c62de2 100644 --- a/internal-include/xpc/objects/fd.h +++ b/internal-include/xpc/objects/fd.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_FD_H_ #define _XPC_OBJECTS_FD_H_ diff --git a/internal-include/xpc/objects/file_transfer.h b/internal-include/xpc/objects/file_transfer.h index 8e09542..5b03b90 100644 --- a/internal-include/xpc/objects/file_transfer.h +++ b/internal-include/xpc/objects/file_transfer.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_FILE_TRANSFER_H_ #define _XPC_OBJECTS_FILE_TRANSFER_H_ diff --git a/internal-include/xpc/objects/int64.h b/internal-include/xpc/objects/int64.h index 46e5c0f..8c59c86 100644 --- a/internal-include/xpc/objects/int64.h +++ b/internal-include/xpc/objects/int64.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_INT64_H_ #define _XPC_OBJECTS_INT64_H_ diff --git a/internal-include/xpc/objects/mach_recv.h b/internal-include/xpc/objects/mach_recv.h index bab2806..c408710 100644 --- a/internal-include/xpc/objects/mach_recv.h +++ b/internal-include/xpc/objects/mach_recv.h @@ -1,10 +1,31 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_MACH_RECV_H_ #define _XPC_OBJECTS_MACH_RECV_H_ #import #import +XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH; XPC_CLASS_DECL(mach_recv); +XPC_IGNORE_DUPLICATE_PROTOCOL_POP; struct xpc_mach_recv_s { struct xpc_object_s base; diff --git a/internal-include/xpc/objects/mach_send.h b/internal-include/xpc/objects/mach_send.h index b1b2f5d..72ff442 100644 --- a/internal-include/xpc/objects/mach_send.h +++ b/internal-include/xpc/objects/mach_send.h @@ -1,10 +1,31 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_MACH_SEND_H_ #define _XPC_OBJECTS_MACH_SEND_H_ #import #import +XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH; XPC_CLASS_DECL(mach_send); +XPC_IGNORE_DUPLICATE_PROTOCOL_POP; struct xpc_mach_send_s { struct xpc_object_s base; diff --git a/internal-include/xpc/objects/null.h b/internal-include/xpc/objects/null.h index 3874a34..06d2f41 100644 --- a/internal-include/xpc/objects/null.h +++ b/internal-include/xpc/objects/null.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_NULL_H_ #define _XPC_OBJECTS_NULL_H_ diff --git a/internal-include/xpc/objects/pipe.h b/internal-include/xpc/objects/pipe.h index f939f8a..619476c 100644 --- a/internal-include/xpc/objects/pipe.h +++ b/internal-include/xpc/objects/pipe.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_PIPE_H_ #define _XPC_OBJECTS_PIPE_H_ diff --git a/internal-include/xpc/objects/plist_binary_v0_deserializer.h b/internal-include/xpc/objects/plist_binary_v0_deserializer.h index 827d28f..91433d2 100644 --- a/internal-include/xpc/objects/plist_binary_v0_deserializer.h +++ b/internal-include/xpc/objects/plist_binary_v0_deserializer.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_PLIST_BINARY_V0_DESERIALIZER_H_ #define _XPC_OBJECTS_PLIST_BINARY_V0_DESERIALIZER_H_ diff --git a/internal-include/xpc/objects/plist_xml_element.h b/internal-include/xpc/objects/plist_xml_element.h index 8249b73..9fff6b7 100644 --- a/internal-include/xpc/objects/plist_xml_element.h +++ b/internal-include/xpc/objects/plist_xml_element.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_PLIST_XML_ELEMENT_H_ #define _XPC_OBJECTS_PLIST_XML_ELEMENT_H_ diff --git a/internal-include/xpc/objects/pointer.h b/internal-include/xpc/objects/pointer.h index 3d5117a..2bd3779 100644 --- a/internal-include/xpc/objects/pointer.h +++ b/internal-include/xpc/objects/pointer.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_POINTER_H_ #define _XPC_OBJECTS_POINTER_H_ diff --git a/internal-include/xpc/objects/serializer.h b/internal-include/xpc/objects/serializer.h index 2559010..a3aa48b 100644 --- a/internal-include/xpc/objects/serializer.h +++ b/internal-include/xpc/objects/serializer.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_SERIALIZER_H_ #define _XPC_OBJECTS_SERIALIZER_H_ diff --git a/internal-include/xpc/objects/service.h b/internal-include/xpc/objects/service.h index 4569207..da16c10 100644 --- a/internal-include/xpc/objects/service.h +++ b/internal-include/xpc/objects/service.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_SERVICE_H_ #define _XPC_OBJECTS_SERVICE_H_ diff --git a/internal-include/xpc/objects/service_instance.h b/internal-include/xpc/objects/service_instance.h index 4f7e5f0..4431b59 100644 --- a/internal-include/xpc/objects/service_instance.h +++ b/internal-include/xpc/objects/service_instance.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_SERVICE_INSTANCE_H_ #define _XPC_OBJECTS_SERVICE_INSTANCE_H_ diff --git a/internal-include/xpc/objects/shmem.h b/internal-include/xpc/objects/shmem.h index 55f7cdb..bacf980 100644 --- a/internal-include/xpc/objects/shmem.h +++ b/internal-include/xpc/objects/shmem.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_SHMEM_H_ #define _XPC_OBJECTS_SHMEM_H_ diff --git a/internal-include/xpc/objects/string.h b/internal-include/xpc/objects/string.h index 2442255..4f7c16e 100644 --- a/internal-include/xpc/objects/string.h +++ b/internal-include/xpc/objects/string.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_STRING_H_ #define _XPC_OBJECTS_STRING_H_ @@ -15,26 +34,26 @@ struct xpc_string_s { @interface XPC_CLASS_INTERFACE(string) -// this API is modeled after NSString +// this API is modeled after NSString (except with CString instead of UTF8String) // non-NSString property; length of the string in bytes, not including the null terminator @property(readonly) NSUInteger byteLength; -@property(readonly) const char* UTF8String; +@property(readonly) const char* CString; -+ (instancetype)stringWithUTF8String: (const char*)string; ++ (instancetype)stringWithCString: (const char*)string; // non-NSString method -+ (instancetype)stringWithUTF8String: (const char*)string byteLength: (NSUInteger)byteLength; ++ (instancetype)stringWithCString: (const char*)string byteLength: (NSUInteger)byteLength; // non-NSString method -+ (instancetype)stringWithUTF8StringNoCopy: (const char*)string freeWhenDone: (BOOL)freeIt; ++ (instancetype)stringWithCStringNoCopy: (const char*)string freeWhenDone: (BOOL)freeIt; + (instancetype) XPC_PRINTF(1, 2) stringWithFormat: (const char*)format, ...; // non-NSString method -- (instancetype)initWithUTF8String: (const char*)string byteLength: (NSUInteger)byteLength; -- (instancetype)initWithUTF8String: (const char*)string; +- (instancetype)initWithCString: (const char*)string byteLength: (NSUInteger)byteLength; +- (instancetype)initWithCString: (const char*)string; // non-NSString method -- (instancetype)initWithUTF8StringNoCopy: (const char*)string byteLength: (NSUInteger)byteLength freeWhenDone: (BOOL)freeIt; +- (instancetype)initWithCStringNoCopy: (const char*)string byteLength: (NSUInteger)byteLength freeWhenDone: (BOOL)freeIt; // non-NSString method -- (instancetype)initWithUTF8StringNoCopy: (const char*)string freeWhenDone: (BOOL)freeIt; +- (instancetype)initWithCStringNoCopy: (const char*)string freeWhenDone: (BOOL)freeIt; - (instancetype) XPC_PRINTF(1, 2) initWithFormat: (const char*)format, ...; - (instancetype) XPC_PRINTF(1, 0) initWithFormat: (const char*)format arguments: (va_list)args; diff --git a/internal-include/xpc/objects/uint64.h b/internal-include/xpc/objects/uint64.h index 7dc0d6f..4fe92bd 100644 --- a/internal-include/xpc/objects/uint64.h +++ b/internal-include/xpc/objects/uint64.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_UINT64_H_ #define _XPC_OBJECTS_UINT64_H_ diff --git a/internal-include/xpc/objects/uuid.h b/internal-include/xpc/objects/uuid.h index 23c2c0e..fb2720d 100644 --- a/internal-include/xpc/objects/uuid.h +++ b/internal-include/xpc/objects/uuid.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_OBJECTS_UUID_H_ #define _XPC_OBJECTS_UUID_H_ diff --git a/internal-include/xpc/plist.h b/internal-include/xpc/plist.h index ecc0dfd..807f3d5 100644 --- a/internal-include/xpc/plist.h +++ b/internal-include/xpc/plist.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_INTERNAL_PLIST_H_ #define _XPC_INTERNAL_PLIST_H_ diff --git a/internal-include/xpc/prefix.h b/internal-include/xpc/prefix.h index 874010d..5c4125d 100644 --- a/internal-include/xpc/prefix.h +++ b/internal-include/xpc/prefix.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #if __OBJC2__ diff --git a/internal-include/xpc/util.h b/internal-include/xpc/util.h index 33c30e8..5980b1a 100644 --- a/internal-include/xpc/util.h +++ b/internal-include/xpc/util.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_UTIL_H_ #define _XPC_UTIL_H_ @@ -24,7 +43,7 @@ * @code * xpc_object_t some_input = get_some_input(); * TO_OBJC_CHECKED(string, some_input, some_checked_input) { - * printf("Yay! It's a string! Look: %s\n", some_checked_input.description.UTF8String); // note that this assumes NSString is loaded + * printf("Yay! It's a string! Look: %s\n", some_checked_input.description.CString); // note that this assumes NSString is loaded * } else { * printf("Oh no, you messed up and gave me an object that wasn't a string :(\n"); * } @@ -32,7 +51,7 @@ */ #define TO_OBJC_CHECKED(className, origName, objcName) \ XPC_CLASS(className)* objcName = XPC_CAST(className, origName); \ - if (objcName && [objcName isKindOfClass: [XPC_CLASS(className) class]]) + if ([objcName isKindOfClass: [XPC_CLASS(className) class]]) /** * Like `TO_OBJC_CHECKED`, but the condition checks for failure to pass the checks. @@ -41,7 +60,7 @@ */ #define TO_OBJC_CHECKED_ON_FAIL(className, origName, objcName) \ XPC_CLASS(className)* objcName = XPC_CAST(className, origName); \ - if (!objcName || ![objcName isKindOfClass: [XPC_CLASS(className) class]]) + if (![objcName isKindOfClass: [XPC_CLASS(className) class]]) /** * Special `retain` variant for collection classes like dictionaries and arrays. diff --git a/scripts/bin2hdr.py b/scripts/bin2hdr.py index c643004..582ddff 100755 --- a/scripts/bin2hdr.py +++ b/scripts/bin2hdr.py @@ -1,5 +1,24 @@ #!/usr/bin/env python +# +# This file is part of Darling. +# +# Copyright (C) 2021 Darling developers +# +# Darling is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Darling is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Darling. If not, see . +# + import sys def to_padded_hex(value, hex_digits=2): diff --git a/src/activity.m b/src/activity.m index 6035ede..155ca06 100644 --- a/src/activity.m +++ b/src/activity.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/array.m b/src/array.m index 06078dd..6647bb6 100644 --- a/src/array.m +++ b/src/array.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/base.m b/src/base.m index 6958848..8c25ffe 100644 --- a/src/base.m +++ b/src/base.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import @@ -41,9 +60,10 @@ _Pragma("GCC diagnostic pop"); Class nsstring = objc_lookUpClass("NSString"); if (!nsstring) return nil; char* desc = self.xpcDescription; - NSString* string = [nsstring stringWithUTF8String: desc]; - free(desc); - return string; + return [[[nsstring alloc] initWithBytesNoCopy: desc + length: strlen(desc) + encoding: NSUTF8StringEncoding + freeWhenDone: YES] autorelease]; } - (BOOL)isEqual: (id)object diff --git a/src/bool.m b/src/bool.m index 345d2e6..a81c351 100644 --- a/src/bool.m +++ b/src/bool.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/bundle.m b/src/bundle.m index 198cfc0..21fde6d 100644 --- a/src/bundle.m +++ b/src/bundle.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import @@ -26,7 +45,7 @@ XPC_CLASS_HEADER(bundle); if (!exec_path) { return NULL; } - return [[[[self class] alloc] initWithPath: [XPC_CLASS(string) stringWithUTF8StringNoCopy: exec_path freeWhenDone: YES]] autorelease]; + return [[[[self class] alloc] initWithPath: [XPC_CLASS(string) stringWithCStringNoCopy: exec_path freeWhenDone: YES]] autorelease]; } + (BOOL)pathIsBundleRoot: (XPC_CLASS(string)*)path @@ -36,11 +55,11 @@ XPC_CLASS_HEADER(bundle); // in either case, however, we can tell if it's the bundle root if it contains an Info.plist (it's required for all bundles). // the difference is just in whether it's directly in the root or in a `Contents` directory. if (strcmp(path.pathExtension, "framework") == 0) { - if (xpc_path_is_file([path stringByAppendingPathComponent: "Info.plist"].UTF8String)) { + if (xpc_path_is_file([path stringByAppendingPathComponent: "Info.plist"].CString)) { return YES; } } else { - if (xpc_path_is_file([path stringByAppendingPathComponent: "Contents/Info.plist"].UTF8String)) { + if (xpc_path_is_file([path stringByAppendingPathComponent: "Contents/Info.plist"].CString)) { return YES; } } @@ -158,7 +177,7 @@ XPC_CLASS_HEADER(bundle); - (XPC_CLASS(string)*)pathForResource: (const char*)name ofType: (const char*)type { - return [XPC_CLASS(string) stringWithFormat: "%s/%s.%s", self.bundlePath.UTF8String, name, type]; + return [XPC_CLASS(string) stringWithFormat: "%s/%s.%s", self.bundlePath.CString, name, type]; } - (XPC_CLASS(string)*)pathForSubdirectoryOfType: (xpc_bundle_subdirectory_type_t)type @@ -184,7 +203,7 @@ XPC_CLASS_HEADER(bundle); result = [[[self.infoDictionary stringForKey: "NSExecutable"] retain] autorelease]; if (!result) { // finally, if all else fails, try to use the same name as the bundle - result = [[XPC_CLASS(string) stringWithUTF8String: self.bundlePath.lastPathComponent] stringByDeletingPathExtension]; + result = [[XPC_CLASS(string) stringWithCString: self.bundlePath.lastPathComponent] stringByDeletingPathExtension]; } } @@ -215,11 +234,11 @@ XPC_CLASS_HEADER(bundle); // cache the executable path executableDirTmp = (self.isFramework) ? self.bundlePath : [self.bundlePath stringByAppendingPathComponent: "Contents/MacOS"]; - self.executablePath = [[executableDirTmp stringByAppendingPathComponent: [self resolveExecutableName].UTF8String] stringByResolvingSymlinksInPath]; + self.executablePath = [[executableDirTmp stringByAppendingPathComponent: [self resolveExecutableName].CString] stringByResolvingSymlinksInPath]; // resolve XPC services this->services = [XPC_CLASS(array) new]; - xpcServicesDir = opendir(xpcServicesPath.UTF8String); + xpcServicesDir = opendir(xpcServicesPath.CString); if (xpcServicesDir) { while ((xpcServiceDirent = readdir(xpcServicesDir))) { @autoreleasepool { @@ -246,11 +265,11 @@ XPC_CLASS_HEADER(bundle); void* buffer = NULL; xpc_object_t plist = NULL; - if (!xpc_path_is_file(self.infoPath.UTF8String)) { + if (!xpc_path_is_file(self.infoPath.CString)) { // no Info.plist; let's continue the resolution with an empty plist plist = [XPC_CLASS(dictionary) new]; } else { - fd = open(self.infoPath.UTF8String, O_RDONLY); + fd = open(self.infoPath.CString, O_RDONLY); if (fd < 0) { self.error = xpc_bundle_error_failed_to_read_plist; @@ -291,7 +310,7 @@ XPC_CLASS_HEADER(bundle); { int fd = -1; - if (!xpc_path_is_file(self.infoPath.UTF8String)) { + if (!xpc_path_is_file(self.infoPath.CString)) { // no Info.plist; let's continue the resolution with an empty plist callback = Block_copy(callback); dispatch_async(resolutionQueue, ^{ @@ -304,7 +323,7 @@ XPC_CLASS_HEADER(bundle); return; } - fd = open(self.infoPath.UTF8String, O_RDONLY); + fd = open(self.infoPath.CString, O_RDONLY); if (fd < 0) { self.error = xpc_bundle_error_failed_to_read_plist; @@ -340,7 +359,7 @@ char* xpc_bundle_copy_resource_path(xpc_object_t xbundle, const char* name, cons TO_OBJC_CHECKED(bundle, xbundle, bundle) { @autoreleasepool { XPC_CLASS(string)* path = [bundle pathForResource: name ofType: type]; - return path ? strdup(path.UTF8String) : NULL; + return path ? strdup(path.CString) : NULL; } } return NULL; @@ -356,14 +375,14 @@ xpc_object_t xpc_bundle_copy_services(xpc_object_t xbundle) { XPC_EXPORT xpc_object_t xpc_bundle_create(const char* path, unsigned int flags) { @autoreleasepool { - return [[XPC_CLASS(bundle) alloc] initWithPath: [XPC_CLASS(string) stringWithUTF8String: path]]; + return [[XPC_CLASS(bundle) alloc] initWithPath: [XPC_CLASS(string) stringWithCString: path]]; } }; XPC_EXPORT xpc_object_t xpc_bundle_create_from_origin(unsigned int origin, const char* path) { @autoreleasepool { - return [[XPC_CLASS(bundle) alloc] initWithPath: [XPC_CLASS(string) stringWithUTF8String: path]]; + return [[XPC_CLASS(bundle) alloc] initWithPath: [XPC_CLASS(string) stringWithCString: path]]; } }; @@ -385,7 +404,7 @@ int xpc_bundle_get_error(xpc_object_t xbundle) { XPC_EXPORT const char* xpc_bundle_get_executable_path(xpc_object_t xbundle) { TO_OBJC_CHECKED(bundle, xbundle, bundle) { - return bundle.executablePath.UTF8String; + return bundle.executablePath.CString; } return NULL; }; @@ -401,7 +420,7 @@ xpc_object_t xpc_bundle_get_info_dictionary(xpc_object_t xbundle) { XPC_EXPORT const char* xpc_bundle_get_path(xpc_object_t xbundle) { TO_OBJC_CHECKED(bundle, xbundle, bundle) { - return bundle.bundlePath.UTF8String; + return bundle.bundlePath.CString; } return NULL; }; diff --git a/src/coalition.m b/src/coalition.m index 6c14571..797a70e 100644 --- a/src/coalition.m +++ b/src/coalition.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import diff --git a/src/connection.m b/src/connection.m index 97b9003..f74e91e 100644 --- a/src/connection.m +++ b/src/connection.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/data.m b/src/data.m index 7f37fa2..8f7e65d 100644 --- a/src/data.m +++ b/src/data.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #define __DISPATCH_INDIRECT__ diff --git a/src/date.m b/src/date.m index a94c570..d2f6ee1 100644 --- a/src/date.m +++ b/src/date.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/dictionary.m b/src/dictionary.m index 2cfaee9..018edae 100644 --- a/src/dictionary.m +++ b/src/dictionary.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/double.m b/src/double.m index f0549cd..83cbcb2 100644 --- a/src/double.m +++ b/src/double.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/endpoint.m b/src/endpoint.m index 3580712..1c53527 100644 --- a/src/endpoint.m +++ b/src/endpoint.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/error.m b/src/error.m index 0f7217d..ef4f9f4 100644 --- a/src/error.m +++ b/src/error.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import @@ -57,7 +76,7 @@ XPC_CLASS_HEADER(error); - (char*)xpcDescription { char* output = NULL; - asprintf(&output, "<%s: %s>", xpc_class_name(self), [self stringForKey: XPCErrorDescriptionKey].UTF8String); + asprintf(&output, "<%s: %s>", xpc_class_name(self), [self stringForKey: XPCErrorDescriptionKey].CString); return output; } diff --git a/src/event.m b/src/event.m index fe0ae71..0870a6c 100644 --- a/src/event.m +++ b/src/event.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import diff --git a/src/fd.m b/src/fd.m index 06aa722..5e3d57a 100644 --- a/src/fd.m +++ b/src/fd.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/file_transfer.m b/src/file_transfer.m index 2c46535..736736d 100644 --- a/src/file_transfer.m +++ b/src/file_transfer.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/init.c b/src/init.c index f4a4073..624d064 100644 --- a/src/init.c +++ b/src/init.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import void xpc_stub_init(void); diff --git a/src/int64.m b/src/int64.m index 853c730..d3e71d2 100644 --- a/src/int64.m +++ b/src/int64.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/launchd.m b/src/launchd.m index f1d0a63..be02a5d 100644 --- a/src/launchd.m +++ b/src/launchd.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/mach_recv.m b/src/mach_recv.m index 42e57ad..6b6c2cd 100644 --- a/src/mach_recv.m +++ b/src/mach_recv.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/mach_send.m b/src/mach_send.m index 8f938c2..c00103c 100644 --- a/src/mach_send.m +++ b/src/mach_send.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/misc.m b/src/misc.m index c370c53..3134425 100644 --- a/src/misc.m +++ b/src/misc.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/null.m b/src/null.m index 79b0e0e..614db7e 100644 --- a/src/null.m +++ b/src/null.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/pipe.m b/src/pipe.m index a1ff972..757a6be 100644 --- a/src/pipe.m +++ b/src/pipe.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/plist.m b/src/plist.m index 2b4e144..e9e3d98 100644 --- a/src/plist.m +++ b/src/plist.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import @@ -276,7 +295,7 @@ XPC_CLASS_HEADER(plist_xml_element); dispatch_data_t dispatchData = NULL; XPC_CLASS(data)* xpcData = nil; - temp = dispatch_data_create(string.UTF8String, string.byteLength, NULL, DISPATCH_DATA_DESTRUCTOR_NONE); + temp = dispatch_data_create(string.CString, string.byteLength, NULL, DISPATCH_DATA_DESTRUCTOR_NONE); if (!temp) { goto data_error; } @@ -316,7 +335,7 @@ XPC_CLASS_HEADER(plist_xml_element); // not using strptime because that aborts the whole thing if parts are missing; // we need to be able to optionally omit components (which sscanf supports) - sscanf(string.UTF8String ? string.UTF8String : "", "%d-%d-%dT%d:%d:%dZ", &time.tm_year, &time.tm_mon, &time.tm_mday, &time.tm_hour, &time.tm_min, &time.tm_sec); + sscanf(string.CString ? string.CString : "", "%d-%d-%dT%d:%d:%dZ", &time.tm_year, &time.tm_mon, &time.tm_mday, &time.tm_hour, &time.tm_min, &time.tm_sec); if (time.tm_year > 0) { time.tm_year -= 1900; } @@ -330,14 +349,14 @@ XPC_CLASS_HEADER(plist_xml_element); case xpc_plist_xml_element_type_real: { XPC_CLASS(string)* string = XPC_CAST(string, this->object); - double value = atof(string.UTF8String); + double value = atof(string.CString); [this->object release]; this->object = [[XPC_CLASS(double) alloc] initWithValue: value]; } break; case xpc_plist_xml_element_type_integer: { XPC_CLASS(string)* string = XPC_CAST(string, this->object); - int64_t value = atoll(string.UTF8String); + int64_t value = atoll(string.CString); [this->object release]; this->object = [[XPC_CLASS(int64) alloc] initWithValue: value]; } break; @@ -387,7 +406,7 @@ handover_to_parent: self.cache = XPC_CAST(string, child.object); } else { xpc_assert(self.cache); - [XPC_CAST(dictionary, this->object) setObject: child.object forKey: self.cache.UTF8String]; + [XPC_CAST(dictionary, this->object) setObject: child.object forKey: self.cache.CString]; self.cache = nil; } } break; @@ -847,7 +866,7 @@ XPC_CLASS_HEADER(plist_binary_v0_deserializer); if (length == NSUIntegerMax) { return nil; } - return [[XPC_CLASS(string) alloc] initWithUTF8String: (const char*)bytes byteLength: length]; + return [[XPC_CLASS(string) alloc] initWithCString: (const char*)bytes byteLength: length]; } - (XPC_CLASS(string)*)readUTF16String: (const uint8_t*)object @@ -865,7 +884,7 @@ XPC_CLASS_HEADER(plist_binary_v0_deserializer); data = dispatch_data_create(bytes, length, NULL, DISPATCH_DATA_DESTRUCTOR_NONE); // how nice of them to have something specifically for this purpose :) transformed = dispatch_data_create_with_transform(data, DISPATCH_DATA_FORMAT_TYPE_UTF16BE, DISPATCH_DATA_FORMAT_TYPE_UTF8); - result = [[XPC_CLASS(string) alloc] initWithUTF8String: dispatch_data_get_flattened_bytes_4libxpc(transformed) byteLength: dispatch_data_get_size(transformed)]; + result = [[XPC_CLASS(string) alloc] initWithCString: dispatch_data_get_flattened_bytes_4libxpc(transformed) byteLength: dispatch_data_get_size(transformed)]; [transformed release]; [data release]; @@ -950,7 +969,7 @@ XPC_CLASS_HEADER(plist_binary_v0_deserializer); XPC_CLASS(object)* key = [self readObject: keyReferenceNumber]; XPC_CLASS(object)* value = [self readObject: valueReferenceNumber]; TO_OBJC_CHECKED(string, key, keyString) { - [result setObject: value forKey: keyString.UTF8String]; + [result setObject: value forKey: keyString.CString]; } [key release]; [value release]; diff --git a/src/pointer.m b/src/pointer.m index a687ab8..00ec092 100644 --- a/src/pointer.m +++ b/src/pointer.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/reboot3.c b/src/reboot3.c index d7763e8..520418b 100644 --- a/src/reboot3.c +++ b/src/reboot3.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import diff --git a/src/runtime.m b/src/runtime.m index 10f5ae3..8fa0884 100644 --- a/src/runtime.m +++ b/src/runtime.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import @@ -90,7 +109,7 @@ void xpc_main(xpc_connection_handler_t handler) { xpc_abort("failed to determine main bundle identifier"); } - server = [[XPC_CLASS(connection) alloc] initAsServerForService: identifier.UTF8String queue: NULL]; + server = [[XPC_CLASS(connection) alloc] initAsServerForService: identifier.CString queue: NULL]; if (!server) { xpc_abort("failed to create server connection"); } @@ -115,7 +134,7 @@ void xpc_main(xpc_connection_handler_t handler) { [server activate]; }); - runloopType = runloop_name_to_type([XPC_CAST(dictionary, xpc_bundle_get_xpcservice_dictionary(mainBundle)) stringForKey: XPC_SERVICE_DICT_RUNLOOP_TYPE_KEY].UTF8String); + runloopType = runloop_name_to_type([XPC_CAST(dictionary, xpc_bundle_get_xpcservice_dictionary(mainBundle)) stringForKey: XPC_SERVICE_DICT_RUNLOOP_TYPE_KEY].CString); switch (runloopType) { case xpc_service_runloop_type_dispatch: { diff --git a/src/service.m b/src/service.m index 3f642de..99955c4 100644 --- a/src/service.m +++ b/src/service.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/service_instance.m b/src/service_instance.m index cab11db..696ad25 100644 --- a/src/service_instance.m +++ b/src/service_instance.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/shmem.m b/src/shmem.m index 3754c2a..2fc53ff 100644 --- a/src/shmem.m +++ b/src/shmem.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/string.m b/src/string.m index f46bcbb..1335450 100644 --- a/src/string.m +++ b/src/string.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import @@ -10,19 +29,19 @@ OS_OBJECT_NONLAZY_CLASS XPC_CLASS_HEADER(string); -+ (instancetype)stringWithUTF8String: (const char*)string ++ (instancetype)stringWithCString: (const char*)string { - return [[[[self class] alloc] initWithUTF8String: string] autorelease]; + return [[[[self class] alloc] initWithCString: string] autorelease]; } -+ (instancetype)stringWithUTF8String: (const char*)string byteLength: (NSUInteger)byteLength ++ (instancetype)stringWithCString: (const char*)string byteLength: (NSUInteger)byteLength { - return [[[[self class] alloc] initWithUTF8String: string byteLength: byteLength] autorelease]; + return [[[[self class] alloc] initWithCString: string byteLength: byteLength] autorelease]; } -+ (instancetype)stringWithUTF8StringNoCopy: (const char*)string freeWhenDone: (BOOL)freeIt ++ (instancetype)stringWithCStringNoCopy: (const char*)string freeWhenDone: (BOOL)freeIt { - return [[[[self class] alloc] initWithUTF8StringNoCopy: string freeWhenDone: freeIt] autorelease]; + return [[[[self class] alloc] initWithCStringNoCopy: string freeWhenDone: freeIt] autorelease]; } + (instancetype)stringWithFormat: (const char*)format, ... @@ -46,8 +65,8 @@ XPC_CLASS_HEADER(string); - (char*)xpcDescription { char* output = NULL; - if (self.UTF8String) { - asprintf(&output, "<%s: %s>", xpc_class_name(self), self.UTF8String); + if (self.CString) { + asprintf(&output, "<%s: %s>", xpc_class_name(self), self.CString); } else { asprintf(&output, "<%s: NULL>", xpc_class_name(self)); } @@ -63,7 +82,7 @@ XPC_CLASS_HEADER(string); return this->byteLength; } -- (const char*)UTF8String +- (const char*)CString { XPC_THIS_DECL(string); return this->string; @@ -71,10 +90,10 @@ XPC_CLASS_HEADER(string); - (instancetype)init { - return [self initWithUTF8String: "" byteLength: 0]; + return [self initWithCString: "" byteLength: 0]; } -- (instancetype)initWithUTF8String: (const char*)string byteLength: (NSUInteger)byteLength +- (instancetype)initWithCString: (const char*)string byteLength: (NSUInteger)byteLength { if (self = [super init]) { XPC_THIS_DECL(string); @@ -93,12 +112,12 @@ XPC_CLASS_HEADER(string); return self; } -- (instancetype)initWithUTF8String: (const char*)string +- (instancetype)initWithCString: (const char*)string { - return [self initWithUTF8String: string byteLength: strlen(string)]; + return [self initWithCString: string byteLength: strlen(string)]; } -- (instancetype)initWithUTF8StringNoCopy: (const char*)string byteLength: (NSUInteger)byteLength freeWhenDone: (BOOL)freeIt +- (instancetype)initWithCStringNoCopy: (const char*)string byteLength: (NSUInteger)byteLength freeWhenDone: (BOOL)freeIt { if (self = [super init]) { XPC_THIS_DECL(string); @@ -110,9 +129,9 @@ XPC_CLASS_HEADER(string); return self; } -- (instancetype)initWithUTF8StringNoCopy: (const char*)string freeWhenDone: (BOOL)freeIt +- (instancetype)initWithCStringNoCopy: (const char*)string freeWhenDone: (BOOL)freeIt { - return [self initWithUTF8StringNoCopy: string byteLength: strlen(string) freeWhenDone: freeIt]; + return [self initWithCStringNoCopy: string byteLength: strlen(string) freeWhenDone: freeIt]; } - (instancetype)initWithFormat: (const char*)format, ... @@ -166,7 +185,7 @@ XPC_CLASS_HEADER(string); - (instancetype)forceCopy { - return [[[self class] alloc] initWithUTF8String: self.UTF8String]; + return [[[self class] alloc] initWithCString: self.CString]; } - (void)appendString: (const char*)string length: (NSUInteger)extraByteLength @@ -199,12 +218,12 @@ XPC_CLASS_HEADER(string); - (XPC_CLASS(string)*)stringByAppendingString: (const char*)string { - return [[self class] stringWithFormat: "%s/%s", self.UTF8String, string]; + return [[self class] stringWithFormat: "%s/%s", self.CString, string]; } - (BOOL)isEqualToString: (const char*)string { - return strcmp(self.UTF8String, string) == 0; + return strcmp(self.CString, string) == 0; } @end @@ -245,7 +264,7 @@ XPC_CLASS_HEADER(string); // maybe we should check if the string length matches the reported length - result = [[[self class] alloc] initWithUTF8String: string]; + result = [[[self class] alloc] initWithCString: string]; return result; @@ -266,7 +285,7 @@ error_out: goto error_out; } - if (![serializer writeString: self.UTF8String]) { + if (![serializer writeString: self.CString]) { goto error_out; } @@ -282,53 +301,53 @@ error_out: - (const char*)pathExtension { - char* lastDot = strrchr(self.UTF8String, '.'); + char* lastDot = strrchr(self.CString, '.'); return lastDot ? lastDot + 1 : ""; } - (const char*)lastPathComponent { - char* lastSlash = strrchr(self.UTF8String, '/'); + char* lastSlash = strrchr(self.CString, '/'); return lastSlash ? lastSlash + 1 : ""; } - (XPC_CLASS(string)*)stringByDeletingPathExtension { - char* lastDot = strrchr(self.UTF8String, '.'); - return (lastDot) ? [[self class] stringWithUTF8String: self.UTF8String byteLength: lastDot - self.UTF8String] : [self forceCopy]; + char* lastDot = strrchr(self.CString, '.'); + return (lastDot) ? [[self class] stringWithCString: self.CString byteLength: lastDot - self.CString] : [self forceCopy]; } - (XPC_CLASS(string)*)stringByResolvingSymlinksInPath { - char* resolved = realpath(self.UTF8String, NULL); - return resolved ? [[self class] stringWithUTF8StringNoCopy: resolved freeWhenDone: YES] : nil; + char* resolved = realpath(self.CString, NULL); + return resolved ? [[self class] stringWithCStringNoCopy: resolved freeWhenDone: YES] : nil; } - (XPC_CLASS(string)*)stringByAppendingPathComponent: (const char*)component { if (self.byteLength == 0) { - return [[self class] stringWithUTF8String: component]; - } else if (self.UTF8String[self.byteLength - 1] == '/') { + return [[self class] stringWithCString: component]; + } else if (self.CString[self.byteLength - 1] == '/') { return [self stringByAppendingString: component]; } else { - return [[self class] stringWithFormat: "%s/%s", self.UTF8String, component]; + return [[self class] stringWithFormat: "%s/%s", self.CString, component]; } } - (XPC_CLASS(string)*)stringByDeletingLastPathComponent { - char* lastSlash = strrchr(self.UTF8String, '/'); - if (lastSlash && lastSlash > self.UTF8String) { + char* lastSlash = strrchr(self.CString, '/'); + if (lastSlash && lastSlash > self.CString) { *lastSlash = '\0'; // temporarily shorten the string for the copy... - XPC_CLASS(string)* result = [[self class] stringWithUTF8String: self.UTF8String]; + XPC_CLASS(string)* result = [[self class] stringWithCString: self.CString]; *lastSlash = '/'; // ...and then restore it return result; - } else if (lastSlash == self.UTF8String) { + } else if (lastSlash == self.CString) { // if it's the one for the root, return the root - return [[self class] stringWithUTF8String: "/"]; + return [[self class] stringWithCString: "/"]; } else { // otherwise, if it's not present, return an empty string - return [[self class] stringWithUTF8String: ""]; + return [[self class] stringWithCString: ""]; } } @@ -340,7 +359,7 @@ error_out: XPC_EXPORT xpc_object_t xpc_string_create(const char* string) { - return [[XPC_CLASS(string) alloc] initWithUTF8String: string]; + return [[XPC_CLASS(string) alloc] initWithCString: string]; }; XPC_EXPORT @@ -368,7 +387,7 @@ size_t xpc_string_get_length(xpc_object_t xstring) { XPC_EXPORT const char* xpc_string_get_string_ptr(xpc_object_t xstring) { TO_OBJC_CHECKED(string, xstring, string) { - return string.UTF8String; + return string.CString; } return NULL; }; @@ -386,5 +405,5 @@ void _xpc_string_set_value(xpc_object_t xstring, const char* new_string) { XPC_EXPORT xpc_object_t xpc_string_create_no_copy(const char* string) { - return [[XPC_CLASS(string) alloc] initWithUTF8StringNoCopy: string freeWhenDone: NO]; + return [[XPC_CLASS(string) alloc] initWithCStringNoCopy: string freeWhenDone: NO]; }; diff --git a/src/transaction.m b/src/transaction.m index cdf3f8d..b01477e 100644 --- a/src/transaction.m +++ b/src/transaction.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include #include #import diff --git a/src/type.m b/src/type.m index 1558851..8a362ce 100644 --- a/src/type.m +++ b/src/type.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/uint64.m b/src/uint64.m index 0f00ed3..e9f6ffc 100644 --- a/src/uint64.m +++ b/src/uint64.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/util.m b/src/util.m index 7ed693d..13ae163 100644 --- a/src/util.m +++ b/src/util.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/src/uuid.m b/src/uuid.m index c91a0e9..883898a 100644 --- a/src/uuid.m +++ b/src/uuid.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #import #import #import diff --git a/test/array.m b/test/array.m index 80ebb4c..0e71922 100644 --- a/test/array.m +++ b/test/array.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include "ctest-plus.h" #include #include "test-util.h" diff --git a/test/base.m b/test/base.m index bdf8ff6..be8e6c3 100644 --- a/test/base.m +++ b/test/base.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include "ctest-plus.h" #import diff --git a/test/bool.c b/test/bool.c index c3fa33f..8e7f130 100644 --- a/test/bool.c +++ b/test/bool.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include "ctest-plus.h" #include diff --git a/test/bundle.c b/test/bundle.c index 2e9b0a9..ec98001 100644 --- a/test/bundle.c +++ b/test/bundle.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include "ctest-plus.h" #include diff --git a/test/bundled-service/service.c b/test/bundled-service/service.c index f786aec..1a0ea68 100644 --- a/test/bundled-service/service.c +++ b/test/bundled-service/service.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include #include diff --git a/test/ctest-plus.h b/test/ctest-plus.h index e1900b5..c06f06f 100644 --- a/test/ctest-plus.h +++ b/test/ctest-plus.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _CTEST_PLUS_H_ #define _CTEST_PLUS_H_ diff --git a/test/data.c b/test/data.c index abde5d9..ee624a0 100644 --- a/test/data.c +++ b/test/data.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include "ctest-plus.h" #include #include "test-util.h" diff --git a/test/dictionary.m b/test/dictionary.m index 5d1db48..aaf21fe 100644 --- a/test/dictionary.m +++ b/test/dictionary.m @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include "ctest-plus.h" #include #include "test-util.h" diff --git a/test/launchd-service/client.c b/test/launchd-service/client.c index 0540524..a9cd48e 100644 --- a/test/launchd-service/client.c +++ b/test/launchd-service/client.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include #include #include diff --git a/test/launchd-service/client_common.h b/test/launchd-service/client_common.h index 2c325b5..db77f7b 100644 --- a/test/launchd-service/client_common.h +++ b/test/launchd-service/client_common.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_TEST_LAUNCHD_SERVICE_CLIENT_COMMON_H_ #define _XPC_TEST_LAUNCHD_SERVICE_CLIENT_COMMON_H_ diff --git a/test/launchd-service/pipe_client.c b/test/launchd-service/pipe_client.c index b759c24..90a0f0c 100644 --- a/test/launchd-service/pipe_client.c +++ b/test/launchd-service/pipe_client.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include #include diff --git a/test/launchd-service/server.c b/test/launchd-service/server.c index 0364fad..72cdef8 100644 --- a/test/launchd-service/server.c +++ b/test/launchd-service/server.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include #include #include diff --git a/test/launchd-service/server_common.h b/test/launchd-service/server_common.h index c49f065..bdc086c 100644 --- a/test/launchd-service/server_common.h +++ b/test/launchd-service/server_common.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_TEST_LAUNCHD_SERVICE_SERVER_COMMON_H_ #define _XPC_TEST_LAUNCHD_SERVICE_SERVER_COMMON_H_ diff --git a/test/launchd-service/service.h b/test/launchd-service/service.h index c95fb70..71b4a29 100644 --- a/test/launchd-service/service.h +++ b/test/launchd-service/service.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_TEST_LAUNCHD_SERVICE_SERVICE_H_ #define _XPC_TEST_LAUNCHD_SERVICE_SERVICE_H_ diff --git a/test/main.c b/test/main.c index 727041f..9e8be42 100644 --- a/test/main.c +++ b/test/main.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #define CTEST_MAIN // uncomment lines below to enable/disable features. See README.md for details diff --git a/test/plist.c b/test/plist.c index d3555c3..04eb3d7 100644 --- a/test/plist.c +++ b/test/plist.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include "ctest-plus.h" #include diff --git a/test/string.c b/test/string.c index f67d29f..2a84631 100644 --- a/test/string.c +++ b/test/string.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include "ctest-plus.h" #include diff --git a/test/test-util.h b/test/test-util.h index 9028507..8888fc1 100644 --- a/test/test-util.h +++ b/test/test-util.h @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #ifndef _XPC_TEST_TEST_UTIL_H_ #define _XPC_TEST_TEST_UTIL_H_ diff --git a/test/type.c b/test/type.c index e924fd5..684670c 100644 --- a/test/type.c +++ b/test/type.c @@ -1,3 +1,22 @@ +/** + * This file is part of Darling. + * + * Copyright (C) 2021 Darling developers + * + * Darling is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Darling is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Darling. If not, see . + */ + #include "ctest-plus.h" #include