Add license headers everywhere and fix small issues

This commit is contained in:
Ariel Abreu 2021-04-22 09:18:09 -04:00
parent 0ec7a91082
commit efee6f689e
No known key found for this signature in database
GPG Key ID: BB20848279B910AC
102 changed files with 2054 additions and 129 deletions

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _OS_TRANSACTION_PRIVATE_H_ #ifndef _OS_TRANSACTION_PRIVATE_H_
#define _OS_TRANSACTION_PRIVATE_H_ #define _OS_TRANSACTION_PRIVATE_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef XPC_PRIVATE_H_ #ifndef XPC_PRIVATE_H_
#define XPC_PRIVATE_H_ #define XPC_PRIVATE_H_
@ -14,31 +33,12 @@
#include <xpc/private/plist.h> #include <xpc/private/plist.h>
#include <xpc/private/bundle.h> #include <xpc/private/bundle.h>
#ifdef __cplusplus __BEGIN_DECLS
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)
XPC_EXPORT XPC_EXPORT
XPC_TYPE(_xpc_type_serializer); XPC_TYPE(_xpc_type_serializer);
#define XPC_TYPE_SERIALIZER (&_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_EXPORT
XPC_TYPE(_xpc_type_service); XPC_TYPE(_xpc_type_service);
#define XPC_TYPE_SERVICE (&_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); xpc_connection_t xpc_connection_create_listener(const char* name, dispatch_queue_t queue);
#ifdef __cplusplus __END_DECLS
}
#endif
#endif #endif

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_PRIVATE_BUNDLE_H_ #ifndef _XPC_PRIVATE_BUNDLE_H_
#define _XPC_PRIVATE_BUNDLE_H_ #define _XPC_PRIVATE_BUNDLE_H_
@ -5,6 +24,14 @@
__BEGIN_DECLS __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, OS_ENUM(xpc_bundle_error, int,
xpc_bundle_error_success, xpc_bundle_error_success,
xpc_bundle_error_failed_to_read_plist = -1, xpc_bundle_error_failed_to_read_plist = -1,

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_PRIVATE_DATE_H_ #ifndef _XPC_PRIVATE_DATE_H_
#define _XPC_PRIVATE_DATE_H_ #define _XPC_PRIVATE_DATE_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_PRIVATE_ENDPOINT_H_ #ifndef _XPC_PRIVATE_ENDPOINT_H_
#define _XPC_PRIVATE_ENDPOINT_H_ #define _XPC_PRIVATE_ENDPOINT_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_PRIVATE_MACH_RECV_H_ #ifndef _XPC_PRIVATE_MACH_RECV_H_
#define _XPC_PRIVATE_MACH_RECV_H_ #define _XPC_PRIVATE_MACH_RECV_H_
@ -6,6 +25,14 @@
__BEGIN_DECLS __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); xpc_object_t xpc_mach_recv_create(mach_port_t recv);
mach_port_t xpc_mach_recv_extract_right(xpc_object_t xrecv); mach_port_t xpc_mach_recv_extract_right(xpc_object_t xrecv);

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_PRIVATE_MACH_SEND_H_ #ifndef _XPC_PRIVATE_MACH_SEND_H_
#define _XPC_PRIVATE_MACH_SEND_H_ #define _XPC_PRIVATE_MACH_SEND_H_
@ -6,6 +25,14 @@
__BEGIN_DECLS __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(mach_port_t send);
xpc_object_t xpc_mach_send_create_with_disposition(mach_port_t send, unsigned int disposition); 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); mach_port_t xpc_mach_send_copy_right(xpc_object_t xsend);

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_PRIVATE_PIPE_H_ #ifndef _XPC_PRIVATE_PIPE_H_
#define _XPC_PRIVATE_PIPE_H_ #define _XPC_PRIVATE_PIPE_H_
@ -9,6 +28,10 @@
__BEGIN_DECLS __BEGIN_DECLS
XPC_EXPORT
XPC_TYPE(_xpc_type_pipe);
#define XPC_TYPE_PIPE (&_xpc_type_pipe)
XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH; XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH;
XPC_DECL(xpc_pipe); XPC_DECL(xpc_pipe);
XPC_IGNORE_DUPLICATE_PROTOCOL_POP; XPC_IGNORE_DUPLICATE_PROTOCOL_POP;

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_PRIVATE_PLIST_H_ #ifndef _XPC_PRIVATE_PLIST_H_
#define _XPC_PRIVATE_PLIST_H_ #define _XPC_PRIVATE_PLIST_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_GENERIC_ARRAY_H_ #ifndef _XPC_GENERIC_ARRAY_H_
#define _XPC_GENERIC_ARRAY_H_ #define _XPC_GENERIC_ARRAY_H_

View File

@ -1,32 +1,24 @@
/* /**
* Copyright 2014-2015 iXsystems, Inc. * This file is part of Darling.
* All rights reserved
* *
* Redistribution and use in source and binary forms, with or without * Copyright (C) 2021 Darling developers
* 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.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * Darling is free software: you can redistribute it and/or modify
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * it under the terms of the GNU General Public License as published by
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * the Free Software Foundation, either version 3 of the License, or
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * (at your option) any later version.
* 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 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 <http://www.gnu.org/licenses/>.
*/ */
#ifndef _LIBXPC_XPC_INTERNAL_H #ifndef _XPC_INTERNAL_H
#define _LIBXPC_XPC_INTERNAL_H #define _XPC_INTERNAL_H
#include <xpc/private.h> #include <xpc/private.h>
@ -62,4 +54,4 @@
#import <xpc/objects/uint64.h> #import <xpc/objects/uint64.h>
#import <xpc/objects/uuid.h> #import <xpc/objects/uuid.h>
#endif /* _LIBXPC_XPC_INTERNAL_H */ #endif /* _XPC_INTERNAL_H */

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_INTERNAL_BASE_H_ #ifndef _XPC_INTERNAL_BASE_H_
#define _XPC_INTERNAL_BASE_H_ #define _XPC_INTERNAL_BASE_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_ACTIVITY_H_ #ifndef _XPC_OBJECTS_ACTIVITY_H_
#define _XPC_OBJECTS_ACTIVITY_H_ #define _XPC_OBJECTS_ACTIVITY_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_ARRAY_H_ #ifndef _XPC_OBJECTS_ARRAY_H_
#define _XPC_OBJECTS_ARRAY_H_ #define _XPC_OBJECTS_ARRAY_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_BASE_H_ #ifndef _XPC_OBJECTS_BASE_H_
#define _XPC_OBJECTS_BASE_H_ #define _XPC_OBJECTS_BASE_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_BOOL_H_ #ifndef _XPC_OBJECTS_BOOL_H_
#define _XPC_OBJECTS_BOOL_H_ #define _XPC_OBJECTS_BOOL_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_BUNDLE_H_ #ifndef _XPC_OBJECTS_BUNDLE_H_
#define _XPC_OBJECTS_BUNDLE_H_ #define _XPC_OBJECTS_BUNDLE_H_
@ -5,7 +24,9 @@
#include <dispatch/dispatch.h> #include <dispatch/dispatch.h>
XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH;
XPC_CLASS_DECL(bundle); XPC_CLASS_DECL(bundle);
XPC_IGNORE_DUPLICATE_PROTOCOL_POP;
@class XPC_CLASS(string); @class XPC_CLASS(string);
@class XPC_CLASS(dictionary); @class XPC_CLASS(dictionary);

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_CONNECTION_H_ #ifndef _XPC_OBJECTS_CONNECTION_H_
#define _XPC_OBJECTS_CONNECTION_H_ #define _XPC_OBJECTS_CONNECTION_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_DATA_H_ #ifndef _XPC_OBJECTS_DATA_H_
#define _XPC_OBJECTS_DATA_H_ #define _XPC_OBJECTS_DATA_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_DATE_H_ #ifndef _XPC_OBJECTS_DATE_H_
#define _XPC_OBJECTS_DATE_H_ #define _XPC_OBJECTS_DATE_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_DESERIALIZER_H_ #ifndef _XPC_OBJECTS_DESERIALIZER_H_
#define _XPC_OBJECTS_DESERIALIZER_H_ #define _XPC_OBJECTS_DESERIALIZER_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_DICTIONARY_H_ #ifndef _XPC_OBJECTS_DICTIONARY_H_
#define _XPC_OBJECTS_DICTIONARY_H_ #define _XPC_OBJECTS_DICTIONARY_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_DOUBLE_H_ #ifndef _XPC_OBJECTS_DOUBLE_H_
#define _XPC_OBJECTS_DOUBLE_H_ #define _XPC_OBJECTS_DOUBLE_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_ENDPOINT_H_ #ifndef _XPC_OBJECTS_ENDPOINT_H_
#define _XPC_OBJECTS_ENDPOINT_H_ #define _XPC_OBJECTS_ENDPOINT_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_ERROR_H_ #ifndef _XPC_OBJECTS_ERROR_H_
#define _XPC_OBJECTS_ERROR_H_ #define _XPC_OBJECTS_ERROR_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_FD_H_ #ifndef _XPC_OBJECTS_FD_H_
#define _XPC_OBJECTS_FD_H_ #define _XPC_OBJECTS_FD_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_FILE_TRANSFER_H_ #ifndef _XPC_OBJECTS_FILE_TRANSFER_H_
#define _XPC_OBJECTS_FILE_TRANSFER_H_ #define _XPC_OBJECTS_FILE_TRANSFER_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_INT64_H_ #ifndef _XPC_OBJECTS_INT64_H_
#define _XPC_OBJECTS_INT64_H_ #define _XPC_OBJECTS_INT64_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_MACH_RECV_H_ #ifndef _XPC_OBJECTS_MACH_RECV_H_
#define _XPC_OBJECTS_MACH_RECV_H_ #define _XPC_OBJECTS_MACH_RECV_H_
#import <xpc/objects/base.h> #import <xpc/objects/base.h>
#import <mach/port.h> #import <mach/port.h>
XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH;
XPC_CLASS_DECL(mach_recv); XPC_CLASS_DECL(mach_recv);
XPC_IGNORE_DUPLICATE_PROTOCOL_POP;
struct xpc_mach_recv_s { struct xpc_mach_recv_s {
struct xpc_object_s base; struct xpc_object_s base;

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_MACH_SEND_H_ #ifndef _XPC_OBJECTS_MACH_SEND_H_
#define _XPC_OBJECTS_MACH_SEND_H_ #define _XPC_OBJECTS_MACH_SEND_H_
#import <xpc/objects/base.h> #import <xpc/objects/base.h>
#import <mach/mach_port.h> #import <mach/mach_port.h>
XPC_IGNORE_DUPLICATE_PROTOCOL_PUSH;
XPC_CLASS_DECL(mach_send); XPC_CLASS_DECL(mach_send);
XPC_IGNORE_DUPLICATE_PROTOCOL_POP;
struct xpc_mach_send_s { struct xpc_mach_send_s {
struct xpc_object_s base; struct xpc_object_s base;

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_NULL_H_ #ifndef _XPC_OBJECTS_NULL_H_
#define _XPC_OBJECTS_NULL_H_ #define _XPC_OBJECTS_NULL_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_PIPE_H_ #ifndef _XPC_OBJECTS_PIPE_H_
#define _XPC_OBJECTS_PIPE_H_ #define _XPC_OBJECTS_PIPE_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_PLIST_BINARY_V0_DESERIALIZER_H_ #ifndef _XPC_OBJECTS_PLIST_BINARY_V0_DESERIALIZER_H_
#define _XPC_OBJECTS_PLIST_BINARY_V0_DESERIALIZER_H_ #define _XPC_OBJECTS_PLIST_BINARY_V0_DESERIALIZER_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_PLIST_XML_ELEMENT_H_ #ifndef _XPC_OBJECTS_PLIST_XML_ELEMENT_H_
#define _XPC_OBJECTS_PLIST_XML_ELEMENT_H_ #define _XPC_OBJECTS_PLIST_XML_ELEMENT_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_POINTER_H_ #ifndef _XPC_OBJECTS_POINTER_H_
#define _XPC_OBJECTS_POINTER_H_ #define _XPC_OBJECTS_POINTER_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_SERIALIZER_H_ #ifndef _XPC_OBJECTS_SERIALIZER_H_
#define _XPC_OBJECTS_SERIALIZER_H_ #define _XPC_OBJECTS_SERIALIZER_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_SERVICE_H_ #ifndef _XPC_OBJECTS_SERVICE_H_
#define _XPC_OBJECTS_SERVICE_H_ #define _XPC_OBJECTS_SERVICE_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_SERVICE_INSTANCE_H_ #ifndef _XPC_OBJECTS_SERVICE_INSTANCE_H_
#define _XPC_OBJECTS_SERVICE_INSTANCE_H_ #define _XPC_OBJECTS_SERVICE_INSTANCE_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_SHMEM_H_ #ifndef _XPC_OBJECTS_SHMEM_H_
#define _XPC_OBJECTS_SHMEM_H_ #define _XPC_OBJECTS_SHMEM_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_STRING_H_ #ifndef _XPC_OBJECTS_STRING_H_
#define _XPC_OBJECTS_STRING_H_ #define _XPC_OBJECTS_STRING_H_
@ -15,26 +34,26 @@ struct xpc_string_s {
@interface XPC_CLASS_INTERFACE(string) @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 // non-NSString property; length of the string in bytes, not including the null terminator
@property(readonly) NSUInteger byteLength; @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 // non-NSString method
+ (instancetype)stringWithUTF8String: (const char*)string byteLength: (NSUInteger)byteLength; + (instancetype)stringWithCString: (const char*)string byteLength: (NSUInteger)byteLength;
// non-NSString method // 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, ...; + (instancetype) XPC_PRINTF(1, 2) stringWithFormat: (const char*)format, ...;
// non-NSString method // non-NSString method
- (instancetype)initWithUTF8String: (const char*)string byteLength: (NSUInteger)byteLength; - (instancetype)initWithCString: (const char*)string byteLength: (NSUInteger)byteLength;
- (instancetype)initWithUTF8String: (const char*)string; - (instancetype)initWithCString: (const char*)string;
// non-NSString method // 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 // 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, 2) initWithFormat: (const char*)format, ...;
- (instancetype) XPC_PRINTF(1, 0) initWithFormat: (const char*)format arguments: (va_list)args; - (instancetype) XPC_PRINTF(1, 0) initWithFormat: (const char*)format arguments: (va_list)args;

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_UINT64_H_ #ifndef _XPC_OBJECTS_UINT64_H_
#define _XPC_OBJECTS_UINT64_H_ #define _XPC_OBJECTS_UINT64_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_OBJECTS_UUID_H_ #ifndef _XPC_OBJECTS_UUID_H_
#define _XPC_OBJECTS_UUID_H_ #define _XPC_OBJECTS_UUID_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_INTERNAL_PLIST_H_ #ifndef _XPC_INTERNAL_PLIST_H_
#define _XPC_INTERNAL_PLIST_H_ #define _XPC_INTERNAL_PLIST_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <os/object.h> #import <os/object.h>
#if __OBJC2__ #if __OBJC2__

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_UTIL_H_ #ifndef _XPC_UTIL_H_
#define _XPC_UTIL_H_ #define _XPC_UTIL_H_
@ -24,7 +43,7 @@
* @code * @code
* xpc_object_t some_input = get_some_input(); * xpc_object_t some_input = get_some_input();
* TO_OBJC_CHECKED(string, some_input, some_checked_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 { * } else {
* printf("Oh no, you messed up and gave me an object that wasn't a string :(\n"); * 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) \ #define TO_OBJC_CHECKED(className, origName, objcName) \
XPC_CLASS(className)* objcName = XPC_CAST(className, origName); \ 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. * 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) \ #define TO_OBJC_CHECKED_ON_FAIL(className, origName, objcName) \
XPC_CLASS(className)* objcName = XPC_CAST(className, origName); \ 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. * Special `retain` variant for collection classes like dictionaries and arrays.

View File

@ -1,5 +1,24 @@
#!/usr/bin/env python #!/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 <http://www.gnu.org/licenses/>.
#
import sys import sys
def to_padded_hex(value, hex_digits=2): def to_padded_hex(value, hex_digits=2):

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/activity.h> #import <xpc/objects/activity.h>
#import <xpc/objects/string.h> #import <xpc/objects/string.h>
#import <xpc/util.h> #import <xpc/util.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/array.h> #import <xpc/objects/array.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/private.h> #import <xpc/private.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/base.h> #import <xpc/objects/base.h>
#import <Foundation/NSZone.h> #import <Foundation/NSZone.h>
#import <Foundation/NSString.h> #import <Foundation/NSString.h>
@ -41,9 +60,10 @@ _Pragma("GCC diagnostic pop");
Class nsstring = objc_lookUpClass("NSString"); Class nsstring = objc_lookUpClass("NSString");
if (!nsstring) return nil; if (!nsstring) return nil;
char* desc = self.xpcDescription; char* desc = self.xpcDescription;
NSString* string = [nsstring stringWithUTF8String: desc]; return [[[nsstring alloc] initWithBytesNoCopy: desc
free(desc); length: strlen(desc)
return string; encoding: NSUTF8StringEncoding
freeWhenDone: YES] autorelease];
} }
- (BOOL)isEqual: (id)object - (BOOL)isEqual: (id)object

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/bool.h> #import <xpc/objects/bool.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/bundle.h> #import <xpc/objects/bundle.h>
#import <xpc/objects/string.h> #import <xpc/objects/string.h>
#import <xpc/objects/dictionary.h> #import <xpc/objects/dictionary.h>
@ -26,7 +45,7 @@ XPC_CLASS_HEADER(bundle);
if (!exec_path) { if (!exec_path) {
return NULL; 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 + (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). // 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. // the difference is just in whether it's directly in the root or in a `Contents` directory.
if (strcmp(path.pathExtension, "framework") == 0) { 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; return YES;
} }
} else { } 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; return YES;
} }
} }
@ -158,7 +177,7 @@ XPC_CLASS_HEADER(bundle);
- (XPC_CLASS(string)*)pathForResource: (const char*)name ofType: (const char*)type - (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 - (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]; result = [[[self.infoDictionary stringForKey: "NSExecutable"] retain] autorelease];
if (!result) { if (!result) {
// finally, if all else fails, try to use the same name as the bundle // 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 // cache the executable path
executableDirTmp = (self.isFramework) ? self.bundlePath : [self.bundlePath stringByAppendingPathComponent: "Contents/MacOS"]; 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 // resolve XPC services
this->services = [XPC_CLASS(array) new]; this->services = [XPC_CLASS(array) new];
xpcServicesDir = opendir(xpcServicesPath.UTF8String); xpcServicesDir = opendir(xpcServicesPath.CString);
if (xpcServicesDir) { if (xpcServicesDir) {
while ((xpcServiceDirent = readdir(xpcServicesDir))) { while ((xpcServiceDirent = readdir(xpcServicesDir))) {
@autoreleasepool { @autoreleasepool {
@ -246,11 +265,11 @@ XPC_CLASS_HEADER(bundle);
void* buffer = NULL; void* buffer = NULL;
xpc_object_t plist = 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 // no Info.plist; let's continue the resolution with an empty plist
plist = [XPC_CLASS(dictionary) new]; plist = [XPC_CLASS(dictionary) new];
} else { } else {
fd = open(self.infoPath.UTF8String, O_RDONLY); fd = open(self.infoPath.CString, O_RDONLY);
if (fd < 0) { if (fd < 0) {
self.error = xpc_bundle_error_failed_to_read_plist; self.error = xpc_bundle_error_failed_to_read_plist;
@ -291,7 +310,7 @@ XPC_CLASS_HEADER(bundle);
{ {
int fd = -1; 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 // no Info.plist; let's continue the resolution with an empty plist
callback = Block_copy(callback); callback = Block_copy(callback);
dispatch_async(resolutionQueue, ^{ dispatch_async(resolutionQueue, ^{
@ -304,7 +323,7 @@ XPC_CLASS_HEADER(bundle);
return; return;
} }
fd = open(self.infoPath.UTF8String, O_RDONLY); fd = open(self.infoPath.CString, O_RDONLY);
if (fd < 0) { if (fd < 0) {
self.error = xpc_bundle_error_failed_to_read_plist; 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) { TO_OBJC_CHECKED(bundle, xbundle, bundle) {
@autoreleasepool { @autoreleasepool {
XPC_CLASS(string)* path = [bundle pathForResource: name ofType: type]; XPC_CLASS(string)* path = [bundle pathForResource: name ofType: type];
return path ? strdup(path.UTF8String) : NULL; return path ? strdup(path.CString) : NULL;
} }
} }
return NULL; return NULL;
@ -356,14 +375,14 @@ xpc_object_t xpc_bundle_copy_services(xpc_object_t xbundle) {
XPC_EXPORT XPC_EXPORT
xpc_object_t xpc_bundle_create(const char* path, unsigned int flags) { xpc_object_t xpc_bundle_create(const char* path, unsigned int flags) {
@autoreleasepool { @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_EXPORT
xpc_object_t xpc_bundle_create_from_origin(unsigned int origin, const char* path) { xpc_object_t xpc_bundle_create_from_origin(unsigned int origin, const char* path) {
@autoreleasepool { @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 XPC_EXPORT
const char* xpc_bundle_get_executable_path(xpc_object_t xbundle) { const char* xpc_bundle_get_executable_path(xpc_object_t xbundle) {
TO_OBJC_CHECKED(bundle, xbundle, bundle) { TO_OBJC_CHECKED(bundle, xbundle, bundle) {
return bundle.executablePath.UTF8String; return bundle.executablePath.CString;
} }
return NULL; return NULL;
}; };
@ -401,7 +420,7 @@ xpc_object_t xpc_bundle_get_info_dictionary(xpc_object_t xbundle) {
XPC_EXPORT XPC_EXPORT
const char* xpc_bundle_get_path(xpc_object_t xbundle) { const char* xpc_bundle_get_path(xpc_object_t xbundle) {
TO_OBJC_CHECKED(bundle, xbundle, bundle) { TO_OBJC_CHECKED(bundle, xbundle, bundle) {
return bundle.bundlePath.UTF8String; return bundle.bundlePath.CString;
} }
return NULL; return NULL;
}; };

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/xpc.h> #import <xpc/xpc.h>
#import <xpc/util.h> #import <xpc/util.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/connection.h> #import <xpc/objects/connection.h>
#import <xpc/objects/dictionary.h> #import <xpc/objects/dictionary.h>
#import <xpc/objects/endpoint.h> #import <xpc/objects/endpoint.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/data.h> #import <xpc/objects/data.h>
#import <xpc/util.h> #import <xpc/util.h>
#define __DISPATCH_INDIRECT__ #define __DISPATCH_INDIRECT__

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/date.h> #import <xpc/objects/date.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/dictionary.h> #import <xpc/objects/dictionary.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/private.h> #import <xpc/private.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/double.h> #import <xpc/objects/double.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/endpoint.h> #import <xpc/objects/endpoint.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/error.h> #import <xpc/objects/error.h>
#import <xpc/objects/string.h> #import <xpc/objects/string.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>
@ -57,7 +76,7 @@ XPC_CLASS_HEADER(error);
- (char*)xpcDescription - (char*)xpcDescription
{ {
char* output = NULL; 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; return output;
} }

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/xpc.h> #import <xpc/xpc.h>
#import <xpc/util.h> #import <xpc/util.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/fd.h> #import <xpc/objects/fd.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/file_transfer.h> #import <xpc/objects/file_transfer.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>
#import <xpc/util.h> #import <xpc/util.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/xpc.h> #import <xpc/xpc.h>
void xpc_stub_init(void); void xpc_stub_init(void);

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/int64.h> #import <xpc/objects/int64.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/xpc.h> #import <xpc/xpc.h>
#import <launch.h> #import <launch.h>
#import <xpc/util.h> #import <xpc/util.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/mach_recv.h> #import <xpc/objects/mach_recv.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>
#import <xpc/util.h> #import <xpc/util.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/mach_send.h> #import <xpc/objects/mach_send.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>
#import <xpc/util.h> #import <xpc/util.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/xpc.h> #import <xpc/xpc.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <mach-o/dyld_priv.h> #import <mach-o/dyld_priv.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/null.h> #import <xpc/objects/null.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/pipe.h> #import <xpc/objects/pipe.h>
#import <xpc/objects/dictionary.h> #import <xpc/objects/dictionary.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/plist.h> #import <xpc/plist.h>
#import <xpc/objects/string.h> #import <xpc/objects/string.h>
#import <xpc/objects/dictionary.h> #import <xpc/objects/dictionary.h>
@ -276,7 +295,7 @@ XPC_CLASS_HEADER(plist_xml_element);
dispatch_data_t dispatchData = NULL; dispatch_data_t dispatchData = NULL;
XPC_CLASS(data)* xpcData = nil; 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) { if (!temp) {
goto data_error; 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; // 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) // 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) { if (time.tm_year > 0) {
time.tm_year -= 1900; time.tm_year -= 1900;
} }
@ -330,14 +349,14 @@ XPC_CLASS_HEADER(plist_xml_element);
case xpc_plist_xml_element_type_real: { case xpc_plist_xml_element_type_real: {
XPC_CLASS(string)* string = XPC_CAST(string, this->object); XPC_CLASS(string)* string = XPC_CAST(string, this->object);
double value = atof(string.UTF8String); double value = atof(string.CString);
[this->object release]; [this->object release];
this->object = [[XPC_CLASS(double) alloc] initWithValue: value]; this->object = [[XPC_CLASS(double) alloc] initWithValue: value];
} break; } break;
case xpc_plist_xml_element_type_integer: { case xpc_plist_xml_element_type_integer: {
XPC_CLASS(string)* string = XPC_CAST(string, this->object); 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 release];
this->object = [[XPC_CLASS(int64) alloc] initWithValue: value]; this->object = [[XPC_CLASS(int64) alloc] initWithValue: value];
} break; } break;
@ -387,7 +406,7 @@ handover_to_parent:
self.cache = XPC_CAST(string, child.object); self.cache = XPC_CAST(string, child.object);
} else { } else {
xpc_assert(self.cache); 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; self.cache = nil;
} }
} break; } break;
@ -847,7 +866,7 @@ XPC_CLASS_HEADER(plist_binary_v0_deserializer);
if (length == NSUIntegerMax) { if (length == NSUIntegerMax) {
return nil; 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 - (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); data = dispatch_data_create(bytes, length, NULL, DISPATCH_DATA_DESTRUCTOR_NONE);
// how nice of them to have something specifically for this purpose :) // 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); 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]; [transformed release];
[data release]; [data release];
@ -950,7 +969,7 @@ XPC_CLASS_HEADER(plist_binary_v0_deserializer);
XPC_CLASS(object)* key = [self readObject: keyReferenceNumber]; XPC_CLASS(object)* key = [self readObject: keyReferenceNumber];
XPC_CLASS(object)* value = [self readObject: valueReferenceNumber]; XPC_CLASS(object)* value = [self readObject: valueReferenceNumber];
TO_OBJC_CHECKED(string, key, keyString) { TO_OBJC_CHECKED(string, key, keyString) {
[result setObject: value forKey: keyString.UTF8String]; [result setObject: value forKey: keyString.CString];
} }
[key release]; [key release];
[value release]; [value release];

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/pointer.h> #import <xpc/objects/pointer.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <reboot2.h> #import <reboot2.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/xpc.h> #import <xpc/xpc.h>
#import <xpc/util.h> #import <xpc/util.h>
@ -90,7 +109,7 @@ void xpc_main(xpc_connection_handler_t handler) {
xpc_abort("failed to determine main bundle identifier"); 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) { if (!server) {
xpc_abort("failed to create server connection"); xpc_abort("failed to create server connection");
} }
@ -115,7 +134,7 @@ void xpc_main(xpc_connection_handler_t handler) {
[server activate]; [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) { switch (runloopType) {
case xpc_service_runloop_type_dispatch: { case xpc_service_runloop_type_dispatch: {

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/service.h> #import <xpc/objects/service.h>
#import <xpc/objects/service_instance.h> #import <xpc/objects/service_instance.h>
#import <xpc/util.h> #import <xpc/util.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/service_instance.h> #import <xpc/objects/service_instance.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>
#import <xpc/endpoint.h> #import <xpc/endpoint.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/shmem.h> #import <xpc/objects/shmem.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/string.h> #import <xpc/objects/string.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>
@ -10,19 +29,19 @@ OS_OBJECT_NONLAZY_CLASS
XPC_CLASS_HEADER(string); 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, ... + (instancetype)stringWithFormat: (const char*)format, ...
@ -46,8 +65,8 @@ XPC_CLASS_HEADER(string);
- (char*)xpcDescription - (char*)xpcDescription
{ {
char* output = NULL; char* output = NULL;
if (self.UTF8String) { if (self.CString) {
asprintf(&output, "<%s: %s>", xpc_class_name(self), self.UTF8String); asprintf(&output, "<%s: %s>", xpc_class_name(self), self.CString);
} else { } else {
asprintf(&output, "<%s: NULL>", xpc_class_name(self)); asprintf(&output, "<%s: NULL>", xpc_class_name(self));
} }
@ -63,7 +82,7 @@ XPC_CLASS_HEADER(string);
return this->byteLength; return this->byteLength;
} }
- (const char*)UTF8String - (const char*)CString
{ {
XPC_THIS_DECL(string); XPC_THIS_DECL(string);
return this->string; return this->string;
@ -71,10 +90,10 @@ XPC_CLASS_HEADER(string);
- (instancetype)init - (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]) { if (self = [super init]) {
XPC_THIS_DECL(string); XPC_THIS_DECL(string);
@ -93,12 +112,12 @@ XPC_CLASS_HEADER(string);
return self; 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]) { if (self = [super init]) {
XPC_THIS_DECL(string); XPC_THIS_DECL(string);
@ -110,9 +129,9 @@ XPC_CLASS_HEADER(string);
return self; 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, ... - (instancetype)initWithFormat: (const char*)format, ...
@ -166,7 +185,7 @@ XPC_CLASS_HEADER(string);
- (instancetype)forceCopy - (instancetype)forceCopy
{ {
return [[[self class] alloc] initWithUTF8String: self.UTF8String]; return [[[self class] alloc] initWithCString: self.CString];
} }
- (void)appendString: (const char*)string length: (NSUInteger)extraByteLength - (void)appendString: (const char*)string length: (NSUInteger)extraByteLength
@ -199,12 +218,12 @@ XPC_CLASS_HEADER(string);
- (XPC_CLASS(string)*)stringByAppendingString: (const char*)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 - (BOOL)isEqualToString: (const char*)string
{ {
return strcmp(self.UTF8String, string) == 0; return strcmp(self.CString, string) == 0;
} }
@end @end
@ -245,7 +264,7 @@ XPC_CLASS_HEADER(string);
// maybe we should check if the string length matches the reported length // 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; return result;
@ -266,7 +285,7 @@ error_out:
goto error_out; goto error_out;
} }
if (![serializer writeString: self.UTF8String]) { if (![serializer writeString: self.CString]) {
goto error_out; goto error_out;
} }
@ -282,53 +301,53 @@ error_out:
- (const char*)pathExtension - (const char*)pathExtension
{ {
char* lastDot = strrchr(self.UTF8String, '.'); char* lastDot = strrchr(self.CString, '.');
return lastDot ? lastDot + 1 : ""; return lastDot ? lastDot + 1 : "";
} }
- (const char*)lastPathComponent - (const char*)lastPathComponent
{ {
char* lastSlash = strrchr(self.UTF8String, '/'); char* lastSlash = strrchr(self.CString, '/');
return lastSlash ? lastSlash + 1 : ""; return lastSlash ? lastSlash + 1 : "";
} }
- (XPC_CLASS(string)*)stringByDeletingPathExtension - (XPC_CLASS(string)*)stringByDeletingPathExtension
{ {
char* lastDot = strrchr(self.UTF8String, '.'); char* lastDot = strrchr(self.CString, '.');
return (lastDot) ? [[self class] stringWithUTF8String: self.UTF8String byteLength: lastDot - self.UTF8String] : [self forceCopy]; return (lastDot) ? [[self class] stringWithCString: self.CString byteLength: lastDot - self.CString] : [self forceCopy];
} }
- (XPC_CLASS(string)*)stringByResolvingSymlinksInPath - (XPC_CLASS(string)*)stringByResolvingSymlinksInPath
{ {
char* resolved = realpath(self.UTF8String, NULL); char* resolved = realpath(self.CString, NULL);
return resolved ? [[self class] stringWithUTF8StringNoCopy: resolved freeWhenDone: YES] : nil; return resolved ? [[self class] stringWithCStringNoCopy: resolved freeWhenDone: YES] : nil;
} }
- (XPC_CLASS(string)*)stringByAppendingPathComponent: (const char*)component - (XPC_CLASS(string)*)stringByAppendingPathComponent: (const char*)component
{ {
if (self.byteLength == 0) { if (self.byteLength == 0) {
return [[self class] stringWithUTF8String: component]; return [[self class] stringWithCString: component];
} else if (self.UTF8String[self.byteLength - 1] == '/') { } else if (self.CString[self.byteLength - 1] == '/') {
return [self stringByAppendingString: component]; return [self stringByAppendingString: component];
} else { } else {
return [[self class] stringWithFormat: "%s/%s", self.UTF8String, component]; return [[self class] stringWithFormat: "%s/%s", self.CString, component];
} }
} }
- (XPC_CLASS(string)*)stringByDeletingLastPathComponent - (XPC_CLASS(string)*)stringByDeletingLastPathComponent
{ {
char* lastSlash = strrchr(self.UTF8String, '/'); char* lastSlash = strrchr(self.CString, '/');
if (lastSlash && lastSlash > self.UTF8String) { if (lastSlash && lastSlash > self.CString) {
*lastSlash = '\0'; // temporarily shorten the string for the copy... *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 *lastSlash = '/'; // ...and then restore it
return result; return result;
} else if (lastSlash == self.UTF8String) { } else if (lastSlash == self.CString) {
// if it's the one for the root, return the root // if it's the one for the root, return the root
return [[self class] stringWithUTF8String: "/"]; return [[self class] stringWithCString: "/"];
} else { } else {
// otherwise, if it's not present, return an empty string // 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_EXPORT
xpc_object_t xpc_string_create(const char* string) { 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 XPC_EXPORT
@ -368,7 +387,7 @@ size_t xpc_string_get_length(xpc_object_t xstring) {
XPC_EXPORT XPC_EXPORT
const char* xpc_string_get_string_ptr(xpc_object_t xstring) { const char* xpc_string_get_string_ptr(xpc_object_t xstring) {
TO_OBJC_CHECKED(string, xstring, string) { TO_OBJC_CHECKED(string, xstring, string) {
return string.UTF8String; return string.CString;
} }
return NULL; return NULL;
}; };
@ -386,5 +405,5 @@ void _xpc_string_set_value(xpc_object_t xstring, const char* new_string) {
XPC_EXPORT XPC_EXPORT
xpc_object_t xpc_string_create_no_copy(const char* string) { 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];
}; };

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include <os/transaction_private.h> #include <os/transaction_private.h>
#include <os/object_private.h> #include <os/object_private.h>
#import <Foundation/NSZone.h> #import <Foundation/NSZone.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/xpc.h> #import <xpc/xpc.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <objc/runtime.h> #import <objc/runtime.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/uint64.h> #import <xpc/objects/uint64.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/util.h> #import <xpc/util.h>
#import <objc/runtime.h> #import <objc/runtime.h>
#import <xpc/serialization.h> #import <xpc/serialization.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#import <xpc/objects/uuid.h> #import <xpc/objects/uuid.h>
#import <xpc/util.h> #import <xpc/util.h>
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include "ctest-plus.h" #include "ctest-plus.h"
#include <xpc/private.h> #include <xpc/private.h>
#include "test-util.h" #include "test-util.h"

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include "ctest-plus.h" #include "ctest-plus.h"
#import <xpc/xpc.h> #import <xpc/xpc.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include "ctest-plus.h" #include "ctest-plus.h"
#include <xpc/private.h> #include <xpc/private.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include "ctest-plus.h" #include "ctest-plus.h"
#include <xpc/private.h> #include <xpc/private.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include <xpc/xpc.h> #include <xpc/xpc.h>
#include <xpc/connection.h> #include <xpc/connection.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _CTEST_PLUS_H_ #ifndef _CTEST_PLUS_H_
#define _CTEST_PLUS_H_ #define _CTEST_PLUS_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include "ctest-plus.h" #include "ctest-plus.h"
#include <xpc/private.h> #include <xpc/private.h>
#include "test-util.h" #include "test-util.h"

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include "ctest-plus.h" #include "ctest-plus.h"
#include <xpc/private.h> #include <xpc/private.h>
#include "test-util.h" #include "test-util.h"

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include <xpc/xpc.h> #include <xpc/xpc.h>
#include <xpc/connection.h> #include <xpc/connection.h>
#include <xpc/endpoint.h> #include <xpc/endpoint.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_TEST_LAUNCHD_SERVICE_CLIENT_COMMON_H_ #ifndef _XPC_TEST_LAUNCHD_SERVICE_CLIENT_COMMON_H_
#define _XPC_TEST_LAUNCHD_SERVICE_CLIENT_COMMON_H_ #define _XPC_TEST_LAUNCHD_SERVICE_CLIENT_COMMON_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include <xpc/xpc.h> #include <xpc/xpc.h>
#include <xpc/endpoint.h> #include <xpc/endpoint.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include <xpc/xpc.h> #include <xpc/xpc.h>
#include <xpc/connection.h> #include <xpc/connection.h>
#include <stdio.h> #include <stdio.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_TEST_LAUNCHD_SERVICE_SERVER_COMMON_H_ #ifndef _XPC_TEST_LAUNCHD_SERVICE_SERVER_COMMON_H_
#define _XPC_TEST_LAUNCHD_SERVICE_SERVER_COMMON_H_ #define _XPC_TEST_LAUNCHD_SERVICE_SERVER_COMMON_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _XPC_TEST_LAUNCHD_SERVICE_SERVICE_H_ #ifndef _XPC_TEST_LAUNCHD_SERVICE_SERVICE_H_
#define _XPC_TEST_LAUNCHD_SERVICE_SERVICE_H_ #define _XPC_TEST_LAUNCHD_SERVICE_SERVICE_H_

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#define CTEST_MAIN #define CTEST_MAIN
// uncomment lines below to enable/disable features. See README.md for details // uncomment lines below to enable/disable features. See README.md for details

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include "ctest-plus.h" #include "ctest-plus.h"
#include <xpc/private.h> #include <xpc/private.h>

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include "ctest-plus.h" #include "ctest-plus.h"
#include <xpc/private.h> #include <xpc/private.h>

Some files were not shown because too many files have changed in this diff Show More