This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if os(Linux) | |
import Foundation | |
import Dispatch | |
#else | |
import Foundation.NSProgress | |
#endif | |
private func _when<T>(_ promises: [Promise<T>]) -> Promise<Void> { | |
// root为类型PendingTuple的变量。参考Promise.swift中对class func pending()的注解。 | |
// 类型PendingTuple的定义如下: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import class Dispatch.DispatchQueue | |
import func Foundation.NSLog | |
// Seal<T>代表某个Promise<T>的状态:pending, 尚未解决 ; resolved, 已解答/已解决。 | |
enum Seal<T> { | |
case pending(Handlers<T>) | |
case resolved(Resolution<T>) | |
} | |
// Resolution<T>代表某个Promise<T>的解答结果:fulfilled,已被完成;rejected,被拒绝。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
* | |
* @APPLE_LICENSE_HEADER_START@ | |
* | |
* The contents of this file constitute Original Code as defined in and | |
* are subject to the Apple Public Source License Version 1.1 (the | |
* "License"). You may not use this file except in compliance with the | |
* License. Please obtain a copy of the License at | |
* http://www.apple.com/publicsource and read it before using this file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
* | |
* @APPLE_LICENSE_HEADER_START@ | |
* | |
* The contents of this file constitute Original Code as defined in and | |
* are subject to the Apple Public Source License Version 1.1 (the | |
* "License"). You may not use this file except in compliance with the | |
* License. Please obtain a copy of the License at | |
* http://www.apple.com/publicsource and read it before using this file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int | |
rtrequest(req, dst, gateway, netmask, flags, ret_nrt) | |
int req, flags; | |
struct sockaddr *dst, *gateway, *netmask; | |
struct rtentry **ret_nrt; | |
{ | |
int s = splnet(); int error = 0; // splnet() | |
register struct rtentry *rt; | |
register struct radix_node *rn; | |
register struct radix_node_head *rnh; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* $NetBSD: mkarp.c,v 1.2.2.1 2000/02/12 16:49:38 he Exp $ */ | |
/* | |
* Copyright (c) 1984, 1993 | |
* The Regents of the University of California. All rights reserved. | |
* | |
* This code is derived from software contributed to Berkeley by | |
* Sun Microsystems, Inc. | |
* | |
* Redistribution and use in source and binary forms, with or without |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int | |
arp_flush(int s, int all, int if_index) | |
{ | |
char * buf; | |
char * lim; | |
int mib[6]; | |
size_t needed; | |
char * next; | |
struct rt_msghdr * rtm; // https://www.freebsd.org/cgi/man.cgi?query=route&sektion=4&manpath=NetBSD+7.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
from __future__ import print_function | |
import os | |
import optparse | |
###### | |
# Delete the macros that is not in SYMBOLS_FILE from HEADER_FILE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
from __future__ import print_function | |
import os | |
import re | |
import optparse | |
###### | |
# Parsing the output of nm command(nm -o -U -p -j libXXX.a). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# General build options | |
WORKSPACE=YourApplicationWorkspace.xcworkspace | |
# PROJECT=YourApplicationProject.xcodeproj | |
SCHEME=YourApplicationScheme | |
CONFIGURATION=Release | |
#SDK=10.0 |
NewerOlder