.TH DSSH 1 "November, 2015"
.SH NAME
.NM dssh
.ND Distributed SSH Tool
.SH SYNOPSIS
.B dssh
[-cpq] [\-f host_file...] [-l host-list...] [-o ssh_opts] [-u username] [-t
max_threads] command
.SH DESCRIPTION
...
.SH AUTHOR
Matthew Malensek
.SH HOMEPAGE
http://matthew.malensek.net/projects/terminibbles
.SH LICENSE
This software is released under the 2-Clause BSD License.  See LICENSE file for
details.

Add options to man page

.TH DSSH 1 "February, 2015"
.SH NAME
.NM dssh
.ND Distributed SSH Tool
.SH SYNOPSIS
.B dssh
[-cpq] [\-f host_file...] [-l host-list...] [-o ssh_opts] [-u username] [-t
max_threads] command
.SH DESCRIPTION
...
.TP
.I "\-a"
.TP
.I "\-A"
.TP
.I "\-c"
.TP
.I "\-i" id_file
.TP
.I "\-o" ssh_opts
.TP
.I "\-p"
.TP
.I "\-q"
.TP
.I "\-u" username
.TP
.I "\-s" timeout
.TP
.I "\-t" num_threads
.SH AUTHOR
Matthew Malensek
.SH HOMEPAGE
http://matthew.malensek.net/projects/terminibbles
.SH LICENSE
This software is released under the 2-Clause BSD License.  See LICENSE file for
details.


source "https://rubygems.org"

gem 'nokogiri', '~>1.5.11'
gem 'mime-types', '~>1.16'

group :development, :test do
  # This is here because gemspec doesn't support require: false
  gem 'coveralls', :require => false
  gem 'rake', '~> 10.1.0'
end

gemspec

Fix reference to fog's gemspec

source "https://rubygems.org"

gem 'nokogiri', '~>1.5.11'
gem 'mime-types', '~>1.16'

group :development, :test do
  # This is here because gemspec doesn't support require: false
  gem 'coveralls', :require => false
  gem 'rake', '~> 10.1.0'
end

gemspec :path => "../"


We are getting close to creating the 1.6.x branch.  This file lists the tasks
we want to complete before branching.  "Blocker" tasks must be done before we
branch, while "optional" tasks would be nice to have completed, but aren't
essential.

Tasks which need to happen before the 1.6.0 release, but aren't related to when
we branch should be put in the issue tracker with the 1.6 milestone.

Blocker:

 * Properly wrap BDB rep-sharing code for use in pre-1.6 FS formats, as
   noted by cmpilato here: http://svn.haxx.se/dev/archive-2008-10/0968.shtml
   [STATUS:  cmpilato is on this]

 * Add 'svnadmin --pre-1.6-compatible', or preferably something more
   generic (--compatible-with=X.Y or somesuch).

Optional:

 * Merge the sparse-directories deselection branch, as noted by kfogel:
   http://svn.haxx.se/dev/archive-2008-10/1001.shtml

 * Secure certificate passphrase caching on Windows, to bring it upto the
   same level as the other password stores. (Issue 2489)

Remove a TODO item, and add another.

We are getting close to creating the 1.6.x branch.  This file lists the tasks
we want to complete before branching.  "Blocker" tasks must be done before we
branch, while "optional" tasks would be nice to have completed, but aren't
essential.

Tasks which need to happen before the 1.6.0 release, but aren't related to when
we branch should be put in the issue tracker with the 1.6 milestone.

Blocker:

 * Lose the FSGUIDs BDB stuff, and use a unique key specific to the
   checksum-reps table.  (It was a fine idea, but cmpilato worries
   about the additional contention if we move toward a universal
   source of uniqueness.)  This also will simply some of the
   rep-sharing format-conditional logic.

 * Add 'svnadmin --pre-1.6-compatible', or preferably something more
   generic (--compatible-with=X.Y or somesuch).

Optional:

 * Merge the sparse-directories deselection branch, as noted by kfogel:
   http://svn.haxx.se/dev/archive-2008-10/1001.shtml

 * Secure certificate passphrase caching on Windows, to bring it upto the
   same level as the other password stores. (Issue 2489)


.\" $Id: libssh2_channel_set_blocking.3,v 1.2 2007/06/13 12:51:10 jehousley Exp $
.\"
.TH libssh2_channel_set_blocking 3 "14 Dec 2006" "libssh2 0.15" "libssh2 manual"
.SH NAME
libssh2_channel_set_blocking - set or clear blocking mode on channel
.SH SYNOPSIS
#include <libssh2.h>

void libssh2_channel_set_blocking(LIBSSH2_CHANNEL *channel, int blocking);
.SH DESCRIPTION
Set or clear blocking mode on the selected channel. If a read is performed on
a channel with no data currently available, a blocking channel will wait for
data to arrive and return what it receives. A non-blocking channel will return
immediately with an empty buffer.

\fIchannel\fP - channel stream to set or clean blocking status on.

\fIblocking\fP - Set to a non-zero value to make the channel block, or zero to
make it non-blocking.
.SH RETURN VALUE
None
.SH SEE ALSO
.BI libssh2_channel_read_ex(3)

Update to match current code and add errors

.\" $Id: libssh2_channel_set_blocking.3,v 1.3 2007/06/13 13:15:57 jehousley Exp $
.\"
.TH libssh2_channel_set_blocking 3 "1 June 2007" "libssh2 0.15" "libssh2 manual"
.SH NAME
libssh2_channel_set_blocking - set or clear blocking mode on channel
.SH SYNOPSIS
#include <libssh2.h>

void
libssh2_channel_set_blocking(LIBSSH2_CHANNEL *channel, int blocking);

.SH DESCRIPTION
Set or clear blocking mode on the selected channel. If a read is performed on
a channel with no data currently available, a blocking channel will wait for
data to arrive and return what it receives. A non-blocking channel will return
immediately with an empty buffer.  If a write is performed on a channel with
no room for more data, a blocking channel will wait for room.  A non-blocking
channel will return immediately without writing anything.

\fIchannel\fP - channel stream to set or clean blocking status on.

\fIblocking\fP - Set to a non-zero value to make the channel block, or zero to
make it non-blocking.
.SH RETURN VALUE
None
.SH SEE ALSO
.BR libssh2_channel_read_ex(3)
.BR libssh2_channel_write_ex(3)


source 'https://rubygems.org'
gemspec :path => '../'

gem 'rails', '~> 3.2.0'
gem 'minitest', '~> 4.0'

Add test-unit to Ruby 2.2's gemfiles

source 'https://rubygems.org'
gemspec :path => '../'

gem 'rails', '~> 3.2.0'
gem 'minitest', '~> 4.0'
gem 'test-unit', '~> 3.0'


.TH mumble\-overlay 1 "2008 January 07"
.SH NAME
mumble\-overlay \- load OpenGL overlay for Mumble.
.SH SYNOPSIS
.B mumble\-overlay
.RI "executable"
.SH DESCRIPTION
This wrapper will load the OpenGL overlay for Mumble into the application
of your choice. This allows you to easily see who is talking even in
fullscreen games and applications.
.PP
Nothing will be shown unless you have Mumble running and it is
currently connected to a server.
.SH ENVIRONMENT VARIABLES
.TP
.B MUMBLE_OVERLAY_DEBUG
If this environment variable is set, extended debugging will be output to
standard output. Only usefull for debugging.
.SH EXAMPLE
To run glxgears with the mumble\-overlay active:
.IP
mumble\-overlay glxgears
.SH NOTES
This will only work with OpenGL drivers which support the full
OpenGL and GLX specifications.
.SH SEE ALSO
.BR mumble (1),
.BR murmurd (1).
.SH AUTHOR
mumble and murmurd was written by Thorvald Natvig
<slicer@users.sourceforge.net>.

Patch 1930045: Man page spelling error

.TH mumble\-overlay 1 "2008 January 07"
.SH NAME
mumble\-overlay \- load OpenGL overlay for Mumble.
.SH SYNOPSIS
.B mumble\-overlay
.RI "executable"
.SH DESCRIPTION
This wrapper will load the OpenGL overlay for Mumble into the application
of your choice. This allows you to easily see who is talking even in
fullscreen games and applications.
.PP
Nothing will be shown unless you have Mumble running and it is
currently connected to a server.
.SH ENVIRONMENT VARIABLES
.TP
.B MUMBLE_OVERLAY_DEBUG
If this environment variable is set, extended debugging will be output to
standard output. Only useful for debugging.
.SH EXAMPLE
To run glxgears with the mumble\-overlay active:
.IP
mumble\-overlay glxgears
.SH NOTES
This will only work with OpenGL drivers which support the full
OpenGL and GLX specifications.
.SH SEE ALSO
.BR mumble (1),
.BR murmurd (1).
.SH AUTHOR
mumble and murmurd was written by Thorvald Natvig
<slicer@users.sourceforge.net>.


.TH DSSH 1 "February, 2015"
.SH NAME
.NM dssh
.ND Distributed SSH Tool
.SH SYNOPSIS
.B dssh
[-aAcpq] [\-f\ host_file...] [\-i\ id_file] [\-l\ host-list...] [\-o\ ssh_opts]
[\-u\ username] [\-s\ timeout] [-t\ max_threads] command
.SH DESCRIPTION
...
.TP
.I "\-a"
.TP
.I "\-A"
.TP
.I "\-c"
.TP
.I "\-i" id_file
.TP
.I "\-o" ssh_opts
.TP
.I "\-p"
.TP
.I "\-q"
.TP
.I "\-u" username
.TP
.I "\-s" timeout
.TP
.I "\-t" num_threads
.SH AUTHOR
Matthew Malensek <matt@malensek.net>
.SH HOMEPAGE
http://matthew.malensek.net
.SH LICENSE
This software is released under the 2-Clause BSD License.  See LICENSE.txt file for details.

Change title to conform with linux standards

.TH DSSH 1 "2016-02-21" "" "User Commands"
.SH NAME
.NM dssh
.ND Distributed SSH Tool
.SH SYNOPSIS
.B dssh
[-aAcpq] [\-f\ host_file...] [\-i\ id_file] [\-l\ host-list...] [\-o\ ssh_opts]
[\-u\ username] [\-s\ timeout] [-t\ max_threads] command
.SH DESCRIPTION
...
.TP
.I "\-a"
.TP
.I "\-A"
.TP
.I "\-c"
.TP
.I "\-i" id_file
.TP
.I "\-o" ssh_opts
.TP
.I "\-p"
.TP
.I "\-q"
.TP
.I "\-u" username
.TP
.I "\-s" timeout
.TP
.I "\-t" num_threads
.SH AUTHOR
Matthew Malensek <matt@malensek.net>
.SH HOMEPAGE
http://matthew.malensek.net
.SH LICENSE
This software is released under the 2-Clause BSD License.  See LICENSE.txt file for details.


FROM alpine:3.6
MAINTAINER Dmitrii Kuzmenkov <dmitrii@kuzmenkov.me>

ENV build_deps="autoconf automake build-base libtool db-dev boost-dev openssl-dev libevent-dev"
RUN apk add --update curl $build_deps && \
  curl -sSL https://github.com/bitcoin/bitcoin/archive/v0.14.1.tar.gz | tar -xzf - && \
  cd bitcoin-0.14.1 && ./autogen.sh && \
  ./configure --prefix=/usr --with-incompatible-bdb && \
  make && make install && \
  apk del $build_deps && rm -fr /var/cache/apk

ENTRYPOINT bitcoind

Fix symbol not found issue in Dockerfile for bitcoin

FROM alpine:3.6
MAINTAINER Dmitrii Kuzmenkov <dmitrii@kuzmenkov.me>

ENV build_deps="autoconf automake build-base"
ENV lib_deps="libtool db-dev boost-dev openssl-dev libevent-dev"
RUN apk add --update curl $build_deps $lib_deps && \
  curl -sSL https://github.com/bitcoin/bitcoin/archive/v0.14.1.tar.gz | tar -xzf - && \
  cd bitcoin-0.14.1 && ./autogen.sh && \
  ./configure --prefix=/usr --with-incompatible-bdb && \
  make && make install && \
  apk del $build_deps && rm -fr /var/cache/apk

ENTRYPOINT bitcoind


.\" This Source Code Form is subject to the terms of the Mozilla Public
.\" License, v. 2.0. If a copy of the MPL was not distributed with this
.\" file, You can obtain one at http://mozilla.org/MPL/2.0/.
.\"
.\" Copyright (c) 2016-2018 David Jackson
.Dd July 5, 2016
.Dt CYTO 1
.Os
.Sh NAME
.Nm cyto
.Nd simple static site generator
.Sh SYNOPSIS
.Nm
.Op Ar command
.Sh DESCRIPTION
Generate static websites from a collection of template files.
.Ss FLAGS
The following are flags that can be set:
.Bl -tag -width Ds
.It Fl h print help message
.It Fl V print version number
.It Fl j Ar num_worker_threads
Set the number of worker threads.
These threads are used to process the files
in parallel.
.El
.Ss COMMANDS
The available
commands are:
.Bl -tag -width Ds
.It cyto init Ar project
Create a directory named for
.Ar project
and initialize a Cytogen project within it.
.It cyto generate
Within a cytogen project directory, generate the static site to a directory
called _site.
.It cyto clean
Clean up the generated site, i.e. remove the _site directory
.It cyto serve
Within a cytogen-generated-site tree (i.e. the _site directory), serve the site
with a local HTTP server.
.El
.Sh SEE ALSO
.Xr ctache 1
.Xr cytogen 1

Fix a man page flag-formatting issue


mkdir /tmp/libgd
cd /tmp/libgd
wget 'https://github.com/libgd/libgd/archive/gd-2.1.1.tar.gz'
tar xvzf tar xvzf gd-2.1.1.tar.gz
cd libgd-gd-2.1.1
mkdir build
cd build
cmake ..  -DCMAKE_INSTALL_PREFIX=/cvmfs/oasis.opensciencegrid.org/osg/modules/gd/2.1.1
make
make install

Use bootstrap/configure/make instead of cmake

mkdir /tmp/libgd
cd /tmp/libgd
wget 'https://github.com/libgd/libgd/archive/gd-2.1.1.tar.gz'
tar xvzf tar xvzf gd-2.1.1.tar.gz
cd libgd-gd-2.1.1
./bootstrap.sh
./configure --prefix=/cvmfs/oasis.opensciencegrid.org/osg/modules/gd/2.1.1
make
make install


.\" Man page for apropos an whatis
.\"
.\" Copyright (c) 1990, 1991, John W. Eaton.
.\"
.\" You may distribute under the terms of the GNU General Public
.\" License as specified in the README file that comes with the man 1.0
.\" distribution.
.\"
.\" John W. Eaton
.\" jwe@che.utexas.edu
.\" Department of Chemical Engineering
.\" The University of Texas at Austin
.\" Austin, Texas  78712
.\"
.\" $FreeBSD$
.Dd January 15, 1991
.Dt APROPOS 1
.Os
.Sh NAME
.Nm apropos ,
.Nm whatis
.Nd search the whatis database
.Sh SYNOPSIS
.Nm apropos
.Ar keyword ...
.Nm whatis
.Ar keyword ...
.Sh DESCRIPTION
.Nm
searches a set of database files containing short descriptions
of system commands for keywords and displays the result on the
standard output.
.Nm whatis
displays only complete word matches.
.Pp
.Ar keyword
really is a regular expression, please read grep(1) manual page for
more information about its format.
.Sh RETURN VALUES
The
.Nm
utility exits 0 on success, and 1 if no keyword matched.
.Sh SEE ALSO
.Xr makewhatis 1 ,
.Xr man 1

RETURN VALUES is for sections 2, 3 and 9, but here in section 1 man page, DIAGNOSTICS should be used instead.

.\" Man page for apropos an whatis
.\"
.\" Copyright (c) 1990, 1991, John W. Eaton.
.\"
.\" You may distribute under the terms of the GNU General Public
.\" License as specified in the README file that comes with the man 1.0
.\" distribution.
.\"
.\" John W. Eaton
.\" jwe@che.utexas.edu
.\" Department of Chemical Engineering
.\" The University of Texas at Austin
.\" Austin, Texas  78712
.\"
.\" $FreeBSD$
.Dd January 15, 1991
.Dt APROPOS 1
.Os
.Sh NAME
.Nm apropos ,
.Nm whatis
.Nd search the whatis database
.Sh SYNOPSIS
.Nm apropos
.Ar keyword ...
.Nm whatis
.Ar keyword ...
.Sh DESCRIPTION
.Nm
searches a set of database files containing short descriptions
of system commands for keywords and displays the result on the
standard output.
.Nm whatis
displays only complete word matches.
.Pp
.Ar keyword
really is a regular expression, please read
.Xr grep 1
manual page for more information about its format.
.Sh DIAGNOSTICS
The
.Nm
utility exits 0 on success, and 1 if no keyword matched.
.Sh SEE ALSO
.Xr grep 1 ,
.Xr makewhatis 1 ,
.Xr man 1


.Dd 2017-08-10
.Dt SLSTATUS 1
.Os suckless.org
.Sh NAME
.Nm slstatus
.Nd suckless status monitor
.Sh SYNOPSIS
.Nm
.Op Fl s
.Sh DESCRIPTION
.Nm
is a suckless status monitor for window managers that use WM_NAME (e.g. dwm) or
stdin to fill the status bar.
By default,
.Nm
outputs to WM_NAME.
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl s
Write to stdout instead of WM_NAME.
.El
.Sh CUSTOMIZATION
.Nm
can be customized by creating a custom config.h and (re)compiling the source
code. This keeps it fast, secure and simple.

Fix man page .Os field

.Dd 2017-08-10
.Dt SLSTATUS 1
.Os
.Sh NAME
.Nm slstatus
.Nd suckless status monitor
.Sh SYNOPSIS
.Nm
.Op Fl s
.Sh DESCRIPTION
.Nm
is a suckless status monitor for window managers that use WM_NAME (e.g. dwm) or
stdin to fill the status bar.
By default,
.Nm
outputs to WM_NAME.
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl s
Write to stdout instead of WM_NAME.
.El
.Sh CUSTOMIZATION
.Nm
can be customized by creating a custom config.h and (re)compiling the source
code. This keeps it fast, secure and simple.


.\"	$Id$
.\"
.\" Copyright (c) 2017 Scott Bennett
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: March 23 2017 $
.Dt PASSGEN 1
.Os
.Sh NAME
.Nm passgen
.Nd generate random passwords
.Sh SYNOPSIS
.Nm passgen
.Op Fl l Ar passlength
.Op Fl n Ar passnum
.Sh DESCRIPTION
The
.Nm
utility prints a number of random passwords up to 50 characters long.
.Sh EXAMPLE
.\"
.Sh EXIT STATUS
.\"
.Sh AUTHORS
The
.Nm
utility was written by
.An Scott Bennett ,
.Mt scottb@fastmail.com .
.Sh CAVEATS
.Nm
only compiles on
.Ox 5.9
or higher, because it uses
.Xr pledge 3 .

Add a little bit more to the man page

.\"	$Id$
.\"
.\" Copyright (c) 2017 Scott Bennett
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: March 23 2017 $
.Dt PASSGEN 1
.Os
.Sh NAME
.Nm passgen
.Nd generate random passwords
.Sh SYNOPSIS
.Nm passgen
.Op Fl l Ar passlength
.Op Fl n Ar passnum
.Sh DESCRIPTION
The
.Nm
utility prints a number of random passwords up to 50 characters long.
.\" TODO: find the macro to create a new paragraph right here
The options are as follows:
.Sh EXAMPLES
.\"
.Sh EXIT STATUS
.Nm
exits 0 on success, and 1 if an error occurs.
.Sh AUTHORS
.Nm
was written by
.An Scott Bennett ,
.Mt scottb@fastmail.com .
.Sh CAVEATS
.Nm
only compiles on
.Ox 5.9
or higher, because it uses
.Xr pledge 3 .


.\" Copyright (c) 1996 WIDE Project. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modifications, are permitted provided that the above copyright notice
.\" and this paragraph are duplicated in all such forms and that any
.\" documentation, advertising materials, and other materials related to
.\" such distribution and use acknowledge that the software was developed
.\" by the WIDE Project, Japan. The name of the Project may not be used to
.\" endorse or promote products derived from this software without
.\" specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS''
.\" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
.\" LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE.
.\"
.\"	$FreeBSD$
.\"
.Dd May 21, 1998
.Dt IFMCSTAT 8
.Os KAME
.Sh NAME
.Nm ifmcstat
.Nd dump multicast group management statistics per interface
.Sh SYNOPSIS
.Nm
.\"
.Sh DESCRIPTION
The
.Nm Ifmcstat
dumps multicast group information in the kernel.
.Pp
There are no command-line options.
.\"
.\" .Sh SEE ALSO
.\" RFC2080 -- IPng for IPv6. G. Malkin, R. Minnear. January 1997.

Remove useless .Nm macro argument

.\" Copyright (c) 1996 WIDE Project. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modifications, are permitted provided that the above copyright notice
.\" and this paragraph are duplicated in all such forms and that any
.\" documentation, advertising materials, and other materials related to
.\" such distribution and use acknowledge that the software was developed
.\" by the WIDE Project, Japan. The name of the Project may not be used to
.\" endorse or promote products derived from this software without
.\" specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS''
.\" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
.\" LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE.
.\"
.\"	$FreeBSD$
.\"
.Dd May 21, 1998
.Dt IFMCSTAT 8
.Os KAME
.Sh NAME
.Nm ifmcstat
.Nd dump multicast group management statistics per interface
.Sh SYNOPSIS
.Nm
.\"
.Sh DESCRIPTION
The
.Nm
command dumps multicast group information in the kernel.
.Pp
There are no command-line options.
.\"
.\" .Sh SEE ALSO
.\" RFC2080 -- IPng for IPv6. G. Malkin, R. Minnear. January 1997.


FROM alpine:3.6
MAINTAINER Dmitrii Kuzmenkov <dmitrii@kuzmenkov.me>

ENV build_deps="autoconf automake build-base libtool db-dev boost-dev openssl-dev libevent-dev"
RUN apk add --update curl $build_deps && \
  curl -sSL https://github.com/litecoin-project/litecoin/archive/v0.13.2.1.tar.gz | tar -xzf - && \
  cd litecoin-0.13.2.1 && ./autogen.sh && \
  ./configure --prefix=/usr --with-incompatible-bdb --disable-wallet && \
  make && make install && \
  apk del $build_deps && rm -fr /var/cache/apk

ENTRYPOINT ["litecoind"]

Fix segmentation fault for litecoin image

FROM ubuntu:14.04
MAINTAINER Dmitrii Kuzmenkov <dmitrii@kuzmenkov.me>

RUN apt-get update -y && \
  apt-get install -y curl software-properties-common \
    build-essential libtool \
    autotools-dev automake pkg-config libssl-dev \
    libevent-dev bsdmainutils libboost-system-dev \
    libboost-filesystem-dev libboost-chrono-dev \
    libboost-program-options-dev libboost-test-dev \
    libboost-thread-dev libminiupnpc-dev libzmq3-dev && \
  add-apt-repository ppa:bitcoin/bitcoin -y && \
  apt-get update -y && \
  apt-get install -y libdb4.8-dev libdb4.8++-dev && \
  curl -sSL https://github.com/litecoin-project/litecoin/archive/v0.13.2.1.tar.gz | tar -xzf - && \
  cd litecoin-0.13.2.1 && \
  ./autogen.sh && \
  ./configure --prefix=/usr --with-incompatible-db --disable-wallet && \
  make && make install && \
  apt-get remove build-essential autotools-dev automake \
    software-properties-common -y pkg-config && \
  apt-get clean && rm -fr /litecoin-0.13.2.1

ENTRYPOINT ["litecoind"]


-*- Mode:Diff -*-
--- glew/include/GL/glew.h
+++ glew/include/GL/glew.h
@@ -1180,6 +1180,10 @@

 /* ---------------------------------- GLU ---------------------------------- */

+#if !defined(GLEW_NO_GLU) && defined(__APPLE__) && defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+#define GLEW_NO_GLU
+#endif
+
 #ifndef GLEW_NO_GLU
 /* this is where we can safely include GLU */
 #  if defined(__APPLE__) && defined(__MACH__)

Include <Availability.h> to get __IPHONE_OS_VERSION_MIN_REQUIRED

-*- Mode:Diff -*-
--- glew/include/GL/glew.h
+++ glew/include/GL/glew.h
@@ -1180,6 +1180,15 @@

 /* ---------------------------------- GLU ---------------------------------- */

+#ifndef GLEW_NO_GLU
+#  ifdef __APPLE__
+#    include <Availability.h>
+#    if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+#      define GLEW_NO_GLU
+#    endif
+#  endif
+#endif
+
 #ifndef GLEW_NO_GLU
 /* this is where we can safely include GLU */
 #  if defined(__APPLE__) && defined(__MACH__)


.Dd December 1, 2012
.Os
.Dt NULLTTY 1
.Sh NAME
.Nm nulltty
.Nd Simple Unix pseudoterminal relay
.Sh SYNOPSIS
.Nm
.Op Fl d
.Op Fl p Ar pidfile
.Op Fl s Ar signal
.Ar ptyA ptyB
.Nm
.Fl h
.Sh DESCRIPTION
The
.Nm
command creates two pseoduterminal slaves (as symlinks) at the given paths
.Ar ptyA
and
.Ar ptyB
, and then continuously relays data between the two until terminated with
SIGTERM or SIGINT.
.Sh OPTIONS
.Bl -tag -width indent
.It Fl d
Daemonize the relay
.It Fl p Ar pidfile
Write the relay's PID to
.Ar pidfile
.It Fl s Ar signal
Alert nulltty's parent process with
.Ar signal
when the requested PTYs are ready to be opened.
.Ar signal
can be specified either as a signal number, or with a signal name such as
"INT", "INFO", "USR1", etc.
.El
.Sh EXIT STATUS
.Ex -std
.Sh SEE ALSO
.Xr socat 1
.Sh AUTHORS
.An "Mark Shroyer" Aq code@markshroyer.com

Document SIGINFO implementation in the man page

.Dd December 1, 2012
.Os
.Dt NULLTTY 1
.Sh NAME
.Nm nulltty
.Nd Simple Unix pseudoterminal relay
.Sh SYNOPSIS
.Nm
.Op Fl d
.Op Fl p Ar pidfile
.Op Fl s Ar signal
.Ar ptyA ptyB
.Nm
.Fl h
.Sh DESCRIPTION
The
.Nm
command creates two pseoduterminal slaves (as symlinks) at the given paths
.Ar ptyA
and
.Ar ptyB
, and then continuously relays data between the two until terminated with
SIGTERM or SIGINT.

If nulltty receives SIGINFO (on platforms which support it) or SIGUSR1, it
will print current relayed byte totals to stderr.
.Sh OPTIONS
.Bl -tag -width indent
.It Fl d
Daemonize the relay
.It Fl p Ar pidfile
Write the relay's PID to
.Ar pidfile
.It Fl s Ar signal
Alert nulltty's parent process with
.Ar signal
when the requested PTYs are ready to be opened.
.Ar signal
can be specified either as a signal number, or with a signal name such as
"INT", "INFO", "USR1", etc.
.El
.Sh EXIT STATUS
.Ex -std
.Sh SEE ALSO
.Xr socat 1
.Sh AUTHORS
.An "Mark Shroyer" Aq code@markshroyer.com


.TH "manos" 1
.SH NAME
manos \- The Manos Web Framework Tool
.SH SYNOPSIS
.B manos command [options]
.SH DESCRIPTION
manos is a developers tool for creating, building and testing Manos
web applications.
.SH COMMANDS
.TP
.B init name
Initialize a new Manos web application. This command will create a new
directory with the name of your application and copy all of the
default application data to the directory.
.TP
.B server [-p port]
This option should be run from your application's root directory. It
will start hosting your web application at http://localhost:8080/
.TP
.B -? | -help
Display information about manos
.PP
.SH COPYRIGHT
Copyright (C) 2010 Jackson Harper (jackson@novell.com)
.SH WEB SITE
Visit: http://github.com/jacksonh/manos for details.

Update the man file, add the build command.

.TH "manos" 1
.SH NAME
manos \- The Manos Web Framework Tool
.SH SYNOPSIS
.B manos command [options]
.SH DESCRIPTION
manos is a developers tool for creating, building and testing Manos
web applications.
.SH COMMANDS
.TP
.B i|init name
Initialize a new Manos web application. This command will create a new
directory with the name of your application and copy all of the
default application data to the directory.
.TP
.B s|server [-p port]
This option should be run from your application's root directory. It
will start hosting your web application at http://localhost:8080/
.TP
.B b|build
Build the Manos app in the current directory. This will attempt the
following build methods in order: xbuild and .sln files in the current
directory, make if any Makefiles are in the current directory and
finally if no build files are available a recursive list of all .cs
files will be compiled and all .dll files will be referenced.
.TP
.B -? | -help
Display information about manos
.PP
.SH COPYRIGHT
Copyright (C) 2010 Jackson Harper (jackson@manosdemono.com)
.SH WEB SITE
Visit: http://manosdemono.com for details.


.Dd 1 February, 2017
.Dt PKG_TRIM 8
.Os
.Sh NAME
.Nm pkg_trim
.Nd select and remove unwanted leaf packages
.Sh SYNOPSIS
.Nm
.Op Fl hoy
.Sh DESCRIPTION
The
.Nm
script performs dialog driven selection of leaf packages. After completing
selection, the user is asked to either update the autoremove flags
of the selected packages or delete them immediately.
.Sh OPTIONS
The following options are supported:
.Bl -tag -width indent
.It Fl h -help
Displays the available options.
.It Fl o -origin
List package origins instead of names.
.It Fl y -yes
Assume yes when calling
.Xr pkg-set 8
or
.Xr pkg-delete 8 .
.El
.Sh DIAGNOSTICS
During package selection the script may exit with the exit status
returned by
.Xr dialog 1 .
During package processing the script may exit with the exit status
returned by
.Xr pkg-set 8
or
.Xr pkg-delete 8 .
.Sh HISTORY
The
.Nm
script first appeared in bsda2-0.1.
.Sh SEE ALSO
.Xr dialog 1 , pkg-query 8 , pkg-set 8 , pkg-delete 8

Fix references to other manuals

.Dd 1 February, 2017
.Dt PKG_TRIM 8
.Os
.Sh NAME
.Nm pkg_trim
.Nd select and remove unwanted leaf packages
.Sh SYNOPSIS
.Nm
.Op Fl hoy
.Sh DESCRIPTION
The
.Nm
script performs dialog driven selection of leaf packages. After completing
selection, the user is asked to either update the autoremove flags
of the selected packages or delete them immediately.
.Sh OPTIONS
The following options are supported:
.Bl -tag -width indent
.It Fl h -help
Displays the available options.
.It Fl o -origin
List package origins instead of names.
.It Fl y -yes
Assume yes when calling
.Xr pkg-set 8
or
.Xr pkg-delete 8 .
.El
.Sh DIAGNOSTICS
During package selection the script may exit with the exit status
returned by
.Xr dialog 1 .
During package processing the script may exit with the exit status
returned by
.Xr pkg-set 8
or
.Xr pkg-delete 8 .
.Sh HISTORY
The
.Nm
script first appeared in bsda2-0.1.
.Sh SEE ALSO
.Xr dialog 1 , Xr pkg-query 8 , Xr pkg-set 8 , Xr pkg-delete 8


source 'http://rubygems.org'

group :development do
  gem 'juwelier', '~> 2.0'
  gem 'rspec_junit_formatter'
end

group :test, :development do
  gem 'rake', '>= 10.0'
  gem 'rspec', '~> 3.1'

  unless ENV['NO_ACTIVERECORD']
    gem 'activerecord', '~> 4.2.0'
    gem 'activerecord-oracle_enhanced-adapter', '~> 1.6.0'
    gem 'simplecov', '>= 0'
  end

  platforms :ruby, :mswin, :mingw do
    gem 'ruby-oci8', '~> 2.1'
  end
end

Use 4-2-stable activerecord branch if ruby >= 2.4

source 'http://rubygems.org'

group :development do
  gem 'juwelier', '~> 2.0'
  gem 'rspec_junit_formatter'
end

group :test, :development do
  gem 'rake', '>= 10.0'
  gem 'rspec', '~> 3.1'

  unless ENV['NO_ACTIVERECORD']
    if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4.0')
      gem 'activerecord', github: 'rails/rails', branch: '4-2-stable'
    else
      gem 'activerecord', '~> 4.2.0'
    end
    gem 'activerecord-oracle_enhanced-adapter', '~> 1.6.0'
    gem 'simplecov', '>= 0'
  end

  platforms :ruby, :mswin, :mingw do
    gem 'ruby-oci8', '~> 2.1'
  end
end


Processing test3...

Warnings...

/usr/lib/python2.4/UserDict.py:4: No doc string for class UserDict

test_input/test3.py:7: No global (x) found
test_input/test3.py:12: No doc string for class jj

Fix another test with python 2.4

Processing test3...

Warnings...

UserDict.py:4: No doc string for class UserDict

test_input/test3.py:7: No global (x) found
test_input/test3.py:12: No doc string for class jj


.TH "ifuse" 1
.SH NAME
ifuse \- Mount filesystem of an iPhone, iPod Touch, iPad or Apple TV.
.SH SYNOPSIS
.B ifuse <mount_point> [OPTIONS]

.SH DESCRIPTION

Mount filesystem of an iPhone, iPod Touch, iPad or Apple TV

Example:

ifuse /media/iPhone \-\-root

This mounts the root filesystem of the first attached device on
this computer in the directory /media/iPhone.

.SH OPTIONS
.TP
.B \-o opt,[opt...]
mount options.
.TP
.B \-u|\-\-uuid UUID
mount specific device by its 40-digit device UUID.
.TP
.B \-h|\-\-help
prints usage information.
.TP
.B \-V|\-\-version
print version.
.TP
.B \-\-appid APPID
mount 'Documents' folder of app identified by APPID.
.TP
.B \-\-root
mount root file system (jailbroken device required).
.TP
.B \-\-debug
enable libimobiledevice communication debugging.

.SH AUTHOR
Matt Colyer

Man page written to conform with Debian by Julien Lavergne.

Update man page due to latest command line interface changes

.TH "ifuse" 1
.SH NAME
ifuse \- Mount directories of an iOS device locally using fuse.
.SH SYNOPSIS
.B ifuse MOUNTPOINT [OPTIONS]

.SH DESCRIPTION

Mount directories of an iOS device locally using fuse. By default the media
directory is mounted, options allow to also mount the sandbox container of an
app, an app's documents folder or even the root filesystem on jailbroken
devices.

Example:

$ ifuse /media/iPhone \-\-root

This mounts the root filesystem of the first attached device on
this computer in the directory /media/iPhone.

Regular users are able to unmount fuse mounts using "fusermount -u MOUNTPOINT".

.SH OPTIONS
.TP
.B \-o opt,[opt...]
mount options.
.TP
.B \-u, \-\-uuid UUID
mount specific device by its 40-digit device UUID.
.TP
.B \-h, \-\-help
prints usage information.
.TP
.B \-V, \-\-version
print version.
.TP
.B \-d, \-\-debug
enable libimobiledevice communication debugging.
.TP
.B \-\-documents APPID
mount 'Documents' folder of app identified by APPID.
.TP
.B \-\-container APPID
mount sandbox root of an app identified by APPID.
.TP
.B \-\-root
mount root file system (jailbroken device required).

.SH AUTHOR
Julien Lavergne (man page)

Martin Szulecki

Matt Colyer

Nikias Bassen

.SH SEE ALSO
fusermount(1)


.\"
.\"Copyright (c) 2020 Scott Bennett <scottb@fastmail.com>
.\"
.Dd $Mdocdate$
.Dt Y86_OBJ_CODE 7
.Os
.Sh NAME
.Nm y86_obj_code
.Nd y86 object code reference
.Sh DESCRIPTION
.Sy y86 object code
is represented by ASCII text files ending in a
.Em \.yo
extension.
Each line in the program file is either a
.Sy comment record
or a
.Sy data record .
.Pp
A
.Sy comment record
is of the form:
.Bd -literal -compact
                      | comment here
.Ed
where columns 0-21 contain space characters
.Pq Sq " "
and column 22 contains a pipe character
.Pq Sq | .
Any characters beyond column 22 are considered part of a
comment and are ignored.
.Pp
A
.Sy data record
is of the form:
.Bd -literal -compact
  0x042: 0f000000     |
.Ed
where columns 0, 1, 8, and 21 (at least) contain space characters, columns 2-7
contain an address, columns 9 up to 20 contain zero to six bytes of data, and
column 22 contains a pipe character
.Pq Sq | .
Characters beyond column 22 are considered comment characters and are ignored.
.Pp

.Sh SEE ALSO
.Xr yess 1

Add a note to document some examples

.\"
.\"Copyright (c) 2020 Scott Bennett <scottb@fastmail.com>
.\"
.Dd $Mdocdate$
.Dt Y86_OBJ_CODE 7
.Os
.Sh NAME
.Nm y86_obj_code
.Nd y86 object code reference
.Sh DESCRIPTION
.Sy y86 object code
is represented by ASCII text files ending in a
.Em \.yo
extension.
Each line in the program file is either a
.Sy comment record
or a
.Sy data record .
.Pp
A
.Sy comment record
is of the form:
.Bd -literal -compact
                      | comment here
.Ed
where columns 0-21 contain space characters
.Pq Sq " "
and column 22 contains a pipe character
.Pq Sq | .
Any characters beyond column 22 are considered part of a
comment and are ignored.
.Pp
A
.Sy data record
is of the form:
.Bd -literal -compact
  0x042: 0f000000     |
.Ed
where columns 0, 1, 8, and 21 (at least) contain space characters, columns 2-7
contain an address, columns 9 up to 20 contain zero to six bytes of data, and
column 22 contains a pipe character
.Pq Sq | .
Characters beyond column 22 are considered comment characters and are ignored.
.Pp
.Sh EXAMPLES
.\" Add a few comment and data record examples.
.Sh SEE ALSO
.Xr yess 1


source "https://rubygems.org"

gem "activesupport", "< 4.0.0"
gem "i18n", "< 0.7.0"
gem "saxy", :path => "../"
gemspec :path => "../"

Use nokogiri < 1.6.0 for ruby 1.8

source "https://rubygems.org"

gem "activesupport", "< 4.0.0"
gem "i18n", "< 0.7.0"
gem "nokogiri", "< 1.6.0"
gem "saxy", :path => "../"
gemspec :path => "../"


.\" $Id: libssh2_session_disconnect_ex.3,v 1.2 2007/06/13 12:51:11 jehousley Exp $
.\"
.TH libssh2_session_disconnect_ex 3 "1 June 2007" "libssh2 0.15" "libssh2 manual"
.SH NAME
libssh2_session_disconnect_ex - terminate transport layer
.SH SYNOPSIS
#include <libssh2.h>

int ibssh2_session_disconnect_ex(LIBSSH2_SESSION *session, int reason, const char *description, const char *lang);
.SH DESCRIPTION
Terminates the transport layer connection with the remote host.
Note that all authentication and connection layer objects become unusable
at this point and should be explicitly freed prior to disconnection.
.SH RETURN VALUE
0 on success, \-1 on failure
.SH ERRORS
LIBSSH2_ERROR_EAGAIN
Marked for non-blocking I/O but the call would block.
.SH SEE ALSO
.BI libssh2_session_init(3)

Update to match current code and add errors

.\" $Id: libssh2_session_disconnect_ex.3,v 1.3 2007/06/13 13:41:46 jehousley Exp $
.\"
.TH libssh2_session_disconnect_ex 3 "1 June 2007" "libssh2 0.15" "libssh2 manual"
.SH NAME
libssh2_session_disconnect_ex - terminate transport layer
.SH SYNOPSIS
#include <libssh2.h>

int
libssh2_session_disconnect_ex(LIBSSH2_SESSION *session, int reason, const char *description, const char *lang);

int
libssh2_session_disconnect(LIBSSH2_SESSION *session, const char *description);

.SH DESCRIPTION
\fIsession\fP - Session instance as returned by
.BR libssh2_session_init(3)

\fIreason\fP - One of the Disconnect Reason constants.

\fIdescription\fP - Human readable reason for disconnection.

\fIlang\fP - Localization string describing the langauge/encoding of the description provided.

Send a disconnect message to the remote host associated with \fIsession\fP,
along with a \fIreason\fP symbol and a verbose \fIdescription\fP.

As a convenience, the macro
.BR libssh2_session_disconnect(3)
is provided. It calls
.BR libssh2_session_disconnect_ex(3)
with \fIreason\fP set to SSH_DISCONNECT_BY_APPLICATION
and \fIlang\fP set to an empty string.

.SH RETURN VALUE
Return 0 on success or negative on failure.  It returns
LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
.SH SEE ALSO
.BR libssh2_session_init(3)


FROM aegir/hostmaster

ENV AEGIR_CLIENT_EMAIL aegir@aegir.docker
ENV AEGIR_CLIENT_NAME admin
ENV AEGIR_PROFILE hostmaster
ENV AEGIR_VERSION 7.x-3.6
ENV PROVISION_VERSION 7.x-3.6

USER root

# Remove stock provision, install provision-$PROVISION_VERSION
RUN rm -rf /usr/share/drush/commands/provision
RUN drush dl --destination=/usr/share/drush/commands provision-$PROVISION_VERSION -y

USER aegir

# For Releases:
ENV AEGIR_MAKEFILE http://cgit.drupalcode.org/provision/plain/aegir-release.make?h=$AEGIR_VERSION

# Prepare hostmaster platform.
RUN drush make $AEGIR_MAKEFILE /var/aegir/$AEGIR_PROFILE-$AEGIR_VERSION
RUN drush cc drush

Build platform and get provision in tagged image.

FROM aegir/hostmaster

ENV AEGIR_VERSION 7.x-3.6
ENV AEGIR_MAKEFILE http://cgit.drupalcode.org/provision/plain/aegir-release.make?h=$AEGIR_VERSION

ENV AEGIR_HOSTMASTER_ROOT /var/aegir/$AEGIR_PROFILE-$AEGIR_VERSION

# Prepare next hostmaster platform.
# This is done in the Dockerfile so that we can ship upgrades with the codebase, then run hostmaster-migrate when a new
# version is detected.

RUN drush make $AEGIR_MAKEFILE $AEGIR_HOSTMASTER_ROOT
RUN drush dl provision-$AEGIR_VERSION --destination=/var/aegir/.drush/commands -y


.TH GVEDIT 1 "4 April 2011"
.SH NAME
gvedit \- simple graph editor and viewer
.SH SYNOPSIS
.B gvedit
[
.I file
]
.SH DESCRIPTION
.B gvedit

.SH AUTHOR
Arif Bilgin <arif@research.att.com>
.br
Emden R. Gansner <erg@research.att.com>
.SH SEE ALSO

Add more content to the man page, but much more should be supplied.

.TH GVEDIT 1 "4 April 2011"
.SH NAME
gvedit \- simple graph editor and viewer
.SH SYNOPSIS
.B gvedit
[
.I file
]
.SH DESCRIPTION
.B gvedit
provides a simple graph editor and viewer. It allows many graphs to be viewed at the
same time. The text of each graph is displayed in its own text window.
.P
The name of a Graphviz file can be specified on the command line. This graph
file will be automatically opened on start-up.
.SH AUTHOR
Arif Bilgin <arif@research.att.com>
.br
Emden R. Gansner <erg@research.att.com>
.SH SEE ALSO
.PP
dot(1), dotty(1), lefty(1)


FROM maven:3.3-alpine

WORKDIR /home
RUN echo '<toolchains><toolchain><type>jdk</type><provides><version>1.6</version></provides><configuration><jdkHome>/usr/lib/jvm/java-1.8-openjdk</jdkHome></configuration></toolchain></toolchains>' > toolchains.xml
ADD . /home
RUN mvn -t toolchains.xml package
RUN tar xvfz maven-color-gossip/target/maven-color-gossip-*-bundle.tar.gz -C $MAVEN_HOME
RUN rm $MAVEN_HOME/lib/slf4j-simple-1.7.*.jar

Fix maven 3.3 docker image

FROM maven:3.3

WORKDIR /home
RUN echo '<toolchains><toolchain><type>jdk</type><provides><version>1.6</version></provides><configuration><jdkHome>/usr/lib/jvm/java-8-openjdk-amd64/</jdkHome></configuration></toolchain></toolchains>' > toolchains.xml
ADD . /home
RUN mvn -t toolchains.xml package
RUN tar xvfz maven-color-gossip/target/maven-color-gossip-*-bundle.tar.gz -C $MAVEN_HOME
RUN rm $MAVEN_HOME/lib/slf4j-simple-1.7.*.jar


#!/usr/bin/env bash

set -eo pipefail

ep /usr/share/elasticsearch/config/elasticsearch.yml

if [ ! -z "$EXTRA_OPTS" ]; then
  echo -e "${EXTRA_OPTS}" >> /usr/share/elasticsearch/config/elasticsearch.yml
fi

if [ -z "$POD_NAMESPACE" ]; then
  # Single container runs in docker
  echo "POD_NAMESPACE not set, spin up single node"
  sed -i 's/cluster.initial_master_nodes:.*//' /usr/share/elasticsearch/config/elasticsearch.yml
  echo "cluster.initial_master_nodes: ${HOSTNAME}" >> /usr/share/elasticsearch/config/elasticsearch.yml
else
  # Is running in Kubernetes/OpenShift, so find all other pods
  # belonging to the namespace
  echo "Elasticsearch: Running in Kubernetes, setting up for clustering"
  K8S_SVC_NAME=$(hostname -f | cut -d"." -f2)
  echo "Using service name: ${K8S_SVC_NAME}"
  sed -i 's/discovery.seed_hosts:.*//' /usr/share/elasticsearch/config/elasticsearch.yml
  sed -i 's/cluster.initial_master_nodes:.*//' /usr/share/elasticsearch/config/elasticsearch.yml
  echo "discovery.seed_hosts: ${K8S_SVC_NAME}" >> /usr/share/elasticsearch/config/elasticsearch.yml
fi

Revert "remove cluster.initial_master_nodes it seems not be needed"

#!/usr/bin/env bash

set -eo pipefail

ep /usr/share/elasticsearch/config/elasticsearch.yml

if [ ! -z "$EXTRA_OPTS" ]; then
  echo -e "${EXTRA_OPTS}" >> /usr/share/elasticsearch/config/elasticsearch.yml
fi

if [ -z "$POD_NAMESPACE" ]; then
  # Single container runs in docker
  echo "POD_NAMESPACE not set, spin up single node"
  sed -i 's/cluster.initial_master_nodes:.*//' /usr/share/elasticsearch/config/elasticsearch.yml
  echo "cluster.initial_master_nodes: ${HOSTNAME}" >> /usr/share/elasticsearch/config/elasticsearch.yml
else
  # Is running in Kubernetes/OpenShift, so find all other pods
  # belonging to the namespace
  echo "Elasticsearch: Running in Kubernetes, setting up for clustering"
  K8S_SVC_NAME=$(hostname -f | cut -d"." -f2)
  echo "Using service name: ${K8S_SVC_NAME}"
  sed -i 's/discovery.seed_hosts:.*//' /usr/share/elasticsearch/config/elasticsearch.yml
  sed -i 's/cluster.initial_master_nodes:.*//' /usr/share/elasticsearch/config/elasticsearch.yml
  echo "discovery.seed_hosts: ${K8S_SVC_NAME}" >> /usr/share/elasticsearch/config/elasticsearch.yml
  echo "cluster.initial_master_nodes: ${K8S_SVC_NAME}-0" >> /usr/share/elasticsearch/config/elasticsearch.yml
fi


.\"
.\" Copyright (c) 2020 Scott Bennett <scottb@fastmail.com>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd March 19, 2020
.Dt YESS 1
.Os
.Sh NAME
.Nm yess
.Nd y86 instruction set simulator
.Sh SYNOPSIS
.Nm yess
.Op Fl d
.Fl f Ar filename.yo
.Op Fl uv
.Sh DESCRIPTION
The
.Nm
program simulates the execution of y86 machine code.
.Sh SEE ALSO
.Xr y86_obj_code 7
.Sh AUTHORS
This program was written by
.An Scott Bennett
and
.An Alex Svarda .

Use 'object' instead of 'machine'

.\"
.\" Copyright (c) 2020 Scott Bennett <scottb@fastmail.com>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd March 19, 2020
.Dt YESS 1
.Os
.Sh NAME
.Nm yess
.Nd y86 instruction set simulator
.Sh SYNOPSIS
.Nm yess
.Op Fl d
.Fl f Ar filename.yo
.Op Fl uv
.Sh DESCRIPTION
The
.Nm
program simulates the execution of y86 object code.
.Sh SEE ALSO
.Xr y86_obj_code 7
.Sh AUTHORS
This program was written by
.An Scott Bennett
and
.An Alex Svarda .


SHOW STOPPERS
====================
- Windows Segfaults
- MANIFEST verifications
- rt.cpan.org PRs

NICE TO HAVE
=============
- Smolder, https://issues.apache.org/jira/browse/INFRA-1612

Add some questions, add Apache::Test 1.31 goal, add current devs who have starting working on those issues.

SHOW STOPPERS
====================
- Windows Segfaults [needs windows developer owner, ]
- MANIFEST verifications [needs detail, ]
- rt.cpan.org PRs [pgollucci, phred, ]
    - ModPerl::Bootstrap to handle the unknown mp generation PRS?
- Ship Apache::Test 1.31 official [phred, ]

NICE TO HAVE
=============
- Smolder, https://issues.apache.org/jira/browse/INFRA-1612 [pgollucci, ]


.TH backdrop-send 1 "16 Jul 2013" "version 0.0.1"
.SH NAME
backdrop-send \- send data to backdrop
.SH SYNOPSIS
.B backdrop-send [-h] --url
.I url-to-bucket
.B --token
.I authorization-token
.B [file-to-send]
.P
.I pipe
.B | backdrop-send --url
.I url-to-backdrop
.B --token
.I authorization-token
.SH DESCRIPTION
Sends data to a bucket in
.B backdrop
over http using a bearer token for authentication.
.SH OPTIONS
.IP "-h --help"
print help message and exit
.IP --token
the authorization token for the bucket
.IP --url
the url of the backdrop bucket eg.
.I http://location_of_backdrop/my_bucket
.SH FILES
.IP [file-to-send]
utf8 encoded file in json format
.\" This is the last section by convention
.SH SEE ALSO
.I https://github.com/alphagov/backdrop-send

Add new params to man page

.TH backdrop-send 1 "16 Jul 2013" "version 0.0.1"
.SH NAME
backdrop-send \- send data to backdrop
.SH SYNOPSIS
.B backdrop-send [-h] --url
.I url-to-bucket
.B --token
.I authorization-token
.B [--timeout
.I num
.B ]
.B [--attempts
.I num
.B ]
.B [--failfast]
.B [file-to-send]
.P
.I pipe
.B | backdrop-send --url
.I url-to-backdrop
.B --token
.I authorization-token
.B [--timeout
.I num
.B ]
.B [--attempts
.I num
.B ]
.B [--failfast]
.SH DESCRIPTION
Sends data to a bucket in
.B backdrop
over http using a bearer token for authentication.
.SH OPTIONS
.IP "-h --help"
print help message and exit
.IP --url
the url of the backdrop bucket eg.
.I http://location_of_backdrop/my_bucket
.IP --token
the authorization token for the bucket
.IP "--timeout num"
Request timeout. Default: 5 seconds
.IP "--attempts num"
Number of times to attempt sending data. Default: 3
.IP --failfast
Don't retry sending data
.SH FILES
.IP [file-to-send]
utf8 encoded file in json format
.\" This is the last section by convention
.SH SEE ALSO
.I https://github.com/alphagov/backdrop-send


FROM node:8.9.4-alpine
MAINTAINER Dmitrii Kuzmenkov <dmitrii@kuzmenkov.me>

ENV build_deps="autoconf git file automake build-base python curl"
RUN apk add --update $build_deps libtool sqlite-dev && \
  curl -sSL http://www.sqlite.org/2018/sqlite-autoconf-3220000.tar.gz | tar xzf - && \
  cd sqlite-autoconf-3220000 && ./configure --prefix=/usr && \
  make && make install && cd ../ && rm -fr /sqlite-autoconf-3220000 && \
  curl -sSL https://github.com/jedisct1/libsodium/releases/download/1.0.15/libsodium-1.0.15.tar.gz | tar -xzf - && \
  cd libsodium-1.0.15 && ./configure --prefix=/usr && \
  make && make install && cd .. && rm -fr libsodium-1.0.15 && \
  git clone https://github.com/BTWhite/BTWChain.git && \
  mv BTWChain src && cd /src && \
  git checkout 8eb3a5e015bbae959b7eb1475ff545c85a07e85b && \
  npm install && \
  apk del $build_deps && rm -fr /var/cache/apk
WORKDIR /src
ENTRYPOINT ["node"]
CMD ["app.js"]

Fix entrypoint for Bitcoin White image

FROM node:8.9.4-alpine
MAINTAINER Dmitrii Kuzmenkov <dmitrii@kuzmenkov.me>

ENV build_deps="autoconf git file automake build-base python curl"
RUN apk add --update $build_deps libtool sqlite-dev && \
  curl -sSL http://www.sqlite.org/2018/sqlite-autoconf-3220000.tar.gz | tar xzf - && \
  cd sqlite-autoconf-3220000 && ./configure --prefix=/usr && \
  make && make install && cd ../ && rm -fr /sqlite-autoconf-3220000 && \
  curl -sSL https://github.com/jedisct1/libsodium/releases/download/1.0.15/libsodium-1.0.15.tar.gz | tar -xzf - && \
  cd libsodium-1.0.15 && ./configure --prefix=/usr && \
  make && make install && cd .. && rm -fr libsodium-1.0.15 && \
  git clone https://github.com/BTWhite/BTWChain.git && \
  mv BTWChain src && cd /src && \
  git checkout 8eb3a5e015bbae959b7eb1475ff545c85a07e85b && \
  npm install && \
  apk del $build_deps && rm -fr /var/cache/apk
WORKDIR /src
ENTRYPOINT ["node"]
CMD ["index.js"]


.\" Process this file with
.\" groff -man -Tascii marc.1
.\"
.TH MaRC 1 "JUNE 1998" "Data Visualization" "User Manuals"
.SH NAME
MaRC \- Map Reprojections and Conversions
.SH SYNOPSIS
.B marc
.I inputfile1
.B [
.I inputfile2
.B ...]
.SH DESCRIPTION
.B MaRC
is a program designed to produce maps from digital images or from computed
values of incidence, emission or phase angles, and latitudes and
longitudes.  Multi-plane maps can be created with digital image data
in several planes and incidence, emission, phase angles, latitudes and
longitudes in other planes.  Placement of data in a given plane is
completely arbitrary.  The user decides in what plane to place a given
set of data.  Created maps are stored in FITS (Flexible Image
Transport System) format.
.SH FILES
.I ~/.marc
.RS
Per user configuration file. See
.BR MaRC_input
manual for further details.
.SH BUGS
Conformal and equivalent projects have not been well tested or
verified.
.SH AUTHOR
Ossama Othman <ossama@dre.vanderbilt.edu>

Update e-mail address in man page.

.\" Process this file with
.\" groff -man -Tascii marc.1
.\"
.TH MaRC 1 "JUNE 1998" "Data Visualization" "User Manuals"
.SH NAME
MaRC \- Map Reprojections and Conversions
.SH SYNOPSIS
.B marc
.I inputfile1
.B [
.I inputfile2
.B ...]
.SH DESCRIPTION
.B MaRC
is a program designed to produce maps from digital images or from computed
values of incidence, emission or phase angles, and latitudes and
longitudes.  Multi-plane maps can be created with digital image data
in several planes and incidence, emission, phase angles, latitudes and
longitudes in other planes.  Placement of data in a given plane is
completely arbitrary.  The user decides in what plane to place a given
set of data.  Created maps are stored in FITS (Flexible Image
Transport System) format.
.SH FILES
.I ~/.marc
.RS
Per user configuration file. See
.BR MaRC_input
manual for further details.
.SH BUGS
Conformal and equivalent projects have not been well tested or
verified.
.SH AUTHOR
Ossama Othman <othman@users.sourceforge.net>


0040 KILO #include <time.h>

#include >fcntl.h>
#include <unistd.h>

0066 KILO
$I struct timespec tim, tim2;
$I
$I int cha;
$I int return_value;
$I int ignore;
$I static struct termios temp_termios;
$I
$I int nucat( const char infil[] )
$I     {
$I   FILE *fPtr;
$I   fPtr=fopen(infil, "r");
$I   int ch;
$I
$I while
$I    ((ch = fgetc(fPtr)) != EOF)
$I    putchar(ch);
$I
$I    int newLine = 10;      putchar(newLine);
$I    int carriageReturn=13; putchar(carriageReturn);
$I    return 0;
$I }
$I
1259 KILO
$I    tim.tv_sec = 0;
$I    tim.tv_nsec = 500000000L; /* 1/2 of a second */

Add comment flagging the no-error exit statement

0040 KILO #include <time.h>

#include >fcntl.h>
#include <unistd.h>

0066 KILO
$I struct timespec tim, tim2;
$I
$I int cha;
$I int return_value;
$I int ignore;
$I static struct termios temp_termios;
$I
$I int nucat( const char infil[] )
$I     {
$I   FILE *fPtr;
$I   fPtr=fopen(infil, "r");
$I   int ch;
$I
$I while
$I    ((ch = fgetc(fPtr)) != EOF)
$I    putchar(ch);
$I
$I    int newLine = 10;      putchar(newLine);
$I    int carriageReturn=13; putchar(carriageReturn);
$I    return 0;
$I }
$I
1184 KILO         exit(0);  /* The sole no-error return from kilo */
1259 KILO
$I   tim.tv_sec = 0;
$I   tim.tv_nsec = 500000000L; /* 1/2 of a second */


.TH SPECTRUM 1
.SH NAME
spectrum \- curses audio visualizer
.SH SYNOPSIS
.B spectrum [ \-hcp ] [ fifo ]
.SH DESCRIPTION
.B spectrum
performs a discrete fourier transform and plots the spectrogram in real time
using curses.  The current implementation expects the input stream to be 44.1kHz,
16-bit little endian and 2 channels.  The default fifo path is `/tmp/audio.fifo'.
.SH OPTIONS
.TP
.B \-h
Show usage line.
.TP
.B \-c
Enable color support.
.TP
.B \-p
Enable falling peaks.

Rewrite manpage using the mdoc format

.Dd Nov 22, 2013
.Dt SPECTRUM 1
.Os
.Sh NAME
.Nm spectrum
.Nd curses audio visualizer
.Sh SYNOPSIS
.Nm spectrum
.Op Fl hcp
.Op Ar fifo
.Sh DESCRIPTION
The
.Nm
program performs a discrete fourier transform and plots the spectrogram
in real time using curses.  The current implementation expects the input
stream to be 44.1kHz, 16-bit little endian and 2 channels.  The default
.Ar fifo
path is
.Pa /tmp/audio.fifo .
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl h
Show usage line.
.It Fl c
Enable color support.
.It Fl p
Enable falling peaks.


.\"     %A%
.\"
.Dd January 7, 2008
.Dt MARKDOWN 1
.Os MASTODON
.Sh NAME
.Nm markdown
.Nd text to html conversion tool
.Sh SYNOPSIS
.Nm
.Op Fl d
.Op Fl V
.Op Fl o Pa file
.Op Pa textfile
.Sh DESCRIPTION
The
.Nm
utility reads the
.Xr markdown 7 Ns -formatted
.Pa textfile
.Pq or stdin if not specified,
compiles it, and writes the html output
to stdout.
.Pp
The options are as follows:
.Bl -tag -width "-o file"
.It Fl d
Instead of writing the html file, dump a parse
tree to stdout.
.It Fl V
Show the version#
.It Fl o Pa file
Write the generated html to
.Pa file .
.El
.Sh RETURN VALUES
The
.Nm
utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr markdown 3 ,
.Xr markdown 7 .
.Sh AUTHOR
.An David Parsons
.Pq Li orc@pell.chi.il.us

Document the format of the version string; describe the -F option

.\"     %A%
.\"
.Dd January 7, 2008
.Dt MARKDOWN 1
.Os MASTODON
.Sh NAME
.Nm markdown
.Nd text to html conversion tool
.Sh SYNOPSIS
.Nm
.Op Fl d
.Op Fl V
.Op Fl F Pa bitmap
.Op Fl o Pa file
.Op Pa textfile
.Sh DESCRIPTION
The
.Nm
utility reads the
.Xr markdown 7 Ns -formatted
.Pa textfile
.Pq or stdin if not specified,
compiles it, and writes the html output
to stdout.
.Pp
The options are as follows:
.Bl -tag -width "-o file"
.It Fl d
Instead of writing the html file, dump a parse
tree to stdout.
.It Fl V
Show the version# and configuration data.
.Pp
If the version includes the string
.Em DL_TAG ,
.Nm
was configured with definition list support.
.Pp
If the version includes the string
.Em HEADER ,
.Nm
was configured to support pandoc header blocks.
.It Fl F Ar bitmap
Pass the flags contained in
.Ar bitmap
to the markdown compiler.  The valid flags are
described in
.Xr markdown 3 .
.It Fl o Pa file
Write the generated html to
.Pa file .
.El
.Sh RETURN VALUES
The
.Nm
utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr markdown 3 ,
.Xr markdown 7 .
.Sh AUTHOR
.An David Parsons
.Pq Li orc@pell.chi.il.us


#import <Foundation/Foundation.h>
#include <iostream>

int main (int argc, const char * argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    NSFileHandle *stdout = [NSFileHandle fileHandleWithStandardOutput];
    NSData *strData = [@"Hello " dataUsingEncoding: NSASCIIStringEncoding];
    [stdout writeData: strData];
    std::cout << "world!" << std::endl;

    [pool drain];

    return 0;
}

Fix for broken sample on the linux machines.

#define __STDC_LIMIT_MACROS
#include <stdint.h>
#import <Foundation/Foundation.h>
#include <iostream>

int main (int argc, const char * argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    NSFileHandle *stdout = [NSFileHandle fileHandleWithStandardOutput];
    NSData *strData = [@"Hello " dataUsingEncoding: NSASCIIStringEncoding];
    [stdout writeData: strData];
    std::cout << "world!" << std::endl;

    [pool drain];

    return 0;
}


// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions -fobjc-exceptions -o - %s | FileCheck %s

@interface OCType @end
void opaque();

namespace test0 {

  // CHECK: define void @_ZN5test03fooEv
  void foo() {
    try {
      // CHECK: invoke void @_Z6opaquev
      opaque();
    } catch (OCType *T) {
      // CHECK:      landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
      // CHECK-NEXT:   catch %struct._objc_typeinfo* @"OBJC_EHTYPE_$_OCType"
    }
  }
}

// rdar://12605907
@interface NSException
  - new;
@end
namespace test1 {

  void bar() {
    @try {
      throw [NSException new];
    } @catch (id i) {
    }
  }
// CHECK: invoke void @objc_exception_throw(i8* [[CALL:%.*]]) noreturn
// CHECK:          to label [[INVOKECONT1:%.*]] unwind label [[LPAD:%.*]]
}

Declare +new instead of -new in test.

// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions -fobjc-exceptions -o - %s | FileCheck %s

@interface OCType @end
void opaque();

namespace test0 {

  // CHECK: define void @_ZN5test03fooEv
  void foo() {
    try {
      // CHECK: invoke void @_Z6opaquev
      opaque();
    } catch (OCType *T) {
      // CHECK:      landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
      // CHECK-NEXT:   catch %struct._objc_typeinfo* @"OBJC_EHTYPE_$_OCType"
    }
  }
}

// rdar://12605907
@interface NSException
  + new;
@end
namespace test1 {

  void bar() {
    @try {
      throw [NSException new];
    } @catch (id i) {
    }
  }
// CHECK: invoke void @objc_exception_throw(i8* [[CALL:%.*]]) noreturn
// CHECK:          to label [[INVOKECONT1:%.*]] unwind label [[LPAD:%.*]]
}


/*
 *  Copyright 2016 The WebRTC Project Authors. All rights reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#import "WebRTC/RTCFieldTrials.h"

#include <memory>

#import "WebRTC/RTCLogging.h"

#include "webrtc/system_wrappers/include/field_trial_default.h"

static NSString * const kRTCEnableImprovedBitrateEstimateString =
   @"WebRTC-ImprovedBitrateEstimate/Enabled/";

static std::unique_ptr<char[]> gFieldTrialInitString;

void RTCInitFieldTrials(RTCFieldTrialOptions options) {
  NSMutableString *fieldTrialInitString = [NSMutableString string];
  size_t len = fieldTrialInitString.length + 1;
  gFieldTrialInitString.reset(new char[len]);

  if (options & RTCFieldTrialOptionsImprovedBitrateEstimate) {
    [fieldTrialInitString appendString:kRTCEnableImprovedBitrateEstimateString];
  }

  if (![fieldTrialInitString getCString:gFieldTrialInitString.get()
                              maxLength:len
                               encoding:NSUTF8StringEncoding]) {
    RTCLogError(@"Failed to convert field trial string.");
    return;
  }
  webrtc::field_trial::InitFieldTrialsFromString(gFieldTrialInitString.get());
}

Fix improved BWE field trial.

/*
 *  Copyright 2016 The WebRTC Project Authors. All rights reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#import "WebRTC/RTCFieldTrials.h"

#include <memory>

#import "WebRTC/RTCLogging.h"

#include "webrtc/system_wrappers/include/field_trial_default.h"

static NSString * const kRTCEnableImprovedBitrateEstimateString =
   @"WebRTC-ImprovedBitrateEstimate/Enabled/";

static std::unique_ptr<char[]> gFieldTrialInitString;

void RTCInitFieldTrials(RTCFieldTrialOptions options) {
  NSMutableString *fieldTrialInitString = [NSMutableString string];
  if (options & RTCFieldTrialOptionsImprovedBitrateEstimate) {
    [fieldTrialInitString appendString:kRTCEnableImprovedBitrateEstimateString];
  }
  size_t len = fieldTrialInitString.length + 1;
  gFieldTrialInitString.reset(new char[len]);
  if (![fieldTrialInitString getCString:gFieldTrialInitString.get()
                              maxLength:len
                               encoding:NSUTF8StringEncoding]) {
    RTCLogError(@"Failed to convert field trial string.");
    return;
  }
  webrtc::field_trial::InitFieldTrialsFromString(gFieldTrialInitString.get());
}


// RUN: %clang_tsan %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s

#include "dispatch/dispatch.h"

#include <stdio.h>

long my_global;
long my_global2;
dispatch_semaphore_t done;

void callback(void *context) {
  my_global2 = 42;

  dispatch_semaphore_signal(done);
}

int main(int argc, const char *argv[]) {
  fprintf(stderr, "start\n");
  done = dispatch_semaphore_create(0);

  dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);

  my_global = 10;
  dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_MSEC)), q, ^{
    my_global = 42;

    dispatch_semaphore_signal(done);
  });
  dispatch_semaphore_wait(done, DISPATCH_TIME_FOREVER);

  my_global2 = 10;
  dispatch_after_f(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_MSEC)), q, NULL, &callback);

  dispatch_semaphore_wait(done, DISPATCH_TIME_FOREVER);
  fprintf(stderr, "done\n");
  return 0;
}

// CHECK: start
// CHECK: done
// CHECK-NOT: WARNING: ThreadSanitizer

Change test to have two simultaneous timers

// RUN: %clang_tsan %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s

#include "dispatch/dispatch.h"

#include <stdio.h>

long my_global;
long my_global2;
dispatch_semaphore_t done;

void callback(void *context) {
  my_global2 = 42;

  dispatch_semaphore_signal(done);
}

int main(int argc, const char *argv[]) {
  fprintf(stderr, "start\n");
  done = dispatch_semaphore_create(0);

  dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);

  my_global = 10;
  dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_MSEC)), q, ^{
    my_global = 42;

    dispatch_semaphore_signal(done);
  });

  my_global2 = 10;
  dispatch_after_f(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_MSEC)), q, NULL, &callback);

  dispatch_semaphore_wait(done, DISPATCH_TIME_FOREVER);
  dispatch_semaphore_wait(done, DISPATCH_TIME_FOREVER);
  fprintf(stderr, "done\n");
  return 0;
}

// CHECK: start
// CHECK: done
// CHECK-NOT: WARNING: ThreadSanitizer


// Test this without pch.
// RUN: not %clang_cc1 -include %S/objcxx-ivar-class.h -verify %s -emit-llvm -o - | FileCheck %s

// Test with pch.
// RUN: %clang_cc1 -x objective-c++-header -emit-pch -o %t %S/objcxx-ivar-class.h
// RUN: not %clang_cc1 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s

// CHECK: [C position]
// CHECK: call {{.*}} @_ZN1SC1ERKS_

// CHECK: [C setPosition:]
// CHECK: call {{.*}} %struct.S* @_ZN1SaSERKS_

// CHECK: [C .cxx_destruct]
// CHECK: [C .cxx_construct]

Make this test pass on Release builds.

// Test this without pch.
// RUN: not %clang_cc1 -include %S/objcxx-ivar-class.h -verify %s -emit-llvm -o - | FileCheck %s

// Test with pch.
// RUN: %clang_cc1 -x objective-c++-header -emit-pch -o %t %S/objcxx-ivar-class.h
// RUN: not %clang_cc1 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s

// CHECK: [C position]
// CHECK: call {{.*}} @_ZN1SC1ERKS_

// CHECK: [C setPosition:]
// CHECK: = call {{.*}}%struct.S* @_ZN1SaSERKS_

// CHECK: [C .cxx_destruct]
// CHECK: [C .cxx_construct]


// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/browser_window.h"
#include "chrome/browser/browser_window_controller.h"

// Create the controller for the Browser, which handles loading the browser
// window from the nib. The controller takes ownership of |browser|.
// static
BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
  // TODO(pinkerton): figure out ownership model. If BrowserList keeps track
  // of the browser windows, it will probably tell us when it needs to go
  // away, and it seems we need to feed back to that when we get a
  // performClose: from the UI.
  BrowserWindowController* controller =
      [[BrowserWindowController alloc] initWithBrowser:browser];
  return [controller browserWindow];
}

Update header ref to new location.

// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/browser_window.h"
#include "chrome/browser/cocoa/browser_window_controller.h"

// Create the controller for the Browser, which handles loading the browser
// window from the nib. The controller takes ownership of |browser|.
// static
BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
  // TODO(pinkerton): figure out ownership model. If BrowserList keeps track
  // of the browser windows, it will probably tell us when it needs to go
  // away, and it seems we need to feed back to that when we get a
  // performClose: from the UI.
  BrowserWindowController* controller =
      [[BrowserWindowController alloc] initWithBrowser:browser];
  return [controller browserWindow];
}


// RUN: %clang_cc1 -emit-llvm -fblocks -o - -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 %s | FileCheck %s

// N.B.  This test verifies that two blocks which are otherwise
//       indistinguishable receive distinct manglings.
//       We had a bug where the first two blocks in the global block map could
//       get the same unqualified-block mangling because the logic to handle
//       block-ids believed it was handling Itanium-style discriminators.

template<typename T>
int tf() {
    return T::value;
}
int i1 = ^int {
    struct S { enum { value = 1 };};
    // CHECK-DAG: @_Z2tfIZUb_E1SEiv
    return tf<S>();
}();
int i2 = ^int(int p1) {
    struct S { enum { value = 2 };};
    // CHECK-DAG: @_Z2tfIZUb0_E1SEiv
    return tf<S>() + p1;
}(1);


/*
 *  Copyright (c) 2018-present, Facebook, Inc.
 *
 *  This source code is licensed under the MIT license found in the LICENSE
 *  file in the root directory of this source tree.
 *
 */
#import "SonarCppBridgingResponder.h"

#import <FBCxxUtils/FBCxxFollyDynamicConvert.h>

@implementation SonarCppBridgingResponder {
  std::unique_ptr<facebook::sonar::SonarResponder> responder_;
}

- (instancetype)initWithCppResponder:(std::unique_ptr<facebook::sonar::SonarResponder>)responder
{
  if (!responder) {
    return nil;
  }

  if (self = [super init]) {
    responder_ = std::move(responder);
  }

  return self;
}

#pragma mark - SonarResponder

- (void)success:(NSDictionary *)response { responder_->success(facebook::cxxutils::convertIdToFollyDynamic(response)); }

- (void)error:(NSDictionary *)response { responder_->error(facebook::cxxutils::convertIdToFollyDynamic(response)); }

@end

Fix Nan / Inf serialization issue

/*
 *  Copyright (c) 2018-present, Facebook, Inc.
 *
 *  This source code is licensed under the MIT license found in the LICENSE
 *  file in the root directory of this source tree.
 *
 */
#import "SonarCppBridgingResponder.h"

#import <FBCxxUtils/FBCxxFollyDynamicConvert.h>

@implementation SonarCppBridgingResponder {
  std::unique_ptr<facebook::sonar::SonarResponder> responder_;
}

- (instancetype)initWithCppResponder:(std::unique_ptr<facebook::sonar::SonarResponder>)responder
{
  if (!responder) {
    return nil;
  }

  if (self = [super init]) {
    responder_ = std::move(responder);
  }

  return self;
}

#pragma mark - SonarResponder

- (void)success:(NSDictionary *)response { responder_->success(facebook::cxxutils::convertIdToFollyDynamic(response, true)); }

- (void)error:(NSDictionary *)response { responder_->error(facebook::cxxutils::convertIdToFollyDynamic(response, true)); }

@end


#ifdef HX_MACOS
#import <Cocoa/Cocoa.h>
#else
#import <UIKit/UIKit.h>
#endif

#include <system/Locale.h>

namespace lime {

	std::string* Locale::GetSystemLocale () {

		#ifndef OBJC_ARC
		NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
		#endif

		NSString* locale = [[NSLocale currentLocale] localeIdentifier];
		std::string* result = 0;

		if (locale) {

			const char* ptr = [locale UTF8String];
			result = new std::string (ptr);

		}

		#ifndef OBJC_ARC
		[pool drain];
		#endif

		return result;

	}

}

Improve iOS region string (thanks @maaniv!)

#ifdef HX_MACOS
#import <Cocoa/Cocoa.h>
#else
#import <UIKit/UIKit.h>
#endif

#include <system/Locale.h>

namespace lime {

	std::string* Locale::GetSystemLocale () {

		#ifndef OBJC_ARC
		NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
		#endif

		NSString* localeLanguage = [[NSLocale preferredLanguages] firstObject];
		NSString* localeRegion = [[NSLocale currentLocale] countryCode];
		NSString* locale = [[localeLanguage stringByAppendingString:@"_"] stringByAppendingString:localeRegion];

		std::string* result = 0;

		if (locale) {

			const char* ptr = [locale UTF8String];
			result = new std::string (ptr);

		}

		#ifndef OBJC_ARC
		[pool drain];
		#endif

		return result;

	}

}


/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#import <Cocoa/Cocoa.h>

// FIXME: should be in a header
void setSystemPreferences();

void setSystemPreferences() {
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    // Set LCD font smoothing level for this application (does not affect other
    // applications). Based on resetDefaultsToConsistentValues() in
    // http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
    enum {
        NoFontSmoothing     = 0,
        LightFontSmoothing  = 1,
        MediumFontSmoothing = 2,
        StrongFontSmoothing = 3,
    };
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setInteger:MediumFontSmoothing forKey:@"AppleFontSmoothing"];

    [pool release];
}

Include system_preferences.h in mac file.

/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "system_preferences.h"

#import <Cocoa/Cocoa.h>

void setSystemPreferences() {
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    // Set LCD font smoothing level for this application (does not affect other
    // applications). Based on resetDefaultsToConsistentValues() in
    // http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
    enum {
        NoFontSmoothing     = 0,
        LightFontSmoothing  = 1,
        MediumFontSmoothing = 2,
        StrongFontSmoothing = 3,
    };
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setInteger:MediumFontSmoothing forKey:@"AppleFontSmoothing"];

    [pool release];
}


// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/nw/src/browser/shell_application_mac.h"

#include "base/auto_reset.h"
#include "base/command_line.h"
#include "googleurl/src/gurl.h"
#include "content/nw/src/nw_shell.h"
#include "content/nw/src/shell_browser_context.h"
#include "content/nw/src/shell_content_browser_client.h"
#include "content/nw/src/common/shell_switches.h"

@implementation ShellCrApplication

- (BOOL)isHandlingSendEvent {
  return handlingSendEvent_;
}

- (void)sendEvent:(NSEvent*)event {
  AutoReset<BOOL> scoper(&handlingSendEvent_, YES);
  [super sendEvent:event];
}

- (void)setHandlingSendEvent:(BOOL)handlingSendEvent {
  handlingSendEvent_ = handlingSendEvent;
}

@end

Update to newest Chromium upstream.

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/nw/src/browser/shell_application_mac.h"

#include "base/auto_reset.h"
#include "base/command_line.h"
#include "googleurl/src/gurl.h"
#include "content/nw/src/nw_shell.h"
#include "content/nw/src/shell_browser_context.h"
#include "content/nw/src/shell_content_browser_client.h"
#include "content/nw/src/common/shell_switches.h"

@implementation ShellCrApplication

- (BOOL)isHandlingSendEvent {
  return handlingSendEvent_;
}

- (void)sendEvent:(NSEvent*)event {
  base::AutoReset<BOOL> scoper(&handlingSendEvent_, YES);
  [super sendEvent:event];
}

- (void)setHandlingSendEvent:(BOOL)handlingSendEvent {
  handlingSendEvent_ = handlingSendEvent;
}

@end


// Disable macOS Sierra tab bar (surfaced as: View > Show Tab Bar).
//
// Workaround provided by Morten Sorvig <Morten.Sorvig@qt.io>,
// http://lists.qt-project.org/pipermail/interest/2016-September/024488.html.

#import <AppKit/AppKit.h>

#if !defined(MAC_OS_X_VERSION_10_12) || \
    MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12

@interface NSWindow (SierraSDK)
@property(class) BOOL allowsAutomaticWindowTabbing;
@end

#endif

// Disables auto window tabbing where supported, otherwise a no-op.
void disableWindowTabbing()
{
    if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)]) {
        NSWindow.allowsAutomaticWindowTabbing = NO;
    }
}

Expand @property(class) declaration to support older versions of Xcode.

// Disable macOS Sierra tab bar (surfaced as: View > Show Tab Bar).
//
// Workaround provided by Morten Sorvig <Morten.Sorvig@qt.io>,
// http://lists.qt-project.org/pipermail/interest/2016-September/024488.html.

#import <AppKit/AppKit.h>

#if !defined(MAC_OS_X_VERSION_10_12) || \
    MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12

@interface NSWindow (SierraSDK)
+ (BOOL) allowsAutomaticWindowTabbing;
+ (BOOL) setAllowsAutomaticWindowTabbing: (BOOL) allowsAutomaticWindowTabbing;
@end

#endif

// Disables auto window tabbing where supported, otherwise a no-op.
void disableWindowTabbing()
{
    if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)]) {
        NSWindow.allowsAutomaticWindowTabbing = NO;
    }
}


#import "GameViewController.h"
#import <Metal/Metal.h>
#import <simd/simd.h>
#import <MetalKit/MetalKit.h>
#import "SharedStructures.h"
#include <Pomdog/Math/Vector3.hpp>
#include <Pomdog/Math/Vector4.hpp>
#include <Pomdog/Math/Matrix3x3.hpp>
#include <Pomdog/Math/Matrix4x4.hpp>
#include <Pomdog/Math/Quaternion.hpp>
#include <Pomdog/Math/Radian.hpp>
#include <Pomdog/Graphics/ConstantBuffer.hpp>
#include <Pomdog/Graphics/GraphicsDevice.hpp>
#include <Pomdog/Graphics/PipelineState.hpp>
#include <Pomdog/Graphics/VertexBuffer.hpp>
#include "QuickStartGame.hpp"
#include <memory>

@implementation GameViewController
{
    std::shared_ptr<Pomdog::Game> game;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)loadAssetsPomdog:(std::shared_ptr<Pomdog::GameHost>)gameHost
{
    game = std::make_shared<QuickStart::QuickStartGame>(gameHost);
    [self startGame:game];
}

@end

Remove unused include directives from example

#import "GameViewController.h"
#include "QuickStartGame.hpp"
#include <memory>

@implementation GameViewController
{
    std::shared_ptr<Pomdog::Game> game;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)loadAssetsPomdog:(std::shared_ptr<Pomdog::GameHost>)gameHost
{
    game = std::make_shared<QuickStart::QuickStartGame>(gameHost);
    [self startGame:game];
}

@end


Test that false races from ObjC's dealloc, .cxx_destruct, and initialize are ignored

// RUN: %clang_tsan %s -lc++ -fobjc-arc -lobjc -o %t -framework Foundation
// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s

// Check that we do not report races between:
// - Object retain and initialize
// - Object release and dealloc
// - Object release and .cxx_destruct

#import <Foundation/Foundation.h>
#include "../test.h"
invisible_barrier_t barrier2;

class NeedCleanup {
  public:
    int x;
    NeedCleanup() {
      x = 1;
    }
    ~NeedCleanup() {
      x = 0;
    }
};

@interface TestDeallocObject : NSObject {
  @public
    int v;
  }
  - (id)init;
  - (void)accessMember;
  - (void)dealloc;
@end

@implementation TestDeallocObject
  - (id)init {
    if ([super self]) {
      v = 1;
      return self;
    }
    return nil;
  }
  - (void)accessMember {
    int local = v;
    local++;
  }
  - (void)dealloc {
    v = 0;
  }
@end

@interface TestCXXDestructObject : NSObject {
  @public
    NeedCleanup cxxMemberWithCleanup;
  }
  - (void)accessMember;
@end

@implementation TestCXXDestructObject
  - (void)accessMember {
    int local = cxxMemberWithCleanup.x;
    local++;
  }
@end

@interface TestInitializeObject : NSObject
@end

@implementation TestInitializeObject
  static long InitializerAccessedGlobal = 0;
  + (void)initialize {
      InitializerAccessedGlobal = 42;
  }
@end

int main(int argc, const char *argv[]) {
  // Ensure that there is no race when calling initialize on TestInitializeObject;
  // otherwise, the locking from ObjC runtime becomes observable. Also ensures that
  // blocks are dispatched to 2 different threads.
  barrier_init(&barrier, 2);
  // Ensure that objects are destructed during block object release.
  barrier_init(&barrier2, 3);

  TestDeallocObject *tdo = [[TestDeallocObject alloc] init];
  TestCXXDestructObject *tcxxdo = [[TestCXXDestructObject alloc] init];
  [tdo accessMember];
  [tcxxdo accessMember];
  {
    dispatch_queue_t q = dispatch_queue_create(NULL, DISPATCH_QUEUE_CONCURRENT);
    dispatch_async(q, ^{
        [TestInitializeObject new];
        barrier_wait(&barrier);
        long local = InitializerAccessedGlobal;
        local++;
        [tdo accessMember];
        [tcxxdo accessMember];
        barrier_wait(&barrier2);
    });
    dispatch_async(q, ^{
        barrier_wait(&barrier);
        [TestInitializeObject new];
        long local = InitializerAccessedGlobal;
        local++;
        [tdo accessMember];
        [tcxxdo accessMember];
        barrier_wait(&barrier2);
    });
  }
  barrier_wait(&barrier2);
  NSLog(@"Done.");
  return 0;
}

// CHECK: Done.
// CHECK-NOT: ThreadSanitizer: data race


// RUN: %llvmgcc -fno-exceptions %s -S -emit-llvm -o - | FileCheck %s
struct Foo
{
  int x;
  Foo ();
};
Foo *test(void)
{
  return new Foo();
  // There should be no references to any Unwinding routines under -fno-exceptions.
  // CHECK-NOT: Unwind
}


// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/ios/ios_util.h"

#include "base/sys_info.h"

namespace {
// Return a 3 elements array containing the major, minor and bug fix version of
// the OS.
const int32* OSVersionAsArray() {
  int32* digits = new int32[3];
  base::SysInfo::OperatingSystemVersionNumbers(
      &digits[0], &digits[1], &digits[2]);
  return digits;
}
}  // namespace

namespace base {
namespace ios {

bool IsRunningOnIOS8OrLater() {
  return IsRunningOnOrLater(8, 0, 0);
}

bool IsRunningOnOrLater(int32 major, int32 minor, int32 bug_fix) {
  static const int32* current_version = OSVersionAsArray();
  int32 version[] = { major, minor, bug_fix };
  for (size_t i = 0; i < arraysize(version); i++) {
    if (current_version[i] != version[i])
      return current_version[i] > version[i];
  }
  return true;
}

}  // namespace ios
}  // namespace base

Add mention of iOS7-support-drop TODO list.

// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/ios/ios_util.h"

#include "base/sys_info.h"

namespace {
// Return a 3 elements array containing the major, minor and bug fix version of
// the OS.
const int32* OSVersionAsArray() {
  int32* digits = new int32[3];
  base::SysInfo::OperatingSystemVersionNumbers(
      &digits[0], &digits[1], &digits[2]);
  return digits;
}
}  // namespace

namespace base {
namespace ios {

// When dropping iOS7 support, also address issues listed in crbug.com/502968.
bool IsRunningOnIOS8OrLater() {
  return IsRunningOnOrLater(8, 0, 0);
}

bool IsRunningOnOrLater(int32 major, int32 minor, int32 bug_fix) {
  static const int32* current_version = OSVersionAsArray();
  int32 version[] = { major, minor, bug_fix };
  for (size_t i = 0; i < arraysize(version); i++) {
    if (current_version[i] != version[i])
      return current_version[i] > version[i];
  }
  return true;
}

}  // namespace ios
}  // namespace base


// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

#include "atom/browser/api/atom_api_web_contents.h"

@interface NSWindow
- (BOOL)isKeyWindow;
@end

namespace atom {

namespace api {

bool WebContents::IsFocused() const {
  if (GetType() != BACKGROUND_PAGE) {
    auto window = web_contents()->GetTopLevelNativeWindow();
    // On Mac the render widget host view does not lose focus when the window
    // loses focus so check if the top level window is the key window.
    if (window && ![window isKeyWindow])
      return false;
  }

  auto view = web_contents()->GetRenderWidgetHostView();
  return view && view->HasFocus();
}

}  // namespace api

}  // namespace atom

Return early when render widget host view is null

// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

#include "atom/browser/api/atom_api_web_contents.h"

@interface NSWindow
- (BOOL)isKeyWindow;
@end

namespace atom {

namespace api {

bool WebContents::IsFocused() const {
  auto view = web_contents()->GetRenderWidgetHostView();
  if (!view) return false;

  if (GetType() != BACKGROUND_PAGE) {
    auto window = web_contents()->GetTopLevelNativeWindow();
    // On Mac the render widget host view does not lose focus when the window
    // loses focus so check if the top level window is the key window.
    if (window && ![window isKeyWindow])
      return false;
  }

  return view->HasFocus();
}

}  // namespace api

}  // namespace atom


Add a test case, to make sure there is no crash on IRGen when using PCH

// RUN: %clang_cc1 %s -emit-pch -o %t.pch
// RUN: %clang_cc1 %s -emit-llvm %s -include-pch %t.pch -o - | FileCheck %s

#ifndef HEADER
#define HEADER

class OOArray{
public:
  ~OOArray();
};

class OOString {
public:
    OOString();
    OOString(char *);
};

class OOPattern {
public:
    OOArray matchAll(const OOString &)const {
        __attribute__((__blocks__(byref))) OOArray out;
    }
};

OOArray operator & (const OOPattern & pattern) {
    pattern.matchAll(0);
}
OOArray operator & (OOString, OOString);

#else

// We just make sure there is no crash on IRGen (rdar://13114142)
// CHECK: _Z3foov()
void foo() {
  OOString str;
  str & "o";
}

#endif


// RUN: %clang_cc1 -fsyntax-only -fobjc-gc -fobjc-nonfragile-abi -verify %s

void f0(__weak id *); // expected-note{{candidate function not viable: 1st argument ('id *') has no lifetime, but parameter has __weak lifetime}}

void test_f0(id *x) {
  f0(x); // expected-error{{no matching function for call to 'f0'}}
}

@interface A
@end

void f1(__weak id*);
void test_f1(__weak A** a) {
  f1(a);
}

@interface B : A
@end

void f2(__weak A**);
void test_f2(__weak B** b) {
  f2(b);
}

Add triple in the hope of unbreaking the bubuildbot

// RUN: %clang_cc1 -fsyntax-only -triple i386-apple-darwin9 -fobjc-gc -verify %s

void f0(__weak id *); // expected-note{{candidate function not viable: 1st argument ('id *') has no lifetime, but parameter has __weak lifetime}}

void test_f0(id *x) {
  f0(x); // expected-error{{no matching function for call to 'f0'}}
}

@interface A
@end

void f1(__weak id*);
void test_f1(__weak A** a) {
  f1(a);
}

@interface B : A
@end

void f2(__weak A**);
void test_f2(__weak B** b) {
  f2(b);
}


#include <Foundation/Foundation.h>
#include <string>

bool UrlDownload(const std::string& url, double timeout, std::string& errorMessage) {
    NSURL *nsurl = [NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]];
    NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration ephemeralSessionConfiguration]];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:nsurl cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:timeout];
    request.HTTPMethod = @"HEAD";
    __block bool success = false;
    __block bool done = false;
    NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data __unused, NSURLResponse *response, NSError *error) {
        if (error) {
            errorMessage.assign(error.localizedDescription.UTF8String);
        } else {
            NSHTTPURLResponse *httpresponse = (NSHTTPURLResponse*)response;
            const NSInteger code = httpresponse.statusCode;
            if (code != 200) {
                errorMessage.assign([NSString stringWithFormat:@"HTTP Status %ld", code].UTF8String);
            } else {
                success = true;
            }
        }
        done = true;
    }];
    [task resume];
    while (!done) {
        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
    }
    return success;
}

Move handler to a variable

#include <Foundation/Foundation.h>
#include <string>

bool UrlDownload(const std::string& url, double timeout, std::string& errorMessage) {
    NSURL *nsurl = [NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]];
    NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration ephemeralSessionConfiguration]];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:nsurl cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:timeout];
    request.HTTPMethod = @"HEAD";
    __block bool success = false;
    __block bool done = false;
    void (^handler)(NSData *, NSURLResponse *, NSError *) = ^(NSData *data __unused, NSURLResponse *response, NSError *error) {
        if (error) {
            errorMessage.assign(error.localizedDescription.UTF8String);
        } else {
            NSHTTPURLResponse *httpresponse = (NSHTTPURLResponse*)response;
            const NSInteger code = httpresponse.statusCode;
            if (code != 200) {
                errorMessage.assign([NSString stringWithFormat:@"HTTP Status %ld", code].UTF8String);
            } else {
                success = true;
            }
        }
        done = true;
    };
    [[session dataTaskWithRequest:request completionHandler:handler] resume];
    while (!done) {
        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
    }
    return success;
}


// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "chrome/browser/cocoa/toolbar_view.h"

@implementation ToolbarView

@synthesize dividerOpacity = dividerOpacity_;

// Prevent mouse down events from moving the parent window around.
- (BOOL)mouseDownCanMoveWindow {
  return NO;
}

- (void)drawRect:(NSRect)rect {
  // The toolbar's background pattern is phased relative to the
  // tab strip view's background pattern.
  NSPoint phase = [self gtm_themePatternPhase];
  [[NSGraphicsContext currentContext] setPatternPhase:phase];
  [self drawBackground];
}

// Override of |-[BackgroundGradientView strokeColor]|; make it respect opacity.
- (NSColor*)strokeColor {
  return [[super strokeColor] colorWithAlphaComponent:[self dividerOpacity]];
}

@end

Make our toolbar tell accessibility it is a toolbar.

// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "chrome/browser/cocoa/toolbar_view.h"

@implementation ToolbarView

@synthesize dividerOpacity = dividerOpacity_;

// Prevent mouse down events from moving the parent window around.
- (BOOL)mouseDownCanMoveWindow {
  return NO;
}

- (void)drawRect:(NSRect)rect {
  // The toolbar's background pattern is phased relative to the
  // tab strip view's background pattern.
  NSPoint phase = [self gtm_themePatternPhase];
  [[NSGraphicsContext currentContext] setPatternPhase:phase];
  [self drawBackground];
}

// Override of |-[BackgroundGradientView strokeColor]|; make it respect opacity.
- (NSColor*)strokeColor {
  return [[super strokeColor] colorWithAlphaComponent:[self dividerOpacity]];
}

- (BOOL)accessibilityIsIgnored {
  return NO;
}

- (id)accessibilityAttributeValue:(NSString*)attribute {
  if ([attribute isEqual:NSAccessibilityRoleAttribute])
    return NSAccessibilityToolbarRole;

  return [super accessibilityAttributeValue:attribute];
}

@end


// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "sky/shell/platform/mac/platform_view_mac.h"

#include "sky/shell/gpu/direct/surface_notifications_direct.h"

namespace sky {
namespace shell {

PlatformView* PlatformView::Create(const Config& config) {
  return new PlatformViewMac(config);
}

PlatformViewMac::PlatformViewMac(const Config& config) : PlatformView(config) {}

PlatformViewMac::~PlatformViewMac() {}

void PlatformViewMac::SurfaceCreated(gfx::AcceleratedWidget widget) {
  DCHECK(window_ == 0);
  window_ = widget;
  SurfaceNotificationsDirect::NotifyCreated(config_, window_);
}

void PlatformViewMac::SurfaceDestroyed() {
  DCHECK(window_);
  window_ = 0;
  SurfaceNotificationsDirect::NotifyDestroyed(config_);
}

}  // namespace shell
}  // namespace sky

Initialize the window_ ivar in PlatformView to gfx::kNullAcceleratedWidget

// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "sky/shell/platform/mac/platform_view_mac.h"

#include "sky/shell/gpu/direct/surface_notifications_direct.h"

namespace sky {
namespace shell {

PlatformView* PlatformView::Create(const Config& config) {
  return new PlatformViewMac(config);
}

PlatformViewMac::PlatformViewMac(const Config& config)
    : PlatformView(config), window_(gfx::kNullAcceleratedWidget) {}

PlatformViewMac::~PlatformViewMac() {}

void PlatformViewMac::SurfaceCreated(gfx::AcceleratedWidget widget) {
  DCHECK(window_ == gfx::kNullAcceleratedWidget);
  window_ = widget;
  SurfaceNotificationsDirect::NotifyCreated(config_, window_);
}

void PlatformViewMac::SurfaceDestroyed() {
  DCHECK(window_ != gfx::kNullAcceleratedWidget);
  window_ = gfx::kNullAcceleratedWidget;
  SurfaceNotificationsDirect::NotifyDestroyed(config_);
}

}  // namespace shell
}  // namespace sky


#include "MX3Snapshot.h"

#include <mx3/mx3.hpp>
#include "objc_adapter.h"
using mx3::ObjcAdapter;

@implementation MX3Snapshot {
  std::unique_ptr<mx3::SqlSnapshot> __snapshot;
}

- (instancetype) initWithSnapshot:(std::unique_ptr<mx3::SqlSnapshot>)snapshot {
  if(!(self = [super init])) {
    return nil;
  }
  // when you assign one unique_ptr to another, you have to move it because there can only ever
  // be one copy of a unique pointer at a time.  If you need to be able to "copy" pointers, use shared_ptr
  __snapshot = std::move(snapshot);
  return self;
}

- (void) dealloc {
    __snapshot = nullptr;
}

- (NSString *) rowAtIndex:(NSUInteger)index {
    auto row = __snapshot->at(static_cast<size_t>(index));
    return ObjcAdapter::convert(row);
}

- (NSUInteger) count {
    return static_cast<NSUInteger>( __snapshot->size() );
}

@end

Make init more objective-c like

#include "MX3Snapshot.h"

#include <mx3/mx3.hpp>
#include "objc_adapter.h"
using mx3::ObjcAdapter;

@implementation MX3Snapshot {
  std::unique_ptr<mx3::SqlSnapshot> __snapshot;
}

- (instancetype) initWithSnapshot:(std::unique_ptr<mx3::SqlSnapshot>)snapshot {
    self = [super init];
    if (self) {
        // when you assign one unique_ptr to another, you have to move it because there can only ever
        // be one copy of a unique pointer at a time.  If you need to be able to "copy" pointers, use shared_ptr
        __snapshot = std::move(snapshot);
    }

  return self;
}

- (void) dealloc {
    __snapshot = nullptr;
}

- (NSString *) rowAtIndex:(NSUInteger)index {
    auto row = __snapshot->at(static_cast<size_t>(index));
    return ObjcAdapter::convert(row);
}

- (NSUInteger) count {
    return static_cast<NSUInteger>( __snapshot->size() );
}

@end


// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <string>

#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/sync/one_click_signin_dialog.h"

void ShowOneClickSigninDialog(Profile* profile,
                              const std::string& email,
                              const std::string& password) {
  // TODO(rogerta): cocoa dialog not yet implemented.  See
  // one_click_signin_dialog_view.cc for what needs to be done here.
}

Update signature of ShowOneClickSigninDialog() to match declaration.

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <string>

#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/sync/one_click_signin_dialog.h"

void ShowOneClickSigninDialog(Profile* profile,
                              const std::string& session_index,
                              const std::string& email,
                              const std::string& password) {
  // TODO(rogerta): cocoa dialog not yet implemented.  See
  // one_click_signin_dialog_view.cc for what needs to be done here.
}


#import "FrispSocial.h"

@implementation FrispSocial

 static FrispSocial * _instance = [[FrispSocial alloc] init];

+ (id) instance {
    return _instance;
}

- (void) share:(NSString *)text  media:(NSString *)media {
  UIActivityViewController *socialViewController;

  // Create image from image data
  NSData *imageData = [[NSData alloc] initWithBase64EncodedString:media options: 0];
  UIImage *image = [[UIImage alloc] initWithData:imageData];

  socialViewController = [[UIActivityViewController alloc] initWithActivityItems:@[text, image] applicationActivities:nil];

  UIViewController *rootViewController =  UnityGetGLViewController();

  [rootViewController presentViewController:socialViewController animated:YES completion:nil];
}

extern "C" {
  void _Share(char* text, char* encodedMedia) {
    NSString *status = [NSString stringWithUTF8String: text];
    NSString *media = [NSString stringWithUTF8String: encodedMedia];

    [[FrispSocial instance] share:status media:media];
  }
}

@end

Support iPad for iOS8 +

#import "FrispSocial.h"

@implementation FrispSocial

 static FrispSocial * _instance = [[FrispSocial alloc] init];

+ (id) instance {
    return _instance;
}

- (void) share:(NSString *)text  media:(NSString *)media {
  UIActivityViewController *socialViewController;

  // Create image from image data
  NSData *imageData = [[NSData alloc] initWithBase64EncodedString:media options: 0];
  UIImage *image = [[UIImage alloc] initWithData:imageData];

  socialViewController = [[UIActivityViewController alloc] initWithActivityItems:@[text, image] applicationActivities:nil];

  UIViewController *rootViewController =  UnityGetGLViewController();

  if ([socialViewController respondsToSelector:@selector(popoverPresentationController)]) {
    // IOS8 iPad
    UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:socialViewController];
    [popup presentPopoverFromRect:CGRectMake(rootViewController.view.frame.size.width/2, rootViewController.view.frame.size.height/4, 0, 0)inView:rootViewController.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
  } else {
        [rootViewController presentViewController:socialViewController animated:YES completion:nil];
  }
}

extern "C" {
  void _Share(char* text, char* encodedMedia) {
    NSString *status = [NSString stringWithUTF8String: text];
    NSString *media = [NSString stringWithUTF8String: encodedMedia];

    [[FrispSocial instance] share:status media:media];
  }
}

@end


/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#import "SkSampleNSView.h"
#include "SampleApp.h"
@implementation SkSampleNSView

- (id)initWithDefaults {
    if (self = [super initWithDefaults]) {
        fWind = new SampleWindow(self, NULL, NULL, NULL);
    }
    return self;
}

- (void)dealloc {
    delete fWind;
    [super dealloc];
}

- (void)swipeWithEvent:(NSEvent *)event {
    CGFloat x = [event deltaX];
    if (x < 0)
        ((SampleWindow*)fWind)->previousSample();
    else if (x > 0)
        ((SampleWindow*)fWind)->nextSample();
    else
        ((SampleWindow*)fWind)->showOverview();
}

@end

Fix cmdline argument passing in SampleApp/Mac.

/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#import "SkSampleNSView.h"
#include "SampleApp.h"
#include <crt_externs.h>
@implementation SkSampleNSView

- (id)initWithDefaults {
    if (self = [super initWithDefaults]) {
        fWind = new SampleWindow(self, *_NSGetArgc(), *_NSGetArgv(), NULL);
    }
    return self;
}

- (void)dealloc {
    delete fWind;
    [super dealloc];
}

- (void)swipeWithEvent:(NSEvent *)event {
    CGFloat x = [event deltaX];
    if (x < 0)
        ((SampleWindow*)fWind)->previousSample();
    else if (x > 0)
        ((SampleWindow*)fWind)->nextSample();
    else
        ((SampleWindow*)fWind)->showOverview();
}

@end


Test to compile the rewritten file for my last patch. (radar 7649577 related).

// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
// RUN: %clang_cc1 -DSEL="void *" -S %t-rw.cpp
// radar 7649577

@interface a
@end

@interface b : a
@end

@implementation b
@end


Add test case for <rdar://problem/8288645>. While this is fixed in trunk, we previously were getting the following assertion failure not too long ago:

// RUN: c-index-test -test-load-source all %s 2>&1 | FileCheck %s

// This test case previously crashed Sema.

extern "C" { @implementation Foo  - (id)initWithBar:(Baz<WozBar>)pepper {

// CHECK: warning: cannot find interface declaration for 'Foo'
// CHECK: warning: '@end' is missing in implementation context