]*>.*')
tag_match5 = re.compile(r'.*
]*>.*')
index_match = re.compile(r'.*
]*>[\d\.\s]*(?P[^<]+)
.*')
index_match2 = re.compile(r'.*
]*>[\d\.\s]*(?P[^<]+)<.*')
tag = "top"
has_h2 = False
has_h3 = False
has_h4 = False
#pat_match = re.compile(r'.*(?P[.]+)$')
with open(name + ".html", 'rt') as fin:
with open(name + ".qhp", 'wt') as f:
f.write('\n')
f.write('\n')
f.write(' octave.community.{}\n'.format(name))
f.write(' doc\n')
f.write(' \n')
f.write(' \n')
f.write(' \n'.format(title, name))
# chapters here
for line in fin:
line = line.strip()
e = tag_match1.match(line)
if not e:
e = tag_match2.match(line)
if not e:
e = tag_match3.match(line)
if not e:
e = tag_match4.match(line)
if not e:
e = tag_match5.match(line)
if e:
tag = e.group("tag")
e = h2_match.match(line)
if not e:
e = h2a_match.match(line)
if not e:
e = h2i_match.match(line)
if e:
if has_h4:
f.write(' \n')
has_h4 = False
if has_h3:
f.write(' \n')
has_h3 = False
if has_h2:
f.write(' \n')
has_h2 = True
f.write(' \n'.format(e.group("title"), name, tag))
e = h3_match.match(line)
if e:
if has_h4:
f.write(' \n')
has_h4 = False
if has_h3:
f.write(' \n')
has_h3 = True
f.write(' \n'.format(e.group("title"), name, tag))
e = h4_match.match(line)
if e:
if has_h4:
f.write(' \n')
has_h4 = True
#f.write(' \n'.format(e.group("title"), name, tag))
f.write(' \n'.format(e.group("title"), name, tag))
e = h5_match.match(line)
if e:
f.write(' \n'.format(e.group("title"), name, tag))
if has_h4:
f.write(' \n')
if has_h3:
f.write(' \n')
if has_h2:
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
fin.seek(0)
for line in fin:
line = line.strip()
e = tag_match1.match(line)
if not e:
e = tag_match2.match(line)
if e:
tag = e.group("tag")
e = index_match.match(line)
if not e:
e = index_match2.match(line)
if e:
f.write(' \n'.format(e.group("name"), name, tag))
f.write(' \n')
f.write(' \n')
f.write(' {}.html\n'.format(name))
f.write(' {}.css\n'.format(name))
f.write(' \n')
f.write(' \n')
f.write('\n')
def show_usage():
print (sys.argv[0], "projname")
if __name__ == "__main__":
if len(sys.argv) > 1:
status = process(sys.argv[1])
sys.exit(status)
else:
show_usage()
gnu-octave-octave-zeromq-ffe3cf0/doc/zeromq.css 0000664 0000000 0000000 00000001337 15127471011 0021731 0 ustar 00root root 0000000 0000000 pre.example, .header, .float-caption, hr {
/* base00 ~ body text in light solarized theme */
color: #657b83;
border-color: #657b83; }
pre.example {
/* base3 ~Â background color in light solarized theme */
background-color: #fdf6e3;
padding: 0.5em; }
table.cartouche {
border: 1px solid #948473;
background-color: #FFE3C6;
width: 100%;
}
table.cartouche td, table.cartouche th {
border: 1px solid #948473;
padding: 4px 4px;
}
/* newer texinfo generation styles */
div.example {
/* base00 ~ body text in light solarized theme */
color: #657b83;
border-color: #657b83; }
pre.example-preformatted {
/* base3 ~Â background color in light solarized theme */
background-color: #fdf6e3;
padding: 0.5em; }
gnu-octave-octave-zeromq-ffe3cf0/doc/zeromq.texi 0000664 0000000 0000000 00000016226 15127471011 0022115 0 ustar 00root root 0000000 0000000 \input texinfo @c -*-texinfo-*-
@c Copyright (c) 2019-2026, John Donoghue
@c Octave ZeroMQ - ZeroMQ bindings for GNU octave.
@c For manually generating the documentation use
@c LANGUAGE=en makeinfo --html --no-split zeromq.texi
@c %*** Start of HEADER
@setfilename zeromq.info
@settitle Octave ZeroMQ - ZeroMQ bindings for GNU octave
@afourpaper
@paragraphindent 0
@finalout
@c @afourwide
@c %*** End of the HEADER
@include version.texi
@include macros.texi
@c %*** Start of TITLEPAGE
@titlepage
@title ZeroMQ Toolkit @value{VERSION}
@subtitle ZeroMQ bindings for @acronym{GNU} Octave.
@author John Donoghue
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 2019-2026 John Donoghue
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the same conditions as for modified versions.
@page
@heading Distribution
The @acronym{GNU} Octave ZeroMQ package is @dfn{free} software.
Free software is a matter of the users' freedom to run, copy, distribute,
study, change and improve the software.
This means that everyone is free to use it and free to redistribute it
on certain conditions. The @acronym{GNU} Octave ZeroMQ package
is not, however, in the public domain. It is copyrighted and there are
restrictions on its distribution, but the restrictions are designed to
ensure that others will have the same freedom to use and redistribute
Octave that you have. The precise conditions can be found in the
@acronym{GNU} General Public License that comes with the @acronym{GNU}
Octave ZeroMQ package and that also appears in @ref{Copying}.
To download a copy of the @acronym{GNU} Octave zeromq package, please visit
@url{https://gnu-octave.github.io/octave-zeromq/}.
@end titlepage
@c %*** End of TITLEPAGE
@dircategory Math
@direntry
* Octave ZeroMQ: (zeromq). ZeroMQ Toolkit for Octave
@end direntry
@c %*** Start of BODY
@contents
@ifnottex
@node Top
@top Introduction
The ZeroMQ toolkit is a set of ZeroMQ bindings for GNU Octave
@end ifnottex
@menu
* Installing and loading:: Installing and loading the ZeroMQ toolkit
* Basic Usage Overview:: Basic Usage Overview
* Examples:: Examples using the ZeroMQ toolkit
* Function Reference:: ZeroMQ toolkit functions
* Copying:: Copying
* Index:: Index
@end menu
@c -------------------------------------------------------------------------
@node Installing and loading
@chapter Installing and loading
@cindex Installing and loading
The ZeroMQ toolkit must be installed and then loaded to be used.
It can be installed in @acronym{GNU} Octave directly from octave-forge,
or can be installed in an off-line mode via a downloaded tarball.
The toolkit has a dependency on the zeromq library (@url{https://zeromq.org}), so it must be installed in order
to successfully install the ZeroMQ toolkit.
For Fedora: @code{yum install zeromq-devel}
For Ubuntu: @code{apt install libzmq-dev}
The toolkit must be then be loaded once per each @acronym{GNU} Octave session in order to use its functionality.
@section Online Direct install
@cindex Online install
With an internet connection available, the ZeroMQ package can be installed from
octave-forge using the following command within @acronym{GNU} Octave:
@example
pkg install -forge zeromq
@end example
The latest released version of the toolkit will be downloaded and installed.
@section Off-line install
@cindex Off-line install
With the ZeroMQ toolkit package already downloaded, and in the current directory when running
@acronym{GNU} Octave, the package can be installed using the following command within @acronym{GNU} Octave:
@example
pkg install zeromq-@value{VERSION}.tar.gz
@end example
@section Loading
@cindex Loading
Regardless of the method of installing the ZeroMQ toolkit, in order to use its functions,
the toolkit must be loaded using the pkg load command:
@example
pkg load zeromq
@end example
The toolkit must be loaded on each @acronym{GNU} Octave session.
@c -------------------------------------------------------------------------
@node Basic Usage Overview
@chapter Basic Usage Overview
@cindex Basic Usage Overview
The usage is very close to the ZeroMQ library C language bindings for the socket
creation and manipulation with the exception of creating a zeromq context,
which is automatically done in the bindings internals.
For example, a basic client that does a request / reply from a server on port
local port 5555 (available as zmq_example1.m):
@example
%% Create socket and connect to server
requester = zmq_socket (ZMQ_REQ);
zmq_connect (requester, "tcp://localhost:5555");
%% send some data
zmq_send (requester, uint8("Hello"), 5, 0);
%% try to read up to 10 bytes of reply data.
received = zmq_recv (requester, 10, 0);
zmq_close (requester);
@end example
An overview of the package can be displayed by running @code{help zeromq}
Help for each function can be displayed by @code{help thefunctionname}
ie:
@example
help iszmq
@end example
@c -------------------------------------------------------------------------
@node Examples
@chapter Examples
@cindex Examples
There are several examples that come with the toolkit.
View example code using @code{edit examples/example_name}
ie:
@example
edit examples/zmq_example1
@end example
@section Example1
@cindex Example1
Simple client REQ socket example that attempts to connect to a server and
send a hello command and get back the response.
@example
edit examples/zmq_example1
@end example
@section Example2
@cindex Example2
Simple server REP socket example that creates the server that the client
from example 1 will connect to and responds back to client 'requests'
@example
edit examples/zmq_example2
@end example
@section Example3
@cindex Example3
Simple server PUB socket example that creates 'weather' server sends
weather updates for random zip codes.
@example
edit examples/zmq_example3
@end example
@section Example4
@cindex Example4
Simple client SUB socket example that creates client that connects to the 'weather'
server and subscribes for weather updates from zip-code 10001.
@example
edit examples/zmq_example4
@end example
@section Example5
@cindex Example5
Simple client STREAM socket example that creates client that connects to octave.org
and posts HEAD request.
@example
edit examples/zmq_example5
@end example
@c -------------------------------------------------------------------------
@node Function Reference
@chapter Function Reference
@cindex Function Reference
The functions currently available in the ZeroMQ toolkit are described below;
@include functions.texi
@c -------------------------------------------------------------------------
@include gpl.texi
@c -------------------------------------------------------------------------
@node Index
@unnumbered Index
@printindex cp
@bye
gnu-octave-octave-zeromq-ffe3cf0/inst/ 0000775 0000000 0000000 00000000000 15127471011 0020106 5 ustar 00root root 0000000 0000000 gnu-octave-octave-zeromq-ffe3cf0/inst/@octave_zeromq_socket/ 0000775 0000000 0000000 00000000000 15127471011 0024434 5 ustar 00root root 0000000 0000000 gnu-octave-octave-zeromq-ffe3cf0/inst/@octave_zeromq_socket/close.m 0000664 0000000 0000000 00000002051 15127471011 0025715 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} close (@var{s})
## Close the ZeroMQ socket represented by the object @var{s}.
##
## @var{s} is an ZeroMQ socket object returned by the @code{zmq_socket}
## function.
## @end deftypefn
function close (s)
zmq_close(s);
endfunction
%!test
%! server = zmq_socket(ZMQ_PUB);
%! close (server);
gnu-octave-octave-zeromq-ffe3cf0/inst/@octave_zeromq_socket/get.m 0000664 0000000 0000000 00000002674 15127471011 0025402 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2017-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {@var{value} =} get (@var{s}, @var{prop})
## @deftypefnx {} {} get (@var{s})
## get property @var{prop} from a ZeroMQ socket represented by the object @var{s}.
##
## @var{s} is an ZeroMQ socket object returned by the @code{zmq_socket}
## @var{prop} is a valid ZeroMQ socket property name. If prop is not provided, it
## will get all properties of @var{s}
## @end deftypefn
function output = get (varargin)
if (nargin < 1 || nargin > 2)
print_usage ();
endif
output = __zmq_properties__ (varargin{:});
endfunction
%!test
%! server = zmq_socket(ZMQ_PUB);
%! props = get(server);
%! assert(props.type, "ZMQ_PUB")
%!
%! assert(get(server, "type"), "ZMQ_PUB")
%!
%! zmq_close (server);
gnu-octave-octave-zeromq-ffe3cf0/inst/@octave_zeromq_socket/set.m 0000664 0000000 0000000 00000003304 15127471011 0025405 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2017-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} get (@var{s}, @var{prop}, @var{value} [, ...])
## set property @var{prop} to @var{value} from a ZeroMQ socket represented by
## the object @var{s}.
##
## @var{s} is an ZeroMQ socket object returned by the @code{zmq_socket}
## @var{prop} is a valid ZeroMQ socket property name.
## @var{value} is the value to set the property to.
##
## Multiple @var{prop} @var{value} pairs can be provided at a time.
## @end deftypefn
function output = set (s, varargin)
if (nargin < 3)
print_usage ();
endif
if ( rem (numel (varargin), 2) != 0)
error ("@octave_zeromq_socket/set: expecting PROPERTY/VALUE pairs");
endif
output = s;
while (numel (varargin) > 1)
prop = varargin{1};
val = varargin{2};
varargin(1:2) = [];
__zmq_properties__ (s, prop, val);
endwhile
endfunction
%!test
%! a = zmq_socket();
%! id = uint8([ 1, 2, 3 ]);
%! set(a, "identity", id);
%! assert(__zmq_properties__(a, "identity"), id);
%! zmq_close(a);
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_BACKLOG.m 0000664 0000000 0000000 00000002061 15127471011 0022054 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2022 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_BACKLOG
##
## Constant for getsockopt and setsockopt to set backlog for pending connections
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_BACKLOG ()
v = __ZMQ_OPT_BACKLOG;
endfunction
%!assert (ZMQ_BACKLOG, __ZMQ_OPT_BACKLOG)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_CONNECT_TIMEOUT.m 0000664 0000000 0000000 00000002071 15127471011 0023312 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_CONNECT_TIMEOUT
##
## Constant for get/setsockopt connect timeout value
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_CONNECT_TIMEOUT ()
v = __ZMQ_OPT_CONNECT_TIMEOUT;
endfunction
%!assert (ZMQ_CONNECT_TIMEOUT, __ZMQ_OPT_CONNECT_TIMEOUT)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_CURVE.m 0000664 0000000 0000000 00000002012 15127471011 0021672 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_CURVE
##
## Constant value for getsockopt MECHANISM value option
##
## @seealso{zmq_getsockopt}
## @end deftypefn
function v = ZMQ_CURVE ()
v = __ZMQ_MECHANISM_CURVE;
endfunction
%!assert (ZMQ_CURVE, __ZMQ_MECHANISM_CURVE)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_CURVE_PUBLICKEY.m 0000664 0000000 0000000 00000002117 15127471011 0023307 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_CURVE_PUBLICKEY
##
## Constant for getsockopt and setsockopt CURVE_PUBLICKEY value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_CURVE_PUBLICKEY ()
v = __ZMQ_OPT_CURVE_PUBLICKEY;
endfunction
%!assert (ZMQ_CURVE_PUBLICKEY, __ZMQ_OPT_CURVE_PUBLICKEY)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_CURVE_SECRETKEY.m 0000664 0000000 0000000 00000002121 15127471011 0023311 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_CURVE_PRIVATEKEY
##
## Constant for getsockopt and setsockopt CURVE_PRIVATEKEY value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_CURVE_SECRETKEY ()
v = __ZMQ_OPT_CURVE_SECRETKEY;
endfunction
%!assert (ZMQ_CURVE_SECRETKEY, __ZMQ_OPT_CURVE_SECRETKEY)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_CURVE_SERVER.m 0000664 0000000 0000000 00000002075 15127471011 0022771 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_CURVE_SERVER
##
## Constant for getsockopt and setsockopt CURVE_SERVER value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_CURVE_SERVER ()
v = __ZMQ_OPT_CURVE_SERVER;
endfunction
%!assert (ZMQ_CURVE_SERVER, __ZMQ_OPT_CURVE_SERVER)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_CURVE_SERVERKEY.m 0000664 0000000 0000000 00000002117 15127471011 0023337 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_CURVE_SERVERKEY
##
## Constant for getsockopt and setsockopt CURVE_SERVERKEY value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_CURVE_SERVERKEY ()
v = __ZMQ_OPT_CURVE_SERVERKEY;
endfunction
%!assert (ZMQ_CURVE_SERVERKEY, __ZMQ_OPT_CURVE_SERVERKEY)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_DEALER.m 0000664 0000000 0000000 00000001762 15127471011 0021755 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_DEALER
##
## Constant for dealer socket type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_DEALER ()
v = __ZMQ_SOCK_DEALER;
endfunction
%!assert (ZMQ_DEALER, __ZMQ_SOCK_DEALER)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_DONTWAIT.m 0000664 0000000 0000000 00000001771 15127471011 0022252 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_DONTWAIT
##
## Constant for recv flag DONTWAIT
##
## @seealso{zmq_recv}
## @end deftypefn
function v = ZMQ_DONTWAIT ()
v = __ZMQ_FLAG_DONTWAIT;
endfunction
%!assert (ZMQ_DONTWAIT, __ZMQ_FLAG_DONTWAIT)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_EVENTS.m 0000664 0000000 0000000 00000001777 15127471011 0022033 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_EVENTS
##
## Constant for getsockopt EVENTS value option
##
## @seealso{zmq_getsockopt}
## @end deftypefn
function v = ZMQ_EVENTS ()
v = __ZMQ_OPT_EVENTS;
endfunction
%!assert (ZMQ_EVENTS, __ZMQ_OPT_EVENTS)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_GSSAPI.m 0000664 0000000 0000000 00000002017 15127471011 0022001 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_GSSAPI
##
## Constant value for getsockopt MECHANISM value option
##
## @seealso{zmq_getsockopt}
## @end deftypefn
function v = ZMQ_GSSAPI ()
v = __ZMQ_MECHANISM_GSSAPI;
endfunction
%!assert (ZMQ_GSSAPI, __ZMQ_MECHANISM_GSSAPI)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_GSSAPI_PLAINTEXT.m 0000664 0000000 0000000 00000002125 15127471011 0023431 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_GSSAPI_PLAINTEXT
##
## Constant for getsockopt and setsockopt GSSAPI_PLAINTEXT value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_GSSAPI_PLAINTEXT ()
v = __ZMQ_OPT_GSSAPI_PLAINTEXT;
endfunction
%!assert (ZMQ_GSSAPI_PLAINTEXT, __ZMQ_OPT_GSSAPI_PLAINTEXT)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_GSSAPI_PRINCIPAL.m 0000664 0000000 0000000 00000002125 15127471011 0023402 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_GSSAPI_PRINCIPAL
##
## Constant for getsockopt and setsockopt GSSAPI_PRINCIPAL value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_GSSAPI_PRINCIPAL ()
v = __ZMQ_OPT_GSSAPI_PRINCIPAL;
endfunction
%!assert (ZMQ_GSSAPI_PRINCIPAL, __ZMQ_OPT_GSSAPI_PRINCIPAL)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_GSSAPI_SERVER.m 0000664 0000000 0000000 00000002103 15127471011 0023063 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_GSSAPI_SERVER
##
## Constant for getsockopt and setsockopt GSSAPI_SERVER value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_GSSAPI_SERVER ()
v = __ZMQ_OPT_GSSAPI_SERVER;
endfunction
%!assert (ZMQ_GSSAPI_SERVER, __ZMQ_OPT_GSSAPI_SERVER)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_GSSAPI_SERVICE_PRINCIPAL.m 0000664 0000000 0000000 00000002205 15127471011 0024561 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_GSSAPI_SERVICE_PRINCIPAL
##
## Constant for getsockopt and setsockopt GSSAPI_SERVICE_PRINCIPAL value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_GSSAPI_SERVICE_PRINCIPAL ()
v = __ZMQ_OPT_GSSAPI_SERVICE_PRINCIPAL;
endfunction
%!assert (ZMQ_GSSAPI_SERVICE_PRINCIPAL, __ZMQ_OPT_GSSAPI_SERVICE_PRINCIPAL)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_IDENTITY.m 0000664 0000000 0000000 00000002051 15127471011 0022242 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_IDENITY
##
## Constant for getsockopt and setsockopt IDENTITY value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_IDENTITY ()
v = __ZMQ_OPT_IDENTITY;
endfunction
%!assert (ZMQ_IDENTITY, __ZMQ_OPT_IDENTITY)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_LAST_ENDPOINT.m 0000664 0000000 0000000 00000002040 15127471011 0023052 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_LAST_ENDPOINT
##
## Constant for getsockopt last endpoint value option
##
## @seealso{zmq_getsockopt}
## @end deftypefn
function v = ZMQ_LAST_ENDPOINT ()
v = __ZMQ_OPT_LAST_ENDPOINT;
endfunction
%!assert (ZMQ_LAST_ENDPOINT, __ZMQ_OPT_LAST_ENDPOINT)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_MECHANISM.m 0000664 0000000 0000000 00000002053 15127471011 0022317 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_MECHANISM
##
## Constant for getsockopt and setsockopt MECHANISM value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_MECHANISM ()
v = __ZMQ_OPT_MECHANISM;
endfunction
%!assert (ZMQ_MECHANISM, __ZMQ_OPT_MECHANISM)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_NULL.m 0000664 0000000 0000000 00000002005 15127471011 0021562 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_NULL
##
## Constant value for getsockopt MECHANISM value option
##
## @seealso{zmq_getsockopt}
## @end deftypefn
function v = ZMQ_NULL ()
v = __ZMQ_MECHANISM_NULL;
endfunction
%!assert (ZMQ_NULL, __ZMQ_MECHANISM_NULL)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_PAIR.m 0000664 0000000 0000000 00000001746 15127471011 0021556 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_PAIR
##
## Constant for pair socket type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_PAIR ()
v = __ZMQ_SOCK_PAIR;
endfunction
%!assert (ZMQ_PAIR, __ZMQ_SOCK_PAIR)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_PLAIN.m 0000664 0000000 0000000 00000002012 15127471011 0021651 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_PLAIN
##
## Constant value for getsockopt MECHANISM value option
##
## @seealso{zmq_getsockopt}
## @end deftypefn
function v = ZMQ_PLAIN ()
v = __ZMQ_MECHANISM_PLAIN;
endfunction
%!assert (ZMQ_PLAIN, __ZMQ_MECHANISM_PLAIN)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_PLAIN_PASSWORD.m 0000664 0000000 0000000 00000002111 15127471011 0023173 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_PLAIN_PASSWORD
##
## Constant for getsockopt and setsockopt PLAIN_PASSWORD value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_PLAIN_PASSWORD ()
v = __ZMQ_OPT_PLAIN_PASSWORD;
endfunction
%!assert (ZMQ_PLAIN_PASSWORD, __ZMQ_OPT_PLAIN_PASSWORD)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_PLAIN_SERVER.m 0000664 0000000 0000000 00000002075 15127471011 0022750 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_PLAIN_SERVER
##
## Constant for getsockopt and setsockopt PLAIN_SERVER value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_PLAIN_SERVER ()
v = __ZMQ_OPT_PLAIN_SERVER;
endfunction
%!assert (ZMQ_PLAIN_SERVER, __ZMQ_OPT_PLAIN_SERVER)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_PLAIN_USERNAME.m 0000664 0000000 0000000 00000002111 15127471011 0023150 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_PLAIN_USERNAME
##
## Constant for getsockopt and setsockopt PLAIN_USERNAME value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_PLAIN_USERNAME ()
v = __ZMQ_OPT_PLAIN_USERNAME;
endfunction
%!assert (ZMQ_PLAIN_USERNAME, __ZMQ_OPT_PLAIN_USERNAME)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_POLLIN.m 0000664 0000000 0000000 00000002021 15127471011 0022003 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_POLLIN
##
## Constant bitmask value for getsockopt EVENTS value option
##
## @seealso{zmq_getsockopt}
## @end deftypefn
function v = ZMQ_POLLIN ()
v = __ZMQ_EVENT_POLLIN;
endfunction
%!assert (ZMQ_POLLIN, __ZMQ_EVENT_POLLIN)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_POLLOUT.m 0000664 0000000 0000000 00000002026 15127471011 0022151 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_POLLOUT
##
## Constant bitmask value for getsockopt EVENTS value option
##
## @seealso{zmq_getsockopt}
## @end deftypefn
function v = ZMQ_POLLOUT ()
v = __ZMQ_EVENT_POLLOUT;
endfunction
%!assert (ZMQ_POLLOUT, __ZMQ_EVENT_POLLOUT)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_PRIORITY.m 0000664 0000000 0000000 00000002073 15127471011 0022276 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2022 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_PRIORITY
##
## Constant for getsockopt and setsockopt SO_PRIORITY value option
## in linux only.
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_PRIORITY ()
v = __ZMQ_OPT_PRIORITY;
endfunction
%!assert (ZMQ_PRIORITY, __ZMQ_OPT_PRIORITY)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_PUB.m 0000664 0000000 0000000 00000001737 15127471011 0021451 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_PUB
##
## Constant for publisher type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_PUB ()
v = __ZMQ_SOCK_PUB;
endfunction
%!assert (ZMQ_PUB, __ZMQ_SOCK_PUB)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_PULL.m 0000664 0000000 0000000 00000001746 15127471011 0021577 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_PULL
##
## Constant for pull socket type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_PULL ()
v = __ZMQ_SOCK_PULL;
endfunction
%!assert (ZMQ_PULL, __ZMQ_SOCK_PULL)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_PUSH.m 0000664 0000000 0000000 00000001746 15127471011 0021602 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_PUSH
##
## Constant for push socket type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_PUSH ()
v = __ZMQ_SOCK_PUSH;
endfunction
%!assert (ZMQ_PUSH, __ZMQ_SOCK_PUSH)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_RATE.m 0000664 0000000 0000000 00000002104 15127471011 0021543 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2022 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_RATE
##
## Constant for getsockopt and setsockopt value option
##
## Sets the data rate of multicast sockets in kilobits
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_RATE ()
v = __ZMQ_OPT_RATE;
endfunction
%!assert (ZMQ_RATE, __ZMQ_OPT_RATE)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_RCVMORE.m 0000664 0000000 0000000 00000002005 15127471011 0022125 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_RCVMORE
##
## Constant for getsockopt RCVMORE value option
##
## @seealso{zmq_getsockopt}
## @end deftypefn
function v = ZMQ_RCVMORE ()
v = __ZMQ_OPT_RCVMORE;
endfunction
%!assert (ZMQ_RCVMORE, __ZMQ_OPT_RCVMORE)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_REP.m 0000664 0000000 0000000 00000001742 15127471011 0021445 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_REP
##
## Constant for reply socket type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_REP ()
v = __ZMQ_SOCK_REP;
endfunction
%!assert (ZMQ_REP, __ZMQ_SOCK_REP)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_REQ.m 0000664 0000000 0000000 00000001744 15127471011 0021450 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_REQ
##
## Constant for request socket type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_REQ ()
v = __ZMQ_SOCK_REQ;
endfunction
%!assert (ZMQ_REQ, __ZMQ_SOCK_REQ)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_ROUTER.m 0000664 0000000 0000000 00000001762 15127471011 0022041 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_ROUTER
##
## Constant for router socket type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_ROUTER ()
v = __ZMQ_SOCK_ROUTER;
endfunction
%!assert (ZMQ_ROUTER, __ZMQ_SOCK_ROUTER)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_ROUTING_ID.m 0000664 0000000 0000000 00000002057 15127471011 0022522 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2022 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_ROUTING_ID
##
## Constant for getsockopt and setsockopt IDENTITY value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_ROUTING_ID ()
v = __ZMQ_OPT_ROUTING_ID;
endfunction
%!assert (ZMQ_ROUTING_ID, __ZMQ_OPT_ROUTING_ID)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_SNDMORE.m 0000664 0000000 0000000 00000001763 15127471011 0022131 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_SNDMORE
##
## Constant for send flag SNDMORE
##
## @seealso{zmq_send}
## @end deftypefn
function v = ZMQ_SNDMORE ()
v = __ZMQ_FLAG_SNDMORE;
endfunction
%!assert (ZMQ_SNDMORE, __ZMQ_FLAG_SNDMORE)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_SOCKS_PROXY.m 0000664 0000000 0000000 00000002067 15127471011 0022703 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_SOCKS_PROXY
##
## Constant for getsockopt and setsockopt SOCKS_PROXY value option
##
## @seealso{zmq_getsockopt, zmq_setsockopt}
## @end deftypefn
function v = ZMQ_SOCKS_PROXY ()
v = __ZMQ_OPT_SOCKS_PROXY;
endfunction
%!assert (ZMQ_SOCKS_PROXY, __ZMQ_OPT_SOCKS_PROXY)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_STREAM.m 0000664 0000000 0000000 00000001755 15127471011 0022016 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_STREAM
##
## Constant for stream socket type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_STREAM ()
v = __ZMQ_SOCK_STREAM;
endfunction
%!assert (ZMQ_STREAM, __ZMQ_SOCK_STREAM)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_SUB.m 0000664 0000000 0000000 00000001740 15127471011 0021446 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_SUB
##
## Constant for subscriber type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_SUB ()
v = __ZMQ_SOCK_SUB;
endfunction
%!assert (ZMQ_SUB, __ZMQ_SOCK_SUB)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_SUBSCRIBE.m 0000664 0000000 0000000 00000002034 15127471011 0022333 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_SUBSCRIBE
##
## Constant for setsockopt subscribe option
##
## @seealso{zmq_setsockopt, ZMQ_UNSUBSCRIBE}
## @end deftypefn
function v = ZMQ_SUBSCRIBE ()
v = __ZMQ_OPT_SUBSCRIBE;
endfunction
%!assert (ZMQ_SUBSCRIBE, __ZMQ_OPT_SUBSCRIBE)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_TYPE.m 0000664 0000000 0000000 00000002132 15127471011 0021572 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_TYPE
##
## Constant for getsockopt TYPE value option
##
## @seealso{zmq_getsockopt}
## @end deftypefn
function v = ZMQ_TYPE ()
v = __ZMQ_OPT_TYPE;
endfunction
%!assert (ZMQ_TYPE, __ZMQ_OPT_TYPE)
%!test
% s = zmq_socket(ZMQ_SUB);
% assert(zmq_getsockopt(s, ZMQ_TYPE), ZMQ_SUB)
% zmq_close(s);
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_UNSUBSCRIBE.m 0000664 0000000 0000000 00000002046 15127471011 0022601 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_UNSUBSCRIBE
##
## Constant for setsockopt unsubscribe option
##
## @seealso{zmq_setsockopt, ZMQ_SUBSCRIBE}
## @end deftypefn
function v = ZMQ_UNSUBSCRIBE ()
v = __ZMQ_OPT_UNSUBSCRIBE;
endfunction
%!assert (ZMQ_UNSUBSCRIBE, __ZMQ_OPT_UNSUBSCRIBE)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_XPUB.m 0000664 0000000 0000000 00000001744 15127471011 0021577 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_XPUB
##
## Constant for publisher type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_XPUB ()
v = __ZMQ_SOCK_XPUB;
endfunction
%!assert (ZMQ_XPUB, __ZMQ_SOCK_XPUB)
gnu-octave-octave-zeromq-ffe3cf0/inst/ZMQ_XSUB.m 0000664 0000000 0000000 00000001745 15127471011 0021603 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} ZMQ_XSUB
##
## Constant for subscriber type.
##
## @seealso{zmq_socket}
## @end deftypefn
function v = ZMQ_XSUB ()
v = __ZMQ_SOCK_XSUB;
endfunction
%!assert (ZMQ_XSUB, __ZMQ_SOCK_XSUB)
gnu-octave-octave-zeromq-ffe3cf0/inst/__load_zeromq__.m 0000664 0000000 0000000 00000002650 15127471011 0023377 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2023 John Donoghue
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 3 of the
## License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} __load_zeromq__ ()
## Undocumented internal function of zeromq package.
## @end deftypefn
## PKG_ADD: __load_zeromq__ ()
function __load_zeromq__ ()
# on package load, attempt to load docs
try
pkg_dir = fileparts (fullfile (mfilename ("fullpath")));
doc_file = fullfile (pkg_dir, "doc", "zeromq.qch");
doc_file = strrep (doc_file, '\', '/');
if exist(doc_file, "file")
if exist("__event_manager_register_documentation__")
__event_manager_register_documentation__ (doc_file);
elseif exist("__event_manager_register_doc__")
__event_manager_register_doc__ (doc_file);
endif
endif
catch
# do nothing
end_try_catch
endfunction
gnu-octave-octave-zeromq-ffe3cf0/inst/__unload_zeromq__.m 0000664 0000000 0000000 00000002672 15127471011 0023746 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2023 John Donoghue
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 3 of the
## License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} __unload_zeromq__ ()
## Undocumented internal function of zeromq package.
## @end deftypefn
## PKG_DEL: __unload_zeromq__ ()
function __unload_zeromq__ ()
# on package unload, attempt to unload docs
try
pkg_dir = fileparts (fullfile (mfilename ("fullpath")));
doc_file = fullfile (pkg_dir, "doc", "zeromq.qch");
doc_file = strrep (doc_file, '\', '/');
if exist(doc_file, "file")
if exist("__event_manager_unregister_documentation__")
__event_manager_unregister_documentation__ (doc_file);
elseif exist("__event_manager_unregister_doc__")
__event_manager_unregister_doc__ (doc_file);
endif
endif
catch
# do nothing
end_try_catch
endfunction
gnu-octave-octave-zeromq-ffe3cf0/inst/examples/ 0000775 0000000 0000000 00000000000 15127471011 0021724 5 ustar 00root root 0000000 0000000 gnu-octave-octave-zeromq-ffe3cf0/inst/examples/zmq_example1.m 0000664 0000000 0000000 00000004217 15127471011 0024511 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 john donoghue
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see .
## -*- texinfo -*-
## Example code for a REQ socket connected to a server and sending and
## receiving responses.
##
## The example contains comments on the differences between the C API, and the
## Octave bindings.
% zeromq package must be installed and loaded to work
% don't buffer output
more off
printf ("Connecting to hello world server...\n");
% don't need to create context in octave binding
% % ZeroMQ API: context = zmq_ctx_new ();
% Create socket and connect to server
% since context in internal, a function that requires a context is used
% without specifying the context.
% ZeroMQ API: requester = zmq_socket (context, ZMQ_REQ);
requester = zmq_socket (ZMQ_REQ);
zmq_connect (requester, "tcp://localhost:5555");
for request_nbr = [1:10]
printf ("Sending Hello %d...\n", request_nbr);
zmq_send (requester, uint8("Hello"), 5, 0);
% try to read up to 10 bytes of reply data.
printf ("Waiting for server response %d... (Ctrl-C to exit)\n", request_nbr);
% The ZeroMQ API fills a buffer and returns a count of bytes
% Octave binding returns a buffer of the size received.
% ZeroMQ API: zmq_recv (requester, buffer, 10, 0);
received = zmq_recv (requester, 10, 0);
printf ("Received World %d\n", request_nbr);
endfor
zmq_close (requester);
% Binding handles context, so don't need to destroy it
% ZeroMQ API: zmq_ctx_destroy (context);
%!test
% % interactive script - nothing to do
gnu-octave-octave-zeromq-ffe3cf0/inst/examples/zmq_example2.m 0000664 0000000 0000000 00000002607 15127471011 0024513 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 john donoghue
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see .
## -*- texinfo -*-
## Example code for a REP socket server which waits for client commands and sends
## back a response.
% zeromq package must be installed and loaded to work
% don't buffer output
more off
printf ("Connecting to hello world server...\n");
% create reply socket, and bind it to port 5555
responder = zmq_socket (ZMQ_REP);
zmq_bind (responder, "tcp://*:5555");
printf ("Waiting for clients ...\n");
% loop forever, waiting for client requests and responding back
while (true)
recievedata = zmq_recv (responder, 10, 0);
printf ("Received Hello\n");
zmq_send (responder, "World", 5, 0);
endwhile
%!test
% % interactive script - nothing to do
gnu-octave-octave-zeromq-ffe3cf0/inst/examples/zmq_example3.m 0000664 0000000 0000000 00000002560 15127471011 0024512 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 john donoghue
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see .
## -*- texinfo -*-
## Example code for a PUB socket server which sends 'weather' updates from random
## zipcodes.
% zeromq package must be installed and loaded to work
% don't buffer output
more off
publisher = zmq_socket (ZMQ_PUB);
rc = zmq_bind (publisher, "tcp://*:5556");
assert (rc);
while (true)
% make up some random values
zipcode = 10000 + randi (20);
temperature = randi (215) - 80;
relhumidity = randi (50) + 10;
% Send message to all subscribers
update = sprintf ("%05d %d %d", zipcode, temperature, relhumidity);
fprintf("%s\n", update);
zmq_send (publisher, update);
endwhile
zmq_close (publisher);
%!test
% % interactive script - nothing to do
gnu-octave-octave-zeromq-ffe3cf0/inst/examples/zmq_example4.m 0000664 0000000 0000000 00000003150 15127471011 0024507 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 john donoghue
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see .
## -*- texinfo -*-
## Example code for a SUB socket client which subscribes to a 'weather' server
## for weather updates for zipcode 10001.
% don't buffer output
more off
subscriber = zmq_socket (ZMQ_SUB);
rc = zmq_connect (subscriber, "tcp://localhost:5556");
assert (rc);
% Subscribe to zipcode, default is NYC, 10001
zipfilter = "10001 ";
rc = zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, zipfilter);
assert (rc);
% Process 100 updates
update_nbr = 0;
total_temp = 0;
for update_nbr = 1:100
string = char( zmq_recv(subscriber, 128) );
[zipcode, temperature, relhumidity, count, errmsg] = sscanf (string, "%d %d %d", "C");
fprintf ("received a temp for zipcode '%s' of %dF\n", ...
zipfilter, temperature);
total_temp += temperature;
endfor
fprintf ("Average temperature for zipcode '%s' was %dF\n", ...
zipfilter, (total_temp / update_nbr));
zmq_close (subscriber);
%!test
% % interactive script - nothing to do
gnu-octave-octave-zeromq-ffe3cf0/inst/examples/zmq_example5.m 0000664 0000000 0000000 00000004273 15127471011 0024517 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2018 john donoghue
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see .
## -*- texinfo -*-
## Example code for a STREAM socket connecting to a HTTP server
## and making a HTTP request
% zeromq package must be installed and loaded to work
% don't buffer output
more off
printf ("Connecting to octave.org ...\n");
% Create socket
sock = zmq_socket (ZMQ_STREAM);
% connect to gnu.org
zmq_connect (sock, "tcp://octave.org:80");
% get socket identity
% NOTE: we MUST get it as zmq uses the identity for the
% first frame to know where to route to
% ZeroMQ API: zmq_socket (sock, ZMQ_IDENTITY, id, idsize);
id = zmq_getsockopt (sock, ZMQ_IDENTITY);
% send request for getting the home page info
% in HTTP would be HEAD / HTTP/1.1\r\n\r\n
printf ("Requesting HEAD / ...\n");
% send id frame first
zmq_send (sock, id, ZMQ_SNDMORE);
% now the content
zmq_send(sock, "HEAD / HTTP/1.1\r\n\r\n");
printf ("Waiting for server response...\n");
% zmq will add an identity as the 1st frame back
identity = zmq_recv (sock, 255, 0);
% http request blank line
received = zmq_recv (sock, 255, 0);
% the actual content
identity = zmq_recv (sock, 255, 0);
readmore = zmq_getsockopt (sock, ZMQ_RCVMORE);
while (readmore)
received = zmq_recv (sock, 1024, 0);
readmore = zmq_getsockopt (sock, ZMQ_RCVMORE);
printf ("%s", char(received))
endwhile
printf ("\n");
printf("Closing socket ...\n");
% if was a server, send id frame following by an empty zero frame to
% close the socket
zmq_close (sock);
%!test
% % interactive script - nothing to do
gnu-octave-octave-zeromq-ffe3cf0/inst/iszmq.m 0000664 0000000 0000000 00000002514 15127471011 0021431 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2017-2019 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {@var{tf} =} iszmq (@var{h})
##
## Determine whether @var{h} is a zeromq socket object.
##
## @subsubheading Inputs
## @var{h} - a potential zeromq socket object to check
## @subsubheading Outputs
## @var{tf} - true if @var{h} is a zeromq socket object, otherwise false.
##
## @seealso{zmq_socket}
## @end deftypefn
function tf = iszmq (h)
if (nargin == 0)
print_usage ();
endif
tf = strcmp(typeinfo(h), "octave_zeromq_socket");
endfunction
%!test assert(iszmq(1), false)
%!test
%! a = zmq_socket (ZMQ_SUB);
%! assert (iszmq (a));
%! zmq_close(a);
gnu-octave-octave-zeromq-ffe3cf0/inst/zmq_test.m 0000664 0000000 0000000 00000003700 15127471011 0022132 0 ustar 00root root 0000000 0000000 ## Copyright (C) 2016-2018 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see
## .
## -*- texinfo -*-
## @deftypefn {} {} zmq_test
##
## Perform zeromq Octave tests to exercise the oct file functionality.
##
## @end deftypefn
function zmq_test ()
test ( "zmq_test", "verbose" );
endfunction
%!assert(!isempty(ZMQ_SUB))
%!assert(!isempty(ZMQ_PUB))
%!assert(!isempty(ZMQ_PULL))
%!assert(!isempty(ZMQ_PUSH))
%!assert(!isempty(ZMQ_REQ))
%!assert(!isempty(ZMQ_REP))
%!test
%! server = zmq_socket(ZMQ_PUB);
%! assert (!isempty(server));
%! zmq_close (server);
%!xtest
%! server = zmq_socket(ZMQ_PUB);
%! assert (!isempty(server));
%! assert(zmq_bind( server, "tcp://*:8071"))
%! client = zmq_socket(ZMQ_SUB);
%! assert (!isempty(client));
%! assert(zmq_connect( client, "tcp://127.0.0.1:8071"))
%! zmq_setsockopt(client, ZMQ_SUBSCRIBE, "");
%! pause (2)
%! assert(zmq_send (server, uint8([104 101 108 108 111])), 5);
%! assert(zmq_recv (client, 10), uint8([104 101 108 108 111]))
%! zmq_close (client);
%! zmq_close (server);
%!test
%! server = zmq_socket(ZMQ_PUB);
%! assert (!isempty(server));
%! zmq_setsockopt(server, ZMQ_IDENTITY, uint8([104 101 108 108 111]));
%! assert(zmq_getsockopt (server, ZMQ_IDENTITY), uint8([104 101 108 108 111]))
%! zmq_close (server);
gnu-octave-octave-zeromq-ffe3cf0/octave-zeromq.metainfo.xml 0000664 0000000 0000000 00000002075 15127471011 0024254 0 ustar 00root root 0000000 0000000
octave-zeromq
www.octave.org-octave.desktop
ZeroMQ Toolkit
Octave ZeroMQ interface toolkit
Interface toolkit for using zeromq sockets.
zeromq
communication
http://octave.sourceforge.net/zeromq
https://savannah.gnu.org/bugs/?func=additem&group=octave
GPL-3.0+
Octave-Forge Community
octave-maintainers@gnu.org
FSFAP
gnu-octave-octave-zeromq-ffe3cf0/src/ 0000775 0000000 0000000 00000000000 15127471011 0017720 5 ustar 00root root 0000000 0000000 gnu-octave-octave-zeromq-ffe3cf0/src/Makefile.in 0000664 0000000 0000000 00000002772 15127471011 0021775 0 ustar 00root root 0000000 0000000 MKOCTFILE := @MKOCTFILE@
OCTAVE_CONFIG := @OCTAVE_CONFIG@
GREP ?= @GREP@
CXXFLAGS := @CXXFLAGS@ @DEFS@
LIBS := @LIBS@
LDFLAGS := @LDFLAGS@
ARCHDIR := "$(shell $(OCTAVE_CONFIG) -p CANONICAL_HOST_TYPE)-$(shell $(OCTAVE_CONFIG) -p API_VERSION)"
SRC := socket_class.cc bind.cc close.cc connect.cc disconnect.cc errno.cc \
getsockopt.cc globals.cc poll.cc recv.cc send.cc setsockopt.cc \
socket.cc strerror.cc unbind.cc version.cc properties.cc zeromq.cc \
has.cc z85_encode.cc z85_decode.cc curve_keypair.cc curve_public.cc pkglock.cc
OBJ := $(SRC:.cc=.o)
.PHONY: all
all: @TARGETS@
%.o: %.cc
$(MKOCTFILE) -c $< $(CXXFLAGS)
CC_TST_SOURCES := $(shell $(GREP) --files-with-matches '^%!' $(SRC))
TST_SOURCES := $(patsubst %.cc,../inst/$(ARCHDIR)/%.cc-tst,$(CC_TST_SOURCES))
.PHONY: archtests
archtests: $(TST_SOURCES)
../inst/$(ARCHDIR):
@mkdir -p "$@"
../inst/$(ARCHDIR)/%.cc-tst: %.cc | ../inst/$(ARCHDIR)
@echo "Extracting tests from $< ..."
@$(RM) -f "$@" "$@-t"
@( echo "## Generated from $<"; \
$(GREP) '^%!' "$<") > "$@"
zeromq.oct: $(OBJ)
$(MKOCTFILE) -o zeromq.oct $(OBJ) $(LDFLAGS) $(LIBS)
.PHONY: prebuild
prebuild:
# nothing to do
.PHONY: clean
.PHONY: distclean
clean:
rm -f *.o
rm -f *.oct
test -e ../inst/$(ARCHDIR) && rm -f $(TST_SOURCES) || true
test -e ../inst/$(ARCHDIR) && rmdir ../inst/$(ARCHDIR) || true
distclean: clean
$(RM) -rf autom4te.cache
$(RM) -f config.status config.log config.h
$(RM) -f oct-alt-includes.h
$(RM) -f Makefile
gnu-octave-octave-zeromq-ffe3cf0/src/bind.cc 0000664 0000000 0000000 00000003610 15127471011 0021143 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
// PKG_ADD: autoload ("zmq_bind", "zeromq.oct");
DEFUN_DLD (zmq_bind, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {} {status =} zmq_bind (@var{sock}, @var{endpoint})\n \
\n\
Bind a zeromq socket to a endpoint.\n \
\n \
@subsubheading Inputs\n \
@var{sock} - the socket to bind.\n \
\n \
@var{endpoint} - the endpoint string.\n \
\n \
@subsubheading Outputs\n \
@var{status} - status for bind.\n \
On success, bind will return a @var{status} of true \n \
\n \
@seealso { zmq_socket }\n \
@end deftypefn")
{
init_types ();
if (args.length () != 2
|| args(0).type_id () != octave_zeromq_socket::static_type_id ()
|| ! args(1).is_string ())
{
print_usage ();
return octave_value (false);
}
octave_zeromq_socket * sock = NULL;
const octave_base_value& rep = args (0).get_rep ();
sock = &((octave_zeromq_socket &)rep);
bool ret = sock->bind (args (1).string_value ());
return octave_value (ret);
}
#if 0
%!error zmq_bind()
%!error zmq_bind(1)
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/bootstrap 0000775 0000000 0000000 00000000344 15127471011 0021664 0 ustar 00root root 0000000 0000000 #!/bin/bash
## Octave-Forge: video package bootstrap script
## Run this to generate the configure script
set -e # halt if unhandled error
aclocal
autoconf # generate configure script
autoheader -f
rm -rf autom4te.cache
gnu-octave-octave-zeromq-ffe3cf0/src/close.cc 0000664 0000000 0000000 00000003320 15127471011 0021332 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
// PKG_ADD: autoload ("zmq_close", "zeromq.oct");
DEFUN_DLD (zmq_close, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {} {} zmq_close (@var{sock})\n \
\n\
Close a zeromq socket.\n \
\n \
@subsubheading Inputs\n \
@var{sock} - the socket type to close.\n \
@subsubheading Outputs\n \
None\n \
\n \
@seealso { zmq_socket }\n \
@end deftypefn")
{
init_types();
if (args.length () != 1
|| args (0).type_id () != octave_zeromq_socket::static_type_id ())
{
print_usage ();
return octave_value (-1);
}
octave_zeromq_socket * sock = NULL;
const octave_base_value& rep = args (0).get_rep ();
sock = &((octave_zeromq_socket &)rep);
sock->close ();
return octave_value ();
}
#if 0
%!error zmq_close()
%!error zmq_close(10)
%!test
%! a = zmq_socket();
%! zmq_close(a);
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/config.guess 0000775 0000000 0000000 00000123672 15127471011 0022253 0 ustar 00root root 0000000 0000000 #! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2015 Free Software Foundation, Inc.
timestamp='2015-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
# Please send patches to .
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_SYSTEM}" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
eval $set_cc_for_build
cat <<-EOF > $dummy.c
#include
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#else
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
;;
esac
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
echo i386-pc-auroraux${UNAME_RELEASE}
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
SUN_ARCH="i386"
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH="x86_64"
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c &&
dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`$dummy $dummyarg` &&
{ echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
then
echo "$SYSTEM_NAME"
else
echo rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/lslpp ] ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
eval $set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
*:MINGW64*:*)
echo ${UNAME_MACHINE}-pc-mingw64
exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
8664:Windows_NT:*)
echo x86_64-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
else
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
cris:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:Linux:*:*)
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef ${UNAME_MACHINE}
#undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
openrisc*:Linux:*:*)
echo or1k-unknown-linux-${LIBC}
exit ;;
or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-${LIBC}
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
*) echo hppa-unknown-linux-${LIBC} ;;
esac
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-${LIBC}
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-${LIBC}
exit ;;
ppc64le:Linux:*:*)
echo powerpc64le-unknown-linux-${LIBC}
exit ;;
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
paragon:*:*:*)
echo i860-intel-osf1
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
x86_64:Haiku:*:*)
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
eval $set_cc_for_build
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub
# that puts up a graphical alert prompting to install
# developer tools. Any system running Mac OS X 10.7 or
# later (Darwin 11 and later) is required to have a 64-bit
# processor. This is not true of the ARM version of Darwin
# that Apple uses in portable devices.
UNAME_PROCESSOR=x86_64
fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac
cat >&2 < in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
gnu-octave-octave-zeromq-ffe3cf0/src/config.sub 0000775 0000000 0000000 00000106246 15127471011 0021714 0 ustar 00root root 0000000 0000000 #! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2015 Free Software Foundation, Inc.
timestamp='2015-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches to .
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit ;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
-bluegene*)
os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
| bfin \
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| k1om \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
| riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| visium \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
c54x)
basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
leon|leon[3-9])
basic_machine=sparc-$basic_machine
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| k1om-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
| mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| visium-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aros)
basic_machine=i386-pc
os=-aros
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
bluegene*)
basic_machine=powerpc-ibm
os=-cnk
;;
c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dicos)
basic_machine=i686-pc
os=-dicos
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
leon-*|leon[3-9]-*)
basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
microblaze*)
basic_machine=microblaze-xilinx
;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
mingw32)
basic_machine=i686-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
moxiebox)
basic_machine=moxie-unknown
os=-moxiebox
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i686-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
openrisc | openrisc-*)
basic_machine=or32-unknown
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc | ppcbe) basic_machine=powerpc-unknown
;;
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rdos | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tile*)
basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
z80-*-coff)
basic_machine=z80-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-auroraux)
os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-aros*)
os=-aros
;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-nacl*)
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
c8051-*)
os=-elf
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
;;
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-haiku)
os=-haiku
;;
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-cnk*|-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
gnu-octave-octave-zeromq-ffe3cf0/src/configure.ac 0000664 0000000 0000000 00000013646 15127471011 0022220 0 ustar 00root root 0000000 0000000 # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
### Copyright (C) 2016-2026 John Donoghue
###
### This program is free software; you can redistribute it and/or
### modify it under the terms of the GNU General Public License as
### published by the Free Software Foundation; either version 3 of the
### License, or (at your option) any later version.
###
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
### General Public License for more details.
###
### You should have received a copy of the GNU General Public License
### along with this program; if not, see
### .
AC_PREREQ([2.67])
AC_INIT([octave zeromq package], [1.5.7])
AC_CONFIG_HEADERS([config.h])
# Avoid warnings for redefining AH-generated preprocessor symbols of
# Octave.
AH_TOP([#include "undef-ah-octave.h"])
AC_CONFIG_MACRO_DIRS([m4])
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
# Checks for programs.
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_GREP
AC_PROG_SED
AC_LANG(C++)
# check can access std c files
AC_CHECK_HEADERS([string.h])
AC_CHECK_TOOL([MKOCTFILE], [mkoctfile], [none])
if [ test "$MKOCTFILE" = "none" ]; then
AC_MSG_ERROR([mkoctfile required to install $PACKAGE_NAME])
fi
AC_CHECK_TOOL([OCTAVE_CONFIG], [octave-config], [none])
if [ test "$OCTAVE_CONFIG" = "none" ]; then
AC_MSG_ERROR([octave-config required to install $PACKAGE_NAME])
fi
# try get around possible spaces in the path
if test "X${IGNORE_MINGW_PATH_MODIFICATION}" == "X"; then
case $host_os in
mingw*)
# try demangle spaces in escaped input strings
MKOCTFILE=`echo $MKOCTFILE | $SED "s,\\\\\ ,?,g"`
OCTAVE_CONFIG=`echo $OCTAVE_CONFIG | $SED "s,\\\\\ ,?,g"`
;;
*)
;;
esac
fi
save_CPPFLAGS="$CPPFLAGS"
PKG_CHECK_MODULES([libzmq], [libzmq],
[],
[]
)
if test "$libzmq_CFLAGS$libzmq_LIBS" != "" ; then
CPPFLAGS="$libzmq_CFLAGS $save_CPPFLAGS"
AC_CHECK_HEADERS([zmq.h], ,
[libzmq_CFLAGS=""; libzmq_LIBS=""],
)
fi
if test "$libzmq_CFLAGS$libzmq_LIBS" == "" ; then
AC_MSG_NOTICE([Trying fallback libzmq detection])
# find headers first
AC_MSG_CHECKING([for zmq headers path])
found_header=
for p in [ /usr/include /usr/local/include /opt/include /mingw32/include /mingw64/include ]; do
for v in [ '' zmq ]; do
file_name="$p/$v/zmq.h"
if test -f $file_name; then
CPPFLAGS="-I$p/$v $save_CPPFLAGS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
#include
],
[
int i=0;
])],
[found_header="$p/$v"],
[])
fi
done
done
if test "$found_header" == "" ; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Unable to find zmq headers]),
else
AC_MSG_RESULT([$found_header])
libzmq_CXXFLAGS="-I$found_header"
libzmq_LIBS=-lzmq
fi
fi
CPPFLAGS=$save_CPPFLAGS
# save lib / inc path flags
CXXFLAGS="$CXXFLAGS $libzmq_CFLAGS"
LIBS="$LIBS $libzmq_LIBS"
# Checks for octave depreciated symbols
## Simple symbol alternatives of different Octave versions.
save_altsyms_CXX="$CXX"
save_altsyms_CXXFLAGS="$CXXFLAGS"
save_altsyms_LDFLAGS="$LDFLAGS"
save_altsyms_LIBS="$LIBS"
OCTINCLUDEDIR="${OCTINCLUDEDIR:-`$MKOCTFILE -p OCTINCLUDEDIR`}/.."
OCTLIBDIR=${OCTLIBDIR:-`$MKOCTFILE -p OCTLIBDIR`}
CXX=`${MKOCTFILE} -p CXX`
if test "X${IGNORE_MINGW_PATH_MODIFICATION}" == "X"; then
MSYSTEM="${MSYSTEM}"
else
MSYSTEM="none"
fi
case X$MSYSTEM in
XMINGW64*)
OCTAVE_HOME=`${MKOCTFILE} -p OCTAVE_HOME | $SED 's,\\\\,/,g'`
# change \ to / and replace octave home part with mingw part
OCTINCLUDEDIR=`echo $OCTINCLUDEDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw64,g"`
OCTLIBDIR=`echo $OCTLIBDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw64,g"`
;;
XMINGW32*)
OCTAVE_HOME=`${MKOCTFILE} -p OCTAVE_HOME | $SED 's,\\\\,/,g'`
# change \ to / and replace octave home part with mingw part
OCTINCLUDEDIR=`echo $OCTINCLUDEDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw32,g"`
OCTLIBDIR=`echo $OCTLIBDIR | $SED -e 's,\\\\,/,g -e "s,${OCTAVE_HOME},/mingw32,g"'`
;;
*)
;;
esac
CXXFLAGS="-I$OCTINCLUDEDIR $CXXFLAGS"
LDFLAGS="-L$OCTLIBDIR $LDFLAGS"
LIBS="-loctinterp $LIBS"
OF_OCTAVE_LIST_ALT_SYMS([
[dnl
[feval],
[octave::feval],
[[octave::feval ("date");]],
[OCTAVE__FEVAL],
[[#include ]],
[[#include ]]
],
[dnl
[is_float_type],
[isfloat],
[[octave_value ().isfloat ();]],
[OV_ISFLOAT],
[],
[]
],
[dnl
[is_integer_type],
[isinteger],
[[octave_value ().isinteger ();]],
[OV_ISINTEGER],
[],
[]
],
[dnl
[is_cell],
[iscell],
[[octave_value ().iscell ();]],
[OV_ISCELL],
[],
[]
],
[dnl
[octave_base_value],
[octave_base_dld_value],
[[octave_base_dld_value tmp();]],
[OCTAVE_BASE_CLASS],
[],
[]
]
],[oct-alt-includes.h])
AC_MSG_CHECKING([for octave_base_value count field])
octave_count_field=count
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
class test_base_class : public octave_base_value
{
public:
test_base_class() {}
~test_base_class() {}
void test() { m_count ++; }
bool is_object (void) const { return true; }
};
]], [
test_base_class t; t.is_object();
])],
[octave_count_field=m_count],
[octave_count_field=count]
)
AC_MSG_RESULT([$octave_count_field])
AC_DEFINE_UNQUOTED([OV_COUNT],$octave_count_field,[octave_base_value ref count field])
CXX=$save_altsyms_CXX
CXXFLAGS=$save_altsyms_CXXFLAGS
LDFLAGS=$save_altsyms_LDFLAGS
LIBS=$save_altsyms_LIBS
TARGETS="zeromq.oct archtests"
AC_SUBST(TARGETS)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
AC_MSG_NOTICE([
$PACKAGE_NAME is configured with:
LIBS: $LIBS
CXXFLAGS: $CXXFLAGS $DEFS
TARGETS: $TARGETS
])
gnu-octave-octave-zeromq-ffe3cf0/src/connect.cc 0000664 0000000 0000000 00000003572 15127471011 0021667 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
// PKG_ADD: autoload ("zmq_connect", "zeromq.oct");
DEFUN_DLD (zmq_connect, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {} {@var{status} =} zmq_connect (@var{sock}, @var{endpoint})\n \
\n\
Connect a zeromq socket to a endpoint.\n \
@subsubheading Inputs\n \
\n \
@var{sock} - the socket to connect.\n \
\n \
@var{endpoint} - the endpoint string.\n \
\n \
@subsubheading Outputs\n \
@var{status} - status for connect.\n \
On success, connect will return a @var{status} of true \n \
\n \
@seealso{zmq_socket}\n \
@end deftypefn")
{
init_types ();
if (args.length () != 2 ||
args(0).type_id () != octave_zeromq_socket::static_type_id ()
|| ! args(1).is_string ())
{
print_usage ();
return octave_value (false);
}
octave_zeromq_socket * sock = NULL;
const octave_base_value& rep = args (0).get_rep ();
sock = &((octave_zeromq_socket &)rep);
bool ret = sock->connect (args (1).string_value ());
return octave_value (ret);
}
#if 0
%!error zmq_connect()
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/curve_keypair.cc 0000664 0000000 0000000 00000004146 15127471011 0023104 0 ustar 00root root 0000000 0000000 // Copyright (C) 2019 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
// zeromq includes
#include
// PKG_ADD: autoload ("zmq_curve_keypair", "zeromq.oct");
DEFUN_DLD (zmq_curve_keypair, args, nargout,
"-*- texinfo -*-\n \
@deftypefn {} {[ @var{publickey}, @var{privatekey} ] =} zmq_curve_keypair ()\n \
\n\
Generate a random private/public keypair\n \
\n \
@subsubheading Inputs\n \
None\n \
@subsubheading Outputs\n \
@var{publickey} is a string that is the encoded public key\n \
\n \
@var{privatekey} is a string that is the encoded private key\n \
\n \
@seealso { zmq_z85_encode }\n \
@end deftypefn")
{
octave_value_list retval;
if (args.length () != 0)
{
print_usage ();
return retval;
}
#ifdef ZMQ_CURVE
char privatekey[41];
char publickey[41];
int rc = zmq_curve_keypair(publickey, privatekey);
if (rc != 0)
{
error ("zeromq: couldn't encode data");
return retval;
}
retval(0) = octave_value (std::string (publickey));
retval(1) = octave_value (std::string (privatekey));
#else
error ("zeromq: curve functions not implemented by this version of libzmq");
#endif
return retval;
}
#if 0
%!error zmq_curve_keypair(1)
%!test
%! if zmq_has ('curve')
%! [pub, priv] = zmq_curve_keypair();
%! assert(!isempty(pub))
%! assert(!isempty(priv))
%! endif
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/curve_public.cc 0000664 0000000 0000000 00000005136 15127471011 0022716 0 ustar 00root root 0000000 0000000 // Copyright (C) 2019 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
// zeromq includes
#include
// PKG_ADD: autoload ("zmq_curve_public", "zeromq.oct");
DEFUN_DLD (zmq_curve_public, args, nargout,
"-*- texinfo -*-\n \
@deftypefn {} {@var{publickey} =} zmq_curve_public (@var{privatekey})\n \
\n\
Derive the public key from a private key\n \
\n \
@subsubheading Inputs\n \
@var{privatekey} is a string that is the encoded private key. It must be 40 characters in length\n \
\n \
@subsubheading Outputs\n \
@var{publickey} is a string that is the encoded public key\n \
\n \
@seealso{zmq_curve_keypair}\n \
@end deftypefn")
{
octave_value retval;
if (args.length () != 1)
{
print_usage ();
return octave_value ();
}
if(!args(0).is_string ())
{
error ("zeromq: expected input to be a string");
return octave_value ();
}
std::string in = args (0).string_value ();
int len = in.length ();
if (len != 40)
{
error ("zeromq: input string key size must be 40");
return octave_value ();
}
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4,2,0)
char publickey[41];
int rc = zmq_curve_public(publickey, in.c_str());
if (rc != 0)
{
error ("zeromq: couldn't create public key");
}
else
{
retval = octave_value (std::string (publickey));
}
#else
error ("zeromq: curve_public function not implemented by this version of libzmq");
#endif
return retval;
}
#if 0
%!error zmq_curve_public()
%!error zmq_curve_public(1)
%!error zmq_curve_public("12345")
%!test
%! if zmq_has ('curve')
%! [pub, priv] = zmq_curve_keypair();
%! assert(!isempty(pub))
%! assert(!isempty(priv))
%! check = zmq_curve_public(priv);
%! assert(check, pub)
%! endif
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/disconnect.cc 0000664 0000000 0000000 00000004235 15127471011 0022364 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016-2022 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
// PKG_ADD: autoload ("zmq_disconnect", "zeromq.oct");
DEFUN_DLD (zmq_disconnect, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {} {@var{status} =} zmq_disconnect (@var{sock}, @var{endpoint})\n \
\n\
Disconnect a zeromq socket from an endpoint.\n \
\n \
@subsubheading Inputs\n \
@var{sock} - the socket to disconnect from.\n \
\n \
@var{endpoint} - a previously connected endpoint string to disconnect.\n \
\n \
@subsubheading Outputs\n \
@var{status} - status for disconnect.\n \
On success, disconnect will return a @var{status} of true \n \
\n \
@seealso{zmq_socket, zmq_connect}\n \
@end deftypefn")
{
init_types ();
if (args.length () != 2 ||
args(0).type_id () != octave_zeromq_socket::static_type_id ()
|| ! args(1).is_string ())
{
print_usage ();
return octave_value (false);
}
octave_zeromq_socket * sock = NULL;
const octave_base_value& rep = args (0).get_rep ();
sock = &((octave_zeromq_socket &)rep);
bool ret = sock->disconnect (args (1).string_value ());
return octave_value (ret);
}
#if 0
%!error zmq_disconnect()
%!error zmq_disconnect(1)
%!test
%! s = zmq_socket("ZMQ_SUB");
%! zmq_connect(s, "tcp://127.0.0.1:10000");
%! zmq_disconnect(s, "tcp://127.0.0.1:10000");
%! zmq_close(s);
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/errno.cc 0000664 0000000 0000000 00000002565 15127471011 0021364 0 ustar 00root root 0000000 0000000 // Copyright (C) 2014-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
// zeromq includes
#include
// PKG_ADD: autoload ("zmq_errno", "zeromq.oct");
DEFUN_DLD (zmq_errno, args, nargout,
"-*- texinfo -*-\n \
@deftypefn {} @var{errornum} = zmq_errno ()\n \
\n\
Get the value of errno from zeromq.\n \
\n \
@subsubheading Inputs\n \
None\n \
@subsubheading Outputs\n \
@var{errornum} is the errno value of the calling thread.\n \
\n \
@end deftypefn")
{
if (args.length () > 0)
{
print_usage ();
return octave_value (-1);
}
int err = zmq_errno ();
return octave_value (err);
}
gnu-octave-octave-zeromq-ffe3cf0/src/getsockopt.cc 0000664 0000000 0000000 00000031045 15127471011 0022414 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016-2020 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
#include
// PKG_ADD: autoload ("zmq_getsockopt", "zeromq.oct");
DEFUN_DLD (zmq_getsockopt, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {} {@var{value} =} zmq_getsockopt (@var{sock}, @var{optionid})\n \
\n\
Get the current value of an option.\n \
\n \
@subsubheading Inputs\n \
@var{sock} - the socket to connect.\n \
\n \
@var{optionid} - the setsockopt option to set.\n \
\n \
Valid @var{optionid}s are:\n \
@table @asis\n \
@item @code{ZMQ_RCVMORE}\n \
Flag for whether a message has been split into multiple messages. The return value will be either 0 or 1.\n \
@item @code{ZMQ_TYPE}\n \
Socket type for zeromq socket created with zmq_socket.\n \
Valid types are the same as the socket type value specified with zmq_socket. \n \
@item @code{ZMQ_EVENTS}\n \
Get the event state of zeromq socket.\n \
The returned value is a bit mask that may contain the following set values:\n \
@itemize\n \
@item @code{ZMQ_POLLIN} set when at least one message is available to read and zmq_recv will not block.\n \
@item @code{ZMQ_POLLOUT} set when at least one message can be written without zmq_send blocking.\n \
@end itemize\n \
@item @code{ZMQ_IDENTITY} or @code{ZMQ_ROUTING_ID}\n \
Get the socket identity value\n \
@item @code{ZMQ_RATE}\n \
Get the multicast data rate\n \
@item @code{ZMQ_PRIORITY}\n \
Get socket priority (linux only)\n \
@item @code{ZMQ_BACKLOG}\n \
Get length of queue for pending connections\n \
@item @code{ZMQ_LAST_ENDPOINT}\n \
Get the last endpoint the socket was connected to\n \
@item @code{ZMQ_CONNECT_TIMEOUT}\n \
Get the connect timeout value\n \
@item @code{ZMQ_SOCKS_PROXY}\n \
Get the SOCKS5 proxy value (string)\n \
@item @code{ZMQ_CURVE_SERVER}\n \
Get whether socket is a curve server (1) or not (0)\n \
@item @code{ZMQ_CURVE_PRIVATEKEY}\n \
Get a the curve socket private key (string)\n \
@item @code{ZMQ_CURVE_PUBLICKEY}\n \
Get a the curve socket public key (string)\n \
@item @code{ZMQ_CURVE_SERVERKEY}\n \
Get a the curve socket public key (string)\n \
@item @code{ZMQ_PLAIN_SERVER}\n \
Get whether socket server will use plain authentication (1) or not (0)\n \
@item @code{ZMQ_PLAIN_USERNAME}\n \
Get the plain socket username (string)\n \
@item @code{ZMQ_PLAIN_PASSWORD}\n \
Get the plain socket password (string)\n \
@item @code{ZMQ_GSSAPI_SERVER}\n \
Get whether socket server will use gssapi authentication (1) or not (0)\n \
@item @code{ZMQ_GSSAPI_PLAINTEXT}\n \
Get whether socket will encrypt gssapi authentication (1) or not (0)\n \
@item @code{ZMQ_GSSAPI_PRINCIPAL}\n \
Get the name of the gssapi principal (string)\n \
@item @code{ZMQ_GSSAPI_SERVICE_PRINCIPAL}\n \
Get the name of the gssapi service principal (string)\n \
@item @code{ZMQ_MECHANISM}\n \
Get the security mechanism (ZMQ_NULL, ZMQ_PLAIN, ZMQ_CURVE, ZMQ_GSSAPI)\n \
@end table\n \
\n \
@subsubheading Outputs\n \
@var{value} - the value set for the option, or [].\n \
\n \
@seealso{zmq_socket, zmq_setsockopt}\n \
@end deftypefn")
{
init_types ();
if (args.length () != 2 ||
args(0).type_id () != octave_zeromq_socket::static_type_id ())
{
print_usage ();
return octave_value ();
}
if (args (1).OV_ISINTEGER () && !args (1).OV_ISFLOAT ())
{
print_usage ();
return octave_value ();
}
octave_zeromq_socket * sock = NULL;
const octave_base_value& rep = args (0).get_rep ();
sock = &((octave_zeromq_socket &)rep);
int opt = args (1).int_value ();
std::string strvalue;
octave_value ret;
switch(opt)
{
case ZMQ_RCVMORE:
{
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3,0,0)
int64_t flag = 0;
#else
int flag = 0;
#endif
size_t sz = sizeof (flag);
if (! sock->getsockopt (opt, &flag, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (flag);
}
break;
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3,0,0)
case ZMQ_HWM:
{
uint64_t value = 0;
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3,0,0)
case ZMQ_SNDHWM:
{
int value = 0;
size_t sz = sizeof (value);
if ( !sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3,0,0)
case ZMQ_RCVHWM:
{
int value = 0;
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(2,1,0)
case ZMQ_TYPE:
{
ret = octave_value (sock->socktype ());
}
break;
#endif
case ZMQ_EVENTS:
{
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3,0,0)
uint32_t value = 0;
#else
int value = 0;
#endif
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: ZMQ_EVENTS failed getsockopt");
ret = octave_value (value);
}
break;
#ifdef ZMQ_ROUTING_ID
case ZMQ_ROUTING_ID:
#else
case ZMQ_IDENTITY:
#endif
{
uint8_t value[256];
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, value, &sz))
error ("zeromq: failed getsockopt");
if (sz > 0)
{
uint8NDArray data( dim_vector (1,sz) );
for (size_t i=0;i= ZMQ_MAKE_VERSION(3,2,0)
case ZMQ_LAST_ENDPOINT:
{
char value[1024];
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, value, &sz))
error ("zeromq: failed getsockopt");
if (sz > 0)
{
strvalue = std::string(value, sz-1);
}
else
strvalue = "";
ret = octave_value(strvalue);
}
break;
#endif
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4,2,0)
case ZMQ_CONNECT_TIMEOUT:
{
int value;
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
#ifdef ZMQ_SOCKS_PROXY
case ZMQ_SOCKS_PROXY:
{
char value[1024];
size_t sz = sizeof(value);
if (! sock->getsockopt (opt, value, &sz))
error ("zeromq: failed getsockopt");
if (sz > 0)
{
strvalue = std::string(value, sz-1);
}
else
strvalue = "";
ret = octave_value(strvalue);
}
break;
#endif
#ifdef ZMQ_CURVE_SERVER
case ZMQ_CURVE_SERVER:
{
int value;
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
#ifdef ZMQ_CURVE_PUBLICKEY
case ZMQ_CURVE_PUBLICKEY:
{
char value[1024];
size_t sz = 41;
if (! sock->getsockopt (opt, value, &sz))
error ("zeromq: failed getsockopt");
if (sz > 0)
{
strvalue = std::string(value, sz-1);
}
else
strvalue = "";
ret = octave_value(strvalue);
}
break;
#endif
#ifdef ZMQ_CURVE_SERVERKEY
case ZMQ_CURVE_SERVERKEY:
{
char value[1024];
size_t sz = 41;
if (! sock->getsockopt (opt, value, &sz))
error ("zeromq: failed getsockopt");
if (sz > 0)
{
strvalue = std::string(value, sz-1);
}
else
strvalue = "";
ret = octave_value(strvalue);
}
break;
#endif
#ifdef ZMQ_CURVE_SECRETKEY
case ZMQ_CURVE_SECRETKEY:
{
char value[1024];
size_t sz = 41;
if (! sock->getsockopt (opt, value, &sz))
error ("zeromq: failed getsockopt");
if (sz > 0)
{
strvalue = std::string(value, sz-1);
}
else
strvalue = "";
ret = octave_value(strvalue);
}
break;
#endif
#ifdef ZMQ_PLAIN_SERVER
case ZMQ_PLAIN_SERVER:
{
int value;
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
#ifdef ZMQ_PLAIN_USERNAME
case ZMQ_PLAIN_USERNAME:
{
char value[1024];
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, value, &sz))
error ("zeromq: failed getsockopt");
if (sz > 0)
{
strvalue = std::string(value, sz-1);
}
else
strvalue = "";
ret = octave_value(strvalue);
}
break;
#endif
#ifdef ZMQ_PLAIN_PASSWORD
case ZMQ_PLAIN_PASSWORD:
{
char value[1024];
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, value, &sz))
error ("zeromq: failed getsockopt");
if (sz > 0)
{
strvalue = std::string(value, sz-1);
}
else
strvalue = "";
ret = octave_value(strvalue);
}
break;
#endif
#ifdef ZMQ_GSSAPI_SERVER
case ZMQ_GSSAPI_SERVER:
{
int value;
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
#ifdef ZMQ_GSSAPI_PLAINTEXT
case ZMQ_GSSAPI_PLAINTEXT:
{
int value;
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
#ifdef ZMQ_GSSAPI_PRINCIPAL
case ZMQ_GSSAPI_PRINCIPAL:
{
char value[1024];
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, value, &sz))
error ("zeromq: failed getsockopt");
if (sz > 0)
{
strvalue = std::string(value, sz-1);
}
else
strvalue = "";
ret = octave_value(strvalue);
}
break;
#endif
#ifdef ZMQ_GSSAPI_SERVICE_PRINCIPAL
case ZMQ_GSSAPI_SERVICE_PRINCIPAL:
{
char value[1024];
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, value, &sz))
error ("zeromq: failed getsockopt");
if (sz > 0)
{
strvalue = std::string(value, sz-1);
}
else
strvalue = "";
ret = octave_value(strvalue);
}
break;
#endif
#ifdef ZMQ_MECHANISM
case ZMQ_MECHANISM:
{
int value;
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
#ifdef ZMQ_PRIORITY
case ZMQ_PRIORITY:
{
int value;
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
#ifdef ZMQ_RATE
case ZMQ_RATE:
{
int value;
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
#ifdef ZMQ_BACKLOG
case ZMQ_BACKLOG:
{
int value;
size_t sz = sizeof (value);
if (! sock->getsockopt (opt, &value, &sz))
error ("zeromq: failed getsockopt");
ret = octave_value (value);
}
break;
#endif
default:
error ("zeromq: invalid getsockopt value %d", opt);
break;
}
return ret;
}
#if 0
%!error zmq_getsockopt
%!error zmq_getsockopt(10)
%!test
%! s = zmq_socket(ZMQ_SUB);
%! assert(zmq_getsockopt(s, ZMQ_TYPE), ZMQ_SUB);
%! zmq_setsockopt(s, ZMQ_IDENTITY, uint8([104 101 108 108 111]));
%! assert(zmq_getsockopt(s, ZMQ_IDENTITY), uint8([104 101 108 108 111]));
%! zmq_close(s);
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/globals.cc 0000664 0000000 0000000 00000026757 15127471011 0021673 0 ustar 00root root 0000000 0000000 // Copyright (C) 2014-2022 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
// zeromq includes
#include
// socket types ......
// PKG_ADD: autoload ("__ZMQ_SOCK_PUB", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_PUB, args, nargout,"zeromq constant")
{
return octave_value(ZMQ_PUB);
}
// PKG_ADD: autoload ("__ZMQ_SOCK_SUB", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_SUB, args, nargout,"zeromq socket type constant")
{
return octave_value(ZMQ_SUB);
}
// PKG_ADD: autoload ("__ZMQ_SOCK_REQ", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_REQ, args, nargout,"zeromq socket type constant")
{
return octave_value(ZMQ_REQ);
}
// PKG_ADD: autoload ("__ZMQ_SOCK_REP", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_REP, args, nargout,"zeromq socket type constant")
{
return octave_value(ZMQ_REP);
}
// PKG_ADD: autoload ("__ZMQ_SOCK_PUSH", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_PUSH, args, nargout,"zeromq socket type constant")
{
return octave_value(ZMQ_PUSH);
}
// PKG_ADD: autoload ("__ZMQ_SOCK_PULL", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_PULL, args, nargout,"zeromq socket type constant")
{
return octave_value(ZMQ_PULL);
}
// PKG_ADD: autoload ("__ZMQ_SOCK_DEALER", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_DEALER, args, nargout,"zeromq socket type constant")
{
return octave_value(ZMQ_DEALER);
}
// PKG_ADD: autoload ("__ZMQ_SOCK_ROUTER", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_ROUTER, args, nargout,"zeromq socket type constant")
{
return octave_value(ZMQ_ROUTER);
}
// PKG_ADD: autoload ("__ZMQ_SOCK_PAIR", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_PAIR, args, nargout,"zeromq socket type constant")
{
return octave_value(ZMQ_PAIR);
}
// PKG_ADD: autoload ("__ZMQ_SOCK_STREAM", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_STREAM, args, nargout,"zeromq constant")
{
#if defined(ZMQ_STREAM)
return octave_value(ZMQ_STREAM);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_SOCK_XPUB", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_XPUB, args, nargout,"zeromq constant")
{
return octave_value(ZMQ_XPUB);
}
// PKG_ADD: autoload ("__ZMQ_SOCK_XSUB", "zeromq.oct");
DEFUN_DLD (__ZMQ_SOCK_XSUB, args, nargout,"zeromq socket type constant")
{
return octave_value(ZMQ_XSUB);
}
// socket send/recv flags --------------------
// PKG_ADD: autoload ("__ZMQ_FLAG_SNDMORE", "zeromq.oct");
DEFUN_DLD (__ZMQ_FLAG_SNDMORE, args, nargout,"zeromq flag constant")
{
return octave_value(ZMQ_SNDMORE);
}
// PKG_ADD: autoload ("__ZMQ_FLAG_DONTWAIT", "zeromq.oct");
DEFUN_DLD (__ZMQ_FLAG_DONTWAIT, args, nargout,"zeromq flag constant")
{
// return octave_value(ZMQ_DONTWAIT);
return octave_value(ZMQ_NOBLOCK);
}
// set/get socket options ----------------------------
// PKG_ADD: autoload ("__ZMQ_OPT_SUBSCRIBE", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_SUBSCRIBE, args, nargout,"zeromq option constant")
{
return octave_value(ZMQ_SUBSCRIBE);
}
// PKG_ADD: autoload ("__ZMQ_OPT_UNSUBSCRIBE", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_UNSUBSCRIBE, args, nargout,"zeromq option constant")
{
return octave_value(ZMQ_UNSUBSCRIBE);
}
// PKG_ADD: autoload ("__ZMQ_OPT_RCVMORE", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_RCVMORE, args, nargout,"zeromq option constant")
{
return octave_value(ZMQ_RCVMORE);
}
// PKG_ADD: autoload ("__ZMQ_OPT_IDENTITY", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_IDENTITY, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_IDENTITY
return octave_value(ZMQ_IDENTITY);
#else
return octave_value(ZMQ_ROUTING_ID);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_ROUTING_ID", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_ROUTING_ID, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_ROUTING_ID
return octave_value(ZMQ_ROUTING_ID);
#else
return octave_value(ZMQ_IDENTITY);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_TYPE", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_TYPE, args, nargout,"zeromq option constant")
{
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(2,1,0)
return octave_value(ZMQ_TYPE);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_LAST_ENDPOINT", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_LAST_ENDPOINT, args, nargout,"zeromq option constant")
{
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3,2,0)
return octave_value(ZMQ_LAST_ENDPOINT);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_CONNECT_TIMEOUT", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_CONNECT_TIMEOUT, args, nargout,"zeromq option constant")
{
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4,2,0)
return octave_value(ZMQ_CONNECT_TIMEOUT);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_SOCKS_PROXY", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_SOCKS_PROXY, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_SOCKS_PROXY
return octave_value(ZMQ_SOCKS_PROXY);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_CURVE_SERVER", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_CURVE_SERVER, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_CURVE
return octave_value(ZMQ_CURVE_SERVER);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_CURVE_SECRETKEY", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_CURVE_SECRETKEY, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_CURVE
return octave_value(ZMQ_CURVE_SECRETKEY);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_CURVE_PUBLICKEY", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_CURVE_PUBLICKEY, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_CURVE
return octave_value(ZMQ_CURVE_PUBLICKEY);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_CURVE_SERVERKEY", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_CURVE_SERVERKEY, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_CURVE
return octave_value(ZMQ_CURVE_SERVERKEY);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_PLAIN_SERVER", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_PLAIN_SERVER, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_PLAIN_SERVER
return octave_value(ZMQ_PLAIN_SERVER);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_PLAIN_USERNAME", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_PLAIN_USERNAME, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_PLAIN_USERNAME
return octave_value(ZMQ_PLAIN_USERNAME);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_PLAIN_PASSWORD", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_PLAIN_PASSWORD, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_PLAIN_PASSWORD
return octave_value(ZMQ_PLAIN_PASSWORD);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_GSSAPI_SERVER", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_GSSAPI_SERVER, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_GSSAPI_SERVER
return octave_value(ZMQ_GSSAPI_SERVER);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_GSSAPI_PLAINTEXT", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_GSSAPI_PLAINTEXT, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_GSSAPI_PLAINTEXT
return octave_value(ZMQ_GSSAPI_PLAINTEXT);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_GSSAPI_PRINCIPAL", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_GSSAPI_PRINCIPAL, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_GSSAPI_PRINCIPAL
return octave_value(ZMQ_GSSAPI_PRINCIPAL);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_GSSAPI_SERVICE_PRINCIPAL", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_GSSAPI_SERVICE_PRINCIPAL, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_GSSAPI_SERVICE_PRINCIPAL
return octave_value(ZMQ_GSSAPI_SERVICE_PRINCIPAL);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_MECHANISM", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_MECHANISM, args, nargout,"zeromq option constant")
{
#ifdef ZMQ_MECHANISM
return octave_value(ZMQ_MECHANISM);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_EVENTS", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_EVENTS, args, nargout,"zeromq option constant")
{
return octave_value(ZMQ_EVENTS);
}
// ZMQ_EVENT constants
// PKG_ADD: autoload ("__ZMQ_EVENT_POLLIN", "zeromq.oct");
DEFUN_DLD (__ZMQ_EVENT_POLLIN, args, nargout,"zeromq option event constant")
{
return octave_value(ZMQ_POLLIN);
}
// PKG_ADD: autoload ("__ZMQ_EVENT_POLLOUT", "zeromq.oct");
DEFUN_DLD (__ZMQ_EVENT_POLLOUT, args, nargout,"zeromq option event constant")
{
return octave_value(ZMQ_POLLOUT);
}
// ZMQ_MECHANISM constants
// PKG_ADD: autoload ("__ZMQ_MECHANISM_NULL", "zeromq.oct");
DEFUN_DLD (__ZMQ_MECHANISM_NULL, args, nargout,"zeromq option mechanism constant")
{
#ifdef ZMQ_NULL
return octave_value(ZMQ_NULL);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_MECHANISM_PLAIN", "zeromq.oct");
DEFUN_DLD (__ZMQ_MECHANISM_PLAIN, args, nargout,"zeromq option mechanism constant")
{
#ifdef ZMQ_PLAIN
return octave_value(ZMQ_PLAIN);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_MECHANISM_CURVE", "zeromq.oct");
DEFUN_DLD (__ZMQ_MECHANISM_CURVE, args, nargout,"zeromq option mechanism constant")
{
#ifdef ZMQ_CURVE
return octave_value(ZMQ_CURVE);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_MECHANISM_GSSAPI", "zeromq.oct");
DEFUN_DLD (__ZMQ_MECHANISM_GSSAPI, args, nargout,"zeromq option mechanism constant")
{
#ifdef ZMQ_GSSAPI
return octave_value(ZMQ_GSSAPI);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_PRIORITY", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_PRIORITY, args, nargout,"zeromq socket constant")
{
// NOTE: currently draft so may change
#ifdef ZMQ_PRIORITY
return octave_value(ZMQ_PRIORITY);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_RATE", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_RATE, args, nargout,"zeromq socket constant")
{
#ifdef ZMQ_RATE
return octave_value(ZMQ_RATE);
#else
return octave_value(-1);
#endif
}
// PKG_ADD: autoload ("__ZMQ_OPT_BACKLOG", "zeromq.oct");
DEFUN_DLD (__ZMQ_OPT_BACKLOG, args, nargout,"zeromq socket constant")
{
#ifdef ZMQ_BACKLOG
return octave_value(ZMQ_BACKLOG);
#else
return octave_value(-1);
#endif
}
#if 0
%! % check that all the values exist
%!assert (exist('__ZMQ_EVENT_POLLOUT'))
%!assert (exist('__ZMQ_EVENT_POLLIN'))
%!assert (exist('__ZMQ_OPT_EVENTS'))
%!assert (exist('__ZMQ_OPT_TYPE'))
%!assert (exist('__ZMQ_OPT_IDENTITY'))
%!assert (exist('__ZMQ_OPT_RCVMORE'))
%!assert (exist('__ZMQ_OPT_SUBSCRIBE'))
%!assert (exist('__ZMQ_OPT_UNSUBSCRIBE'))
%!assert (exist('__ZMQ_OPT_LAST_ENDPOINT'))
%!assert (exist('__ZMQ_OPT_CONNECT_TIMEOUT'))
%!assert (exist('__ZMQ_FLAG_DONTWAIT'))
%!assert (exist('__ZMQ_FLAG_SNDMORE'))
%!assert (exist('__ZMQ_SOCK_PUB'))
%!assert (exist('__ZMQ_SOCK_SUB'))
%!assert (exist('__ZMQ_SOCK_REQ'))
%!assert (exist('__ZMQ_SOCK_REP'))
%!assert (exist('__ZMQ_SOCK_PUSH'))
%!assert (exist('__ZMQ_SOCK_PULL'))
%!assert (exist('__ZMQ_SOCK_DEALER'))
%!assert (exist('__ZMQ_SOCK_ROUTER'))
%!assert (exist('__ZMQ_SOCK_PAIR'))
%!assert (exist('__ZMQ_SOCK_XPUB'))
%!assert (exist('__ZMQ_SOCK_XSUB'))
%!assert (exist('__ZMQ_SOCK_STREAM'))
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/has.cc 0000664 0000000 0000000 00000005055 15127471011 0021007 0 ustar 00root root 0000000 0000000 // Copyright (C) 2018-2020 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
// zeromq includes
#include
// PKG_ADD: autoload ("zmq_has", "zeromq.oct");
DEFUN_DLD (zmq_has, args, nargout,
"-*- texinfo -*-\n \
@deftypefn {} {@var{yesno} =} zmq_has (@var{feature})\n \
\n\
Check if the zmq library supports a given feature.\n \
\n \
@subsubheading Inputs\n \
@var{feature} is the name of feature to check.\n \
\n \
Currently known features are:\n \
@table @asis\n \
@item 'ipc'\n \
library supports the ipc:// protocol\n \
@item 'pgm'\n \
library supports the pgm:// protocol\n \
@item 'tipc'\n \
library supports the tipc:// protocol\n \
@item 'norm'\n \
library supports the norm:// protocol\n \
@item 'curve'\n \
library supports the CURVE security mechanism\n \
@item 'gssapi'\n \
library supports the GSSAPI security mechanism\n \
@item 'draft'\n \
library was built with the draft API.\n \
@end table\n \
\n \
@subsubheading Outputs\n \
@var{yesno} - set to true if the feature is available, otherwise false. \
\n \
@end deftypefn")
{
if (args.length () != 1 ||
! args(0).is_string ())
{
print_usage ();
return octave_value (-1);
}
// get feature to check in lower case
std::string feature = args (0).string_value ();
std::transform (feature.begin (), feature.end (), feature.begin (), ::tolower);
octave_value yesno;
#if defined(ZMQ_HAS_CAPABILITIES)
int has = zmq_has (feature.c_str ());
if (has == 1) yesno = true;
else yesno = false;
#else
// assuming if dont have caps, that we dont have the feature
yesno = false;
#endif
return yesno;
}
#if 0
%!test
%! ipc = zmq_has ("ipc");
%! assert (~isempty (ipc));
%!error zmq_has()
%!error zmq_has(1)
%!error zmq_has("ipc", "ipc")
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/m4/ 0000775 0000000 0000000 00000000000 15127471011 0020240 5 ustar 00root root 0000000 0000000 gnu-octave-octave-zeromq-ffe3cf0/src/m4/octave-forge.m4 0000664 0000000 0000000 00000005760 15127471011 0023073 0 ustar 00root root 0000000 0000000 # Copyright (C) 2017-2018 Olaf Till
# Modifications to print what is searching for by JohnD
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
# arguments of OF_OCTAVE_ALT_SYMS (see also description of
# OF_OCTAVE_LIST_ALT_SYMS below):
#
# $1: symbol version 1
# $2: symbol version 2
# $3: test for symbol version 2
# $4: macro name to access alternative symbols
# $5: include directives for symbol version 1
# $6: include directives for symbol version 2
# (a list of lists of args 1--6 is $1 of OF_OCTAVE_LIST_ALT_SYMS)
# $7: name of generated include file with alternatives of Octave headers
# (arg7 is $2 of OF_OCTAVE_LIST_ALT_SYMS)
AC_DEFUN([OF_OCTAVE_ALT_SYMS], [
AC_MSG_CHECKING([$1 or $2])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include ]
$6],
[$3])],
[AC_DEFINE($4,
[[$2]],
[macro for alternative Octave symbols])
AC_MSG_RESULT([$2])
echo '$6' >> $7],
[AC_DEFINE($4,
[[$1]],
[macro for alternative Octave symbols])
AC_MSG_RESULT([$1])
echo '$5' >> $7]
)
])
# OF_OCTAVE_LIST_ALT_SYMS is called in the following way:
#
# OF_OCTAVE_LIST_ALT_SYMS([
# [dnl
# [old_octave_symbol],
# [new_octave_symbol],
# [[compilation test]
# [for new_octave_symbol]],
# [NAME_OF_GENERATED_MACRO____WILL_EXPAND_TO_OLD_OR_NEW_SYMBOL],
# [[include directives]
# [except #include ]
# [necessary to compile with old_octave_symbol]],
# [[include directives]
# [except #include ]
# [nessary to compile with new_octave_symbol]
# [and to compile the test]]
# ],
#
# ... further such lists as the above
#
# ],
#
# [name-of-header-file-for-alternative-octave-iclude-directives.h])
#
#
# This file should be put into src/m4/, and the line
#
# AC_CONFIG_MACRO_DIRS([m4])
#
# should be put into src/configure.ac. The package should use
# autoheader to generate config.h.in (src/bootstrap should contain the
# lines 'aclocal', 'autoconf', and 'autoheader -f'). Package code
# should include config.h and use the generated macros to access the
# alternative symbols of Octave. An example of a call to
# OF_OCTAVE_LIST_ALT_SYMS in src/configure.ac is available together
# with this file.
AC_DEFUN([OF_OCTAVE_LIST_ALT_SYMS], [
echo '/* generated by configure */' > $2
m4_foreach([it], [$1], [m4_apply([OF_OCTAVE_ALT_SYMS], [it, $2])])
AH_BOTTOM([#include "$2"])
])
gnu-octave-octave-zeromq-ffe3cf0/src/pkglock.cc 0000664 0000000 0000000 00000002667 15127471011 0021674 0 ustar 00root root 0000000 0000000 // Copyright (C) 2019 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
#include
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
// PKG_ADD: autoload ("__zeromq_pkg_lock__", which ("zeromq"));
// PKG_ADD: __zeromq_pkg_lock__(1);
// PKG_DEL: __zeromq_pkg_lock__(0);
#ifdef DEFMETHOD_DLD
DEFMETHOD_DLD (__zeromq_pkg_lock__, interp, args, , "internal function")
{
octave_value retval;
if (args.length () >= 1)
{
if (args(0).int_value () == 1)
interp.mlock();
else if (args(0).int_value () == 0 && interp.mislocked("__zeromq_pkg_lock__"))
interp.munlock("__zeromq_pkg_lock__");
}
return retval;
}
#else
DEFUN_DLD(__zeromq_pkg_lock__, args, , "internal function")
{
octave_value retval;
return retval;
}
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/poll.cc 0000664 0000000 0000000 00000011532 15127471011 0021177 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
// zeromq includes
#include
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3,0,0)
#define TIMESCALE 1000
#else
#define TIMESCALE 1
#endif
// PKG_ADD: autoload ("zmq_poll", "zeromq.oct");
DEFUN_DLD (zmq_poll, args, nargout,
"-*- texinfo -*-\n \
@deftypefn {} {@var{havedata} =} zmq_poll (@var{sock}, @var{timeout})\n \
@deftypefnx {} {@var{indexlist} =} zmq_poll (@var{socklist}, @var{timeout})\n \
\n\
Wait up to timeout time for received data on socket.\n \
\n \
@subsubheading Inputs\n \
@var{sock} - the socket to wait on.\n \
\n \
@var{socklist} - the array of sockets to wait on.\n \
\n \
@var{timeout} - timeout time in milliseconds.\n \
A value of 0 will return without waiting. A value of -1 will wait until there is data.\n \
\n \
@subsubheading Outputs\n \
@var{havedata} - value of 1 if have data.\n \
\n \
@var{indexlist} - cell array of indexes to sockets that have data.\n \
\n \
@seealso {zmq_socket}\n \
\n \
@end deftypefn")
{
if (args.length () < 2)
{
print_usage ();
return octave_value ();
}
if(!args (1).OV_ISINTEGER () && !args (1).OV_ISFLOAT ())
{
error ("zeromq: expected time as integer or float type");
}
int time = args (1).int_value ();
if (time < -1)
{
error ("zeromq: unexpected negative time");
}
octave_value_list return_list;
int sockcount = 0;
if(args (0).type_id () == octave_zeromq_socket::static_type_id ())
{
sockcount = 1;
}
else if(args (0).OV_ISCELL ())
{
sockcount = args (0).cell_value ().numel ();
}
else
{
error ("zeromq: expected argument of octave_zeromq_socket or array of octave_zeromq_socket");
}
//zmq_pollitem_t * pitem = new zmq_pollitem_t[sockcount];
OCTAVE_LOCAL_BUFFER (zmq_pollitem_t, pitem, sockcount);
if (pitem == NULL)
{
error ("zeromq: couldnt allocate poll item memory");
}
if(args (0).type_id () == octave_zeromq_socket::static_type_id ())
{
octave_zeromq_socket * sock = NULL;
sock = dynamic_cast(args (0).internal_rep ());
pitem[0].socket = sock->socket ();
pitem[0].events = ZMQ_POLLIN;
pitem[0].fd = 0;
}
else
{
int usedcount = 0;
octave_zeromq_socket * sock = NULL;
Cell cell = args (0).cell_value ();
for(int i=0;i(cell (i).internal_rep ());
pitem[usedcount].socket = sock->socket ();
pitem[usedcount].events = ZMQ_POLLIN;
pitem[usedcount].fd = 0;
++ usedcount;
}
}
sockcount = usedcount;
}
if (sockcount == 0)
{
error ("zeromq: expected argument of octave_zeromq_socket or array of octave_zeromq_socket");
}
int have_data = 0;
int waittime;
do
{
if(time > 1000 || time == -1)
waittime = 1000;
else
waittime = time;
have_data = zmq_poll (pitem, sockcount, waittime*TIMESCALE);
if(waittime != -1) time -= waittime;
OCTAVE_QUIT;
}
while (have_data == 0 && time > 0);
if(have_data > 0)
{
if(args (0).type_id () == octave_zeromq_socket::static_type_id ())
{
return_list (0) = 1;
}
else
{
Cell cells (dim_vector (1, have_data));
int cell_pos = 0;
for (int i=0;i zmq_poll()
%!error zmq_poll(1)
%!test
%! s = zmq_socket("ZMQ_SUB");
%! zmq_poll(s, 0);
%! zmq_close(s);
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/properties.cc 0000664 0000000 0000000 00000010765 15127471011 0022434 0 ustar 00root root 0000000 0000000 // Copyright (C) 2017-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
#include
// PKG_ADD: autoload ("__zmq_properties__", "zeromq.oct");
DEFUN_DLD (__zmq_properties__, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {} {} __zmq_properties__ (@var{sock} ...)\n \
\n\
Internal function to get properties from a zmq socket\
@end deftypefn")
{
octave_value_list ret;
init_types ();
if (args.length () < 1 || args.length() > 3
|| args (0).type_id () != octave_zeromq_socket::static_type_id ())
{
print_usage ();
return octave_value (-1);
}
octave_zeromq_socket * sock = NULL;
const octave_base_value& rep = args (0).get_rep ();
sock = &((octave_zeromq_socket &)rep);
if (args.length () == 1)
{
// get all
octave_map props;
props.assign ("endpoint", octave_value (sock->getendpoint ()));
props.assign ("type", octave_value (sock->gettypestr ()));
octave_value_list ovl;
ovl (0) = args (0);
ovl (1) = ZMQ_IDENTITY;
props.assign ("identity", OCTAVE__FEVAL (std::string ("zmq_getsockopt"), ovl, 1));
ovl (0) = args (0);
ovl (1) = ZMQ_RCVMORE;
props.assign ("recvmore", OCTAVE__FEVAL (std::string ("zmq_getsockopt"), ovl, 1));
ovl (0) = args (0);
ovl (1) = ZMQ_EVENTS;
props.assign ("events", OCTAVE__FEVAL (std::string ("zmq_getsockopt"), ovl, 1));
ret = octave_value (props);
}
else if (args.length() == 2)
{
// get
std::string prop = args (1).string_value ();
std::transform (prop.begin (), prop.end (), prop.begin (), ::tolower);
if (prop == "endpoint") ret = octave_value (sock->getendpoint ());
else if(prop == "type") ret = octave_value (sock->gettypestr ());
else if(prop == "identity")
{
octave_value_list ovl;
ovl (0) = args (0);
ovl (1) = ZMQ_IDENTITY;
ret = OCTAVE__FEVAL (std::string ("zmq_getsockopt"), ovl, 1);
}
else if (prop == "recvmore")
{
octave_value_list ovl;
ovl (0) = args (0);
ovl (1) = ZMQ_RCVMORE;
ret = OCTAVE__FEVAL (std::string ("zmq_getsockopt"), ovl, 1);
}
else if (prop == "events")
{
octave_value_list ovl;
ovl (0) = args (0);
ovl (1) = ZMQ_EVENTS;
ret = OCTAVE__FEVAL (std::string ("zmq_getsockopt"), ovl, 1);
}
else
error ("__zmq_properties__ unknown property '%s'", prop.c_str ());
}
else if (args.length () == 3)
{
// set
std::string prop = args (1).string_value ();
std::transform (prop.begin (), prop.end (), prop.begin (), ::tolower);
if(prop == "identity")
{
octave_value_list ovl;
ovl (0) = args (0);
ovl (1) = ZMQ_IDENTITY;
ovl (2) = args (2);
ret = OCTAVE__FEVAL (std::string ("zmq_setsockopt"), ovl, 1);
}
else
error ("__zmq_properties__ unknown/unsettable property '%s'", prop.c_str ());
}
return ret;
}
#if 0
%!test
%! a = zmq_socket();
%!
%! props = __zmq_properties__(a);
%! assert(props.type, "ZMQ_PUB")
%!
%! assert(__zmq_properties__(a, "type"), "ZMQ_PUB")
%! assert(__zmq_properties__(a, "recvmore"), 0)
%!
%! fail ("__zmq_properties__ (a,'invalid')", "unknown property");
%!
%! id = uint8([ 1, 2, 3 ]);
%! __zmq_properties__(a, "identity", id);
%! assert(__zmq_properties__(a, "identity"), id);
%! id = uint8([ 1, 2, 3, 4 ]);
%! a.identity = id;
%! assert(__zmq_properties__(a, "identity"), id);
%! assert (isa (a, 'octave_zeromq_socket'))
%! zmq_close(a);
%!error __zmq_properties__ ()
%!error __zmq_properties__ ()
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/recv.cc 0000664 0000000 0000000 00000006076 15127471011 0021177 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
// PKG_ADD: autoload ("zmq_recv", "zeromq.oct");
DEFUN_DLD (zmq_recv, args, nargout,
"-*- texinfo -*-\n \
@deftypefn {} {@var{data} =} zmq_recv (@var{sock}, @var{len})\n \
@deftypefnx {} {@var{data} =} zmq_recv (@var{sock}, @var{len}, @var{flags})\n \
\n\
Attempt to receive up to @var{len} bytes of data from zeromq socket.\n \
\n \
@subsubheading Inputs\n \
@var{sock} - the socket to receive from.\n \
\n \
@var{len} - number of bytes to read.\n \
\n \
@var{flags} - optional flags to pass to recv\n \
\n \
@subsubheading Outputs\n \
@var{data} - the read data in an uint8 array. \
\n \
@seealso{zmq_socket}\n \
@end deftypefn")
{
init_types ();
if (args.length () < 2
|| args (0).type_id () != octave_zeromq_socket::static_type_id ()
|| (!args (1).OV_ISINTEGER () && !args (1).OV_ISFLOAT ()))
{
print_usage ();
return octave_value (-1);
}
int len = args (1).int_value ();
if (len <= 0)
{
error ("zeromq: unexpected zero or negative length");
return octave_value (-1);
}
int flags = 0;
if (args.length () > 2)
{
if (args (2).OV_ISINTEGER () && !args(2).OV_ISFLOAT ())
{
print_usage ();
return octave_value (-1);
}
flags = args (2).int_value ();
}
//unsigned char* buf = new unsigned char[ len ];
OCTAVE_LOCAL_BUFFER(unsigned char, buf, len);
if (buf == 0)
{
error ("zeromq: error allocating buffer for recv\n");
return octave_value (-1);
}
octave_zeromq_socket * sock = NULL;
const octave_base_value& rep = args (0).get_rep ();
sock = &((octave_zeromq_socket &)rep);
int read = sock->recv (buf,len,flags);
octave_value return_value;
if (read >= 0)
{
uint8NDArray data( dim_vector (1,read) );
for (int i=0; i zmq_recv()
%!error zmq_recv(1)
%!test
%! s = zmq_socket("ZMQ_SUB");
%! assert(!isempty(s))
%! data = zmq_recv(s, 10, ZMQ_DONTWAIT);
%! assert(length(data), 0)
%! zmq_close(s);
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/send.cc 0000664 0000000 0000000 00000005713 15127471011 0021166 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
// PKG_ADD: autoload ("zmq_send", "zeromq.oct");
DEFUN_DLD (zmq_send, args, nargout,
"-*- texinfo -*-\n \
@deftypefn {} {@var{count} =} zmq_send (@var{sock}, @var{data})\n \
@deftypefnx {} {@var{count} =} zmq_send (@var{sock}, @var{data}, @var{flags})\n \
\n\
Attempt to send to @var{data} bytes of data to zeromq socket.\n \
\n \
@subsubheading Inputs\n \
@var{sock} - the socket to receive from.\n \
\n \
@var{data} - data to send - either string or uint8 type.\n \
\n \
@var{flags} - optional flags to pass to send\n \
\n \
@subsubheading Outputs\n \
@var{count} - number of bytes written to socket, or -1 on error.\n \
\n \
@seealso {zmq_socket}\n \
@end deftypefn")
{
init_types ();
if (args.length () < 2
|| args(0).type_id () != octave_zeromq_socket::static_type_id ())
{
print_usage ();
return octave_value (-1);
}
int flags = 0;
if (args.length () > 2)
{
if (args(2).OV_ISINTEGER () && !args(2).OV_ISFLOAT ())
{
print_usage ();
return octave_value (-1);
}
flags = args(2).int_value ();
}
octave_zeromq_socket * sock = NULL;
const octave_base_value& rep = args (0).get_rep ();
sock = &((octave_zeromq_socket &)rep);
int retval = -1;
if (args (1).is_string ())
{
retval = sock->send (args (1).string_value (), flags);
}
else if(args(1).is_uint8_type ())
{
NDArray data = args (1).array_value ();
//uint8_t * buf = new uint8_t[data.numel ()];
OCTAVE_LOCAL_BUFFER (uint8_t, buf, data.numel ());
if (!buf)
error ("zeromq: could allocate memory for send message.\n");
else
{
for(int i=0; isend (buf, data.numel (), flags);
}
}
else
{
error ("zeromq: invalid data type. Must be a string or uint8 data");
}
return octave_value (retval);
}
#if 0
%!error zmq_send()
%!error zmq_send(1)
%!test
%! s = zmq_socket("ZMQ_PUB");
%! assert(!isempty(s))
%! assert(zmq_send(s, "test"), 4);
%! zmq_close(s);
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/setsockopt.cc 0000664 0000000 0000000 00000025745 15127471011 0022442 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016-2020 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
#include
// PKG_ADD: autoload ("zmq_setsockopt", "zeromq.oct");
DEFUN_DLD (zmq_setsockopt, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {} {@var{status} =} zmq_setsockopt (@var{sock}, @var{optionid}, @var{value})\n \
\n\
Set a socket option on a zeromq socket.\n \
\n \
@subsubheading Inputs\n \
@var{sock} - the socket to connect.\n \
\n\
@var{optionid} - the setsockopt option to set.\n \
\n\
@var{value} - the value to set.\n \
\n \
Known valid @var{optionid}s are:\n \
@table @asis\n \
@item @code{ZMQ_SUBSCRIBE}\n \
Subscribe to incoming messages matching the value. The value is either a string or a uint8 array that\n \
must match the start of any incoming message\n \
@item @code{ZMQ_UNSUBSCRIBE}\n \
Unsubscribe from incoming messages\n \
@item @code{ZMQ_CONNECT_TIMEOUT}\n \
Set timeout for connect calls\n \
@item @code{ZMQ_IDENTITY} or @code{ZMQ_ROUTING_ID}\n \
Set the identity of a socket (string or uint8 data)\n \
@item @code{ZMQ_RATE}\n \
Set the multicast data rate\n \
@item @code{ZMQ_PRIORITY}\n \
Set the socket priority (linux only)\n \
@item @code{ZMQ_BACKLOG}\n \
Set the queue length for incoming connections\n \
@item @code{ZMQ_SOCKS_PROXY}\n \
Set the socks5 proxy value (string)\n \
@item @code{ZMQ_CURVE_SERVER}\n \
Set whether socket is a curve server (1) or not (0)\n \
@item @code{ZMQ_CURVE_PRIVATEKEY}\n \
Set the curve socket private key (string)\n \
@item @code{ZMQ_CURVE_PUBLICKEY}\n \
Set the curve socket public key (string)\n \
@item @code{ZMQ_CURVE_SERVERKEY}\n \
Set the curve socket public key (string)\n \
@item @code{ZMQ_PLAIN_SERVER}\n \
Set whether socket server will use plain authentication (1) or not (0)\n \
@item @code{ZMQ_PLAIN_USERNAME}\n \
Set the plain socket username (string)\n \
@item @code{ZMQ_PLAIN_PASSWORD}\n \
Set the plain socket password (string)\n \
@item @code{ZMQ_GSSAPI_SERVER}\n \
Set whether socket server will use gssapi authentication (1) or not (0)\n \
@item @code{ZMQ_GSSAPI_PLAINTEXT}\n \
Set whether socket will encrypt gssapi authentication (1) or not (0)\n \
@item @code{ZMQ_GSSAPI_PRINCIPAL}\n \
Set the name of the gssapi principal (string)\n \
@item @code{ZMQ_GSSAPI_SERVICE_PRINCIPAL}\n \
Set the name of the gssapi service principal (string)\n \
@end table\n \
\n \
@subsubheading Outputs\n \
@var{status} - status for setsockopt.\n \
On success, setsockopt will return @var{status} of true \n \
\n \
@seealso {zmq_getsockopt, ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE, ZMQ_CONNECT_TIMEOUT}\n \
@end deftypefn")
{
init_types ();
if (args.length () != 3 ||
args (0).type_id () != octave_zeromq_socket::static_type_id ())
{
print_usage ();
return octave_value (false);
}
if (args (1).OV_ISINTEGER () && !args (1).OV_ISFLOAT ())
{
print_usage ();
return octave_value (false);
}
octave_zeromq_socket * sock = NULL;
const octave_base_value& rep = args (0).get_rep ();
sock = &((octave_zeromq_socket &)rep);
int opt = args (1).int_value ();
bool ret = false;
std::string strvalue;
uint8_t binvalue[256];
size_t binsize;
switch(opt)
{
case ZMQ_SUBSCRIBE:
if( !args (2).is_string ())
{
error("zeromq: expected string for option value");
return octave_value (false);
}
strvalue = args (2).string_value ();
ret = sock->setsockopt (opt, strvalue.c_str (), strvalue.length ());
break;
case ZMQ_UNSUBSCRIBE:
ret = sock->setsockopt (opt, 0,0);
break;
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4,2,0)
case ZMQ_CONNECT_TIMEOUT:
if (args (2).OV_ISINTEGER () && !args (2).OV_ISFLOAT ())
{
error("zeromq: expected integer parameter");
return octave_value (false);
}
else
{
int value = args (2).int_value ();
ret = sock->setsockopt (opt, &value, sizeof(value));
}
break;
#endif
#ifdef ZMQ_SOCKS_PROXY
case ZMQ_SOCKS_PROXY:
if (args (2).is_string ())
{
strvalue = args (2).string_value ();
}
else
{
error("zeromq: expected string option value");
return octave_value (false);
}
ret = sock->setsockopt (opt, strvalue.c_str(), strvalue.length());
break;
#endif
#ifdef ZMQ_CURVE_SERVER
case ZMQ_CURVE_SERVER:
if (args (2).OV_ISINTEGER () && !args (2).OV_ISFLOAT ())
{
error("zeromq: expected integer parameter");
return octave_value (false);
}
else
{
int value = args (2).int_value ();
ret = sock->setsockopt (opt, &value, sizeof(value));
}
break;
#endif
#ifdef ZMQ_CURVE_PUBLICKEY
case ZMQ_CURVE_PUBLICKEY:
if (args (2).is_string ())
{
strvalue = args (2).string_value ();
}
else
{
error("zeromq: expected string for option value");
return octave_value (false);
}
ret = sock->setsockopt (opt, strvalue.c_str(), strvalue.length());
break;
#endif
#ifdef ZMQ_CURVE_SECRETKEY
case ZMQ_CURVE_SECRETKEY:
if (args (2).is_string ())
{
strvalue = args (2).string_value ();
}
else
{
error("zeromq: expected string option value");
return octave_value (false);
}
ret = sock->setsockopt (opt, strvalue.c_str(), strvalue.length());
break;
#endif
#ifdef ZMQ_CURVE_SERVERKEY
case ZMQ_CURVE_SERVERKEY:
if (args (2).is_string ())
{
strvalue = args (2).string_value ();
}
else
{
error("zeromq: expected string option value");
return octave_value (false);
}
ret = sock->setsockopt (opt, strvalue.c_str(), strvalue.length());
break;
#endif
#ifdef ZMQ_PLAIN_SERVER
case ZMQ_PLAIN_SERVER:
if (args (2).OV_ISINTEGER () && !args (2).OV_ISFLOAT ())
{
error("zeromq: expected integer parameter");
return octave_value (false);
}
else
{
int value = args (2).int_value ();
ret = sock->setsockopt (opt, &value, sizeof(value));
}
break;
#endif
#ifdef ZMQ_PLAIN_USERNAME
case ZMQ_PLAIN_USERNAME:
if (args (2).is_string ())
{
strvalue = args (2).string_value ();
}
else
{
error("zeromq: expected string for option value");
return octave_value (false);
}
ret = sock->setsockopt (opt, strvalue.c_str(), strvalue.length());
break;
#endif
#ifdef ZMQ_PLAIN_PASSWORD
case ZMQ_PLAIN_PASSWORD:
if (args (2).is_string ())
{
strvalue = args (2).string_value ();
}
else
{
error("zeromq: expected string for option value");
return octave_value (false);
}
ret = sock->setsockopt (opt, strvalue.c_str(), strvalue.length());
break;
#endif
#ifdef ZMQ_GSSAPI_SERVER
case ZMQ_GSSAPI_SERVER:
if (args (2).OV_ISINTEGER () && !args (2).OV_ISFLOAT ())
{
error("zeromq: expected integer parameter");
return octave_value (false);
}
else
{
int value = args (2).int_value ();
ret = sock->setsockopt (opt, &value, sizeof(value));
}
break;
#endif
#ifdef ZMQ_GSSAPI_PLAINTEXT
case ZMQ_GSSAPI_PLAINTEXT:
if (args (2).OV_ISINTEGER () && !args (2).OV_ISFLOAT ())
{
error("zeromq: expected integer parameter");
return octave_value (false);
}
else
{
int value = args (2).int_value ();
ret = sock->setsockopt (opt, &value, sizeof(value));
}
break;
#endif
#ifdef ZMQ_GSSAPI_PRINCIPAL
case ZMQ_GSSAPI_PRINCIPAL:
if (args (2).is_string ())
{
strvalue = args (2).string_value ();
}
else
{
error("zeromq: expected string for option value");
return octave_value (false);
}
ret = sock->setsockopt (opt, strvalue.c_str(), strvalue.length());
break;
#endif
#ifdef ZMQ_GSSAPI_SERVICE_PRINCIPAL
case ZMQ_GSSAPI_SERVICE_PRINCIPAL:
if (args (2).is_string ())
{
strvalue = args (2).string_value ();
}
else
{
error("zeromq: expected string for option value");
return octave_value (false);
}
ret = sock->setsockopt (opt, strvalue.c_str(), strvalue.length());
break;
#endif
#ifdef ZMQ_PRIORITY
case ZMQ_PRIORITY:
if (args (2).OV_ISINTEGER () && !args (2).OV_ISFLOAT ())
{
error("zeromq: expected integer parameter");
return octave_value (false);
}
else
{
int value = args (2).int_value ();
ret = sock->setsockopt (opt, &value, sizeof(value));
}
break;
#endif
#ifdef ZMQ_RATE
case ZMQ_RATE:
if (args (2).OV_ISINTEGER () && !args (2).OV_ISFLOAT ())
{
error("zeromq: expected integer parameter");
return octave_value (false);
}
else
{
int value = args (2).int_value ();
ret = sock->setsockopt (opt, &value, sizeof(value));
}
break;
#endif
#ifdef ZMQ_BACKLOG
case ZMQ_BACKLOG:
if (args (2).OV_ISINTEGER () && !args (2).OV_ISFLOAT ())
{
error("zeromq: expected integer parameter");
return octave_value (false);
}
else
{
int value = args (2).int_value ();
ret = sock->setsockopt (opt, &value, sizeof(value));
}
break;
#endif
#ifdef ZMQ_ROUING_ID
case ZMQ_ROUTING_ID:
#else
case ZMQ_IDENTITY:
#endif
if (args (2).is_string ())
{
strvalue = args (2).string_value ();
binsize = strvalue.length ();
if (binsize > 255) binsize = 255;
for (size_t i=0; i 255) binsize = 255;
for (size_t i=0; isetsockopt (opt, binvalue, binsize);
break;
default:
error ("zeromq: invalid setsockopt value %d", opt);
break;
}
return octave_value (ret);
}
#if 0
%!error zmq_setsockopt()
%!error zmq_setsockopt(1)
// valid test of setsockopt in getsockopt
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/socket.cc 0000664 0000000 0000000 00000006250 15127471011 0021522 0 ustar 00root root 0000000 0000000 // Copyright (C) 2014-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
// zeromq includes
#include
// PKG_ADD: autoload ("zmq_socket", "zeromq.oct");
DEFUN_DLD (zmq_socket, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {} {@var{sock} =} zmq_socket (@var{type})\n \
\n\
Create a zeromq socket.\n \
\n \
@subsubheading Inputs\n \
@var{type} - the socket type to create.\n \
\n \
Supported socket types are:\n \
@table @asis\n \
@item @code{ZMQ_PUB} \n \
Publish socket\n \
@item @code{ZMQ_SUB} \n \
Subscribe socket\n \
@item @code{ZMQ_REQ} \n \
Request socket\n \
@item @code{ZMQ_REP} \n \
Reply socket\n \
@item @code{ZMQ_PULL} \n \
Pull socket\n \
@item @code{ZMQ_PUSH} \n \
Push socket\n \
@item @code{ZMQ_PAIR} \n \
Pair socket\n \
@item @code{ZMQ_DEALER}\n \
Dealer socket\n \
@item @code{ZMQ_ROUTER}\n \
Router socket\n \
@item @code{ZMQ_XPUB} \n \
Publish socket\n \
@item @code{ZMQ_XSUB} \n \
Subscribe socket\n \
@item @code{ZMQ_STREAM} \n \
Stream socket\n \
@end table\n \
\n \
@subsubheading Outputs\n \
@var{sock} - an instance of @var{octave_zeromq_socket} class.\n \
\n \
@seealso {ZMQ_PUB, ZMQ_SUB, ZMQ_PUSH, ZMQ_PULL, ZMQ_REQ, ZMQ_REP, ZMQ_PAIR, ZMQ_DEALER, ZMQ_ROUTER, ZMQ_XPUB, ZMQ_XSUB, ZMQ_STREAM}\n \
@end deftypefn")
{
if (nargout != 1)
{
print_usage ();
return octave_value ();
}
int socktype = ZMQ_PUB;
if (args.length () > 0)
{
if (args (0).OV_ISINTEGER () || args (0).OV_ISFLOAT ())
{
socktype = args (0).int_value ();
}
else if (args (0).is_string ())
{
socktype = octave_zeromq_socket::gettypeval(args (0).string_value ());
}
else
{
print_usage ();
return octave_value ();
}
}
init_types ();
octave_zeromq_socket * retvalue = new octave_zeromq_socket ();
if ( retvalue->create (socktype) == false )
{
delete retvalue;
return octave_value ();
}
return octave_value (retvalue);
}
#if 0
%!error zmq_socket()
%!test
%! s = zmq_socket();
%! assert(!isempty(s))
%! zmq_close(s);
%!test
%! s = zmq_socket(ZMQ_SUB);
%! assert(!isempty(s))
%! zmq_close(s);
%!test
%! s = zmq_socket(ZMQ_SUB);
%! assert(isa(s, 'octave_zeromq_socket'))
%! zmq_close(s);
%!test
%! s = zmq_socket("ZMQ_SUB");
%! assert(!isempty(s))
%! zmq_close(s);
%!error a = zmq_socket("invalid");
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/socket_class.cc 0000664 0000000 0000000 00000026626 15127471011 0022720 0 ustar 00root root 0000000 0000000 // Copyright (C) 2014-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
// zeromq includes
#include
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3,0,0)
#define RECV_POLL_TIME 1000
#else
#define RECV_POLL_TIME 100
#endif
static void * global_context = NULL;
#ifdef DEFINE_OCTAVE_ALLOCATOR
DEFINE_OCTAVE_ALLOCATOR (octave_zeromq_socket);
#endif
DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_zeromq_socket, "octave_zeromq_socket", "octave_zeromq_socket");
octave_zeromq_socket::octave_zeromq_socket (void)
: fieldnames(5)
{
sock = 0;
type = -1;
fieldnames[0] = "type";
fieldnames[1] = "endpoint";
fieldnames[2] = "identity";
fieldnames[3] = "recvmore";
fieldnames[4] = "events";
}
octave_zeromq_socket::octave_zeromq_socket (const octave_zeromq_socket &s)
{
// should never be called
sock = 0;
type = s.type;
fieldnames = s.fieldnames;
}
octave_zeromq_socket::~octave_zeromq_socket(void)
{
close ();
}
octave_base_value *
octave_zeromq_socket::empty_clone (void) const
{
return new octave_zeromq_socket();
}
octave_base_value *
octave_zeromq_socket::clone (void) const
{
return new octave_zeromq_socket (*this);
}
octave_base_value *
octave_zeromq_socket::unique_clone (void)
{
OV_COUNT++;
return this;
}
void *
octave_zeromq_socket::socket (void)
{
return sock;
}
const void *
octave_zeromq_socket::socket (void) const
{
return sock;
}
int
octave_zeromq_socket::socktype (void) const
{
return type;
}
bool
octave_zeromq_socket::create (int socket_type)
{
if (sock)
{
error ("zeromq: Already created\n");
return false;
}
sock = zmq_socket (global_context, socket_type);
if (sock == 0)
{
error ("zeromq: failed to create socket - %s\n", zmq_strerror (errno));
return false;
}
type = socket_type;
return true;
}
void
octave_zeromq_socket::close (void)
{
if (sock)
zmq_close (sock);
sock = 0;
type = -1;
endpoint = "";
}
bool
octave_zeromq_socket::connect (const std::string &inendpoint)
{
if (sock == 0)
{
error ("zeromq: must create socket before calling connect\n");
return false;
}
if (zmq_connect (sock, inendpoint.c_str ()) != 0)
{
error ("zeromq: failed to connect socket - %s\n", zmq_strerror (errno));
return false;
}
endpoint = inendpoint;
return true;
}
bool
octave_zeromq_socket::disconnect (const std::string &inendpoint)
{
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3,0,0)
warning ("zeromq: this version of the zmq library does not support disconnect");
#else
if (sock == 0)
{
error ("zeromq: must create socket before calling disconnect\n");
return false;
}
if (zmq_disconnect (sock, inendpoint.c_str ()) != 0)
{
error ("zeromq: failed to disconnect socket - %s\n", zmq_strerror (errno));
return false;
}
#endif
return true;
}
bool
octave_zeromq_socket::bind (const std::string &inendpoint)
{
if (sock == 0)
{
error ("zeromq: must create socket before calling bind\n");
return false;
}
if (zmq_bind (sock, inendpoint.c_str ()))
{
error ("zeromq: failed to bind socket - %s\n", zmq_strerror (errno));
return false;
}
endpoint = inendpoint;
return true;
}
bool
octave_zeromq_socket::unbind (const std::string &inendpoint)
{
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3,0,0)
warning ("zeromq: this version of the zmq library does not support unbind");
#else
if (sock == 0)
{
error ("zeromq: must create socket before calling unbind\n");
return false;
}
if (zmq_unbind (sock, inendpoint.c_str ()))
{
error ("zeromq: failed to unbind socket - %s\n", zmq_strerror (errno));
return false;
}
endpoint = "";
#endif
return true;
}
bool
octave_zeromq_socket::setsockopt (int opt, const void * val, size_t len)
{
if (sock == 0)
{
error ("zeromq: invalid socket\n");
return false;
}
if (zmq_setsockopt (sock, opt, val, len))
{
error ("zeromq: failed to setsockopt - %s\n", zmq_strerror (errno));
return false;
}
return true;
}
bool
octave_zeromq_socket::getsockopt (int opt, void * val, size_t *len)
{
if (sock == 0)
{
error ("zeromq: invalid socket\n");
return false;
}
if (zmq_getsockopt (sock, opt, val, len))
{
error ("zeromq: failed to getsockopt - %s\n", zmq_strerror (errno));
return false;
}
return true;
}
int
octave_zeromq_socket::send (const std::string &str, int flags)
{
return send ((const uint8_t *)str.c_str (), str.length (), flags) ;
}
int
octave_zeromq_socket::send (const uint8_t *data, size_t sz, int flags)
{
if (sock == 0)
{
error ("zeromq: must create socket before calling send\n");
return -1;
}
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3,0,0)
zmq_msg_t msg;
if(zmq_msg_init_size(&msg,sz))
{
error ("zeromq: failed to create msg\n");
return -1;
}
memcpy(zmq_msg_data(&msg), data, sz);
int len = zmq_send (sock, &msg, flags);
// zmq 2.2 returns 0 if sent ok, we want bytes written
if (len == 0) len = sz;
zmq_msg_close(&msg);
#else
// new versions of zmq have a zmq_send for data
int len = zmq_send (sock, data, sz, flags);
#endif
return len;
}
int
octave_zeromq_socket::recv (uint8_t *data, size_t sz, int flags)
{
if (sock == 0)
{
error ("zeromq: must create socket before calling recv\n");
return -1;
}
// if want to wait for data
if ((flags & ZMQ_NOBLOCK) == 0)
{
int have_data = 0;
do
{
zmq_pollitem_t pitem;
pitem.socket = sock;
pitem.events = ZMQ_POLLIN;
pitem.fd = 0;
have_data = zmq_poll (&pitem, 1, RECV_POLL_TIME);
OCTAVE_QUIT;
}
while (have_data == 0);
if (have_data == -1)
{
error ("zeromq: error waiting for data in recv\n");
}
}
int len = -1;
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3,0,0)
zmq_msg_t msg;
if (zmq_msg_init (&msg))
{
error ("zeromq: failed to create msg\n");
return -1;
}
len = zmq_recv (sock, &msg, flags);
if (len == 0)
{
len = static_cast(zmq_msg_size(&msg));
if (len > sz) len = sz;
memcpy (data, zmq_msg_data (&msg), len);
}
zmq_msg_close (&msg);
#else
len = zmq_recv (sock, data, sz, flags);
if (len >= 0 && static_cast(len) > sz) len = sz;
#endif
return len;
}
int
octave_zeromq_socket::gettypeval (const std::string &str)
{
if(str == "ZMQ_PUB") return ZMQ_PUB;
if(str == "ZMQ_SUB") return ZMQ_SUB;
if(str == "ZMQ_XPUB") return ZMQ_XPUB;
if(str == "ZMQ_XSUB") return ZMQ_XSUB;
if(str == "ZMQ_REQ") return ZMQ_REQ;
if(str == "ZMQ_REP") return ZMQ_REP;
if(str == "ZMQ_DEALER") return ZMQ_DEALER;
if(str == "ZMQ_PAIR") return ZMQ_PAIR;
if(str == "ZMQ_ROUTER") return ZMQ_ROUTER;
if(str == "ZMQ_PUSH") return ZMQ_PUSH;
if(str == "ZMQ_PULL") return ZMQ_PULL;
#ifdef ZMQ_STREAM
if(str == "ZMQ_STREAM") return ZMQ_STREAM;
#endif
error ("octave_zeromq_socket: unknown socktype '%s'", str.c_str ());
return -1;
}
std::string
octave_zeromq_socket::gettypestr (int intype) const
{
std::string s = "";
if(intype == -1) intype = type;
switch(intype)
{
case ZMQ_PUB: s = "ZMQ_PUB"; break;
case ZMQ_SUB: s = "ZMQ_SUB"; break;
case ZMQ_XPUB: s = "ZMQ_XPUB"; break;
case ZMQ_XSUB: s = "ZMQ_XSUB"; break;
case ZMQ_REQ: s = "ZMQ_REQ"; break;
case ZMQ_REP: s = "ZMQ_REP"; break;
case ZMQ_PUSH: s = "ZMQ_PUSH"; break;
case ZMQ_PULL: s = "ZMQ_PULL"; break;
case ZMQ_DEALER: s = "ZMQ_DEALER"; break;
case ZMQ_PAIR: s = "ZMQ_PAIR"; break;
case ZMQ_ROUTER: s = "ZMQ_ROUTER"; break;
#ifdef ZMQ_STREAM
case ZMQ_STREAM: s = "ZMQ_STREAM"; break;
#endif
default: s = "NONE"; break;
}
return s;
}
void
octave_zeromq_socket::print (std::ostream& os, bool pr_as_read_syntax) const
{
print_raw (os, pr_as_read_syntax);
newline (os);
}
void
octave_zeromq_socket::print (std::ostream& os, bool pr_as_read_syntax)
{
print_raw (os, pr_as_read_syntax);
newline (os);
}
void
octave_zeromq_socket::print_raw (std::ostream& os, bool pr_as_read_syntax) const
{
os << " ZeroMQ socket"; newline (os);
if(sock)
{
os << " type: " << gettypestr();
newline(os);
os << " endpoint: " << endpoint;
newline(os);
}
else
{
os << " Invalid"; newline(os);
}
}
octave_value_list
octave_zeromq_socket::subsref (const std::string& type, const std::list& idx, int nargout)
{
octave_value_list retval;
int skip = 1;
switch (type[0])
{
default:
error ("octave_zeromq_socket object cannot be indexed with %c", type[0]);
break;
case '.':
{
octave_value_list ovl;
// inc ref count as assign this to octave_value
OV_COUNT++;
ovl (0) = octave_value (this);
ovl (1) = (idx.front ()) (0);
retval = OCTAVE__FEVAL (std::string ("__zmq_properties__"), ovl, 1);
}
break;
}
if (idx.size () > 1 && type.length () > 1)
retval = retval (0).next_subsref (nargout, type, idx, skip);
return retval;
}
octave_value
octave_zeromq_socket::subsasgn (const std::string& type, const std::list& idx, const octave_value& rhs)
{
octave_value retval;
switch (type[0])
{
default:
error ("octave_zeromq_socket object cannot be indexed with %c", type[0]);
break;
case '.':
if (type.length () == 1)
{
octave_value_list ovl;
// inc ref count as assign this to octave_value
OV_COUNT++;
ovl (0) = octave_value (this);
ovl (1) = (idx.front ()) (0);
ovl (2) = rhs;
OCTAVE__FEVAL (std::string ("__zmq_properties__"), ovl, 0);
OV_COUNT++;
retval = octave_value (this);
}
else if (type.length () > 1 && type[1] == '.')
{
// pass along any further assignments
octave_value_list u = subsref (type.substr (0, 1), idx, 1);
if (u.length() > 0)
{
std::list next_idx (idx);
next_idx.erase (next_idx.begin ());
u (0).subsasgn(type.substr (1), next_idx, rhs);
OV_COUNT++;
retval = octave_value (this);
}
}
else
{
error ("octave_zeromq_socket invalid index");
}
}
return retval;
}
static bool type_loaded = false;
void init_types(void)
{
if (!type_loaded)
{
octave_zeromq_socket::register_type ();
type_loaded = true;
}
if (!global_context)
{
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3,0,0)
global_context = zmq_init (1);
#else
global_context = zmq_ctx_new ();
#endif
}
}
gnu-octave-octave-zeromq-ffe3cf0/src/socket_class.h 0000664 0000000 0000000 00000007535 15127471011 0022560 0 ustar 00root root 0000000 0000000 // Copyright (C) 2014-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
#ifndef ZEROMQ_SOCKET_CLASS_H
#define ZEROMQ_SOCKET_CLASS_H
// Octave Includes
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
// string
#include
#include
#include
void init_types(void);
class octave_zeromq_socket : public OCTAVE_BASE_CLASS
{
public:
/**
* default constructor
*/
octave_zeromq_socket (void);
/**
* deconstructor
*/
~octave_zeromq_socket (void);
/**
* access to the zeromq socket
*/
const void * socket (void) const;
void * socket (void);
std::string getendpoint(void) const { return endpoint; }
int socktype (void) const;
// convert sock type
std::string gettypestr(int intype=-1) const;
static int gettypeval(const std::string &str);
/**
* create socket
*/
bool create (int socket_type);
/**
* close created socket
*/
void close (void);
/**
* connect socket
*/
bool connect (const std::string &endpoint);
/**
* disconnect socket
*/
bool disconnect (const std::string &endpoint);
/**
* bind socket
*/
bool bind (const std::string &endpoint);
/**
* unbind socket
*/
bool unbind (const std::string &endpoint);
/**
* send data of size sz bytes
*/
int send (const uint8_t * data, size_t sz, int flags);
/**
* send data string
*/
int send (const std::string &data, int flags);
/**
* read data of up to sz bytes in size
*/
int recv (uint8_t * data, size_t sz, int flags);
/**
* get/setsock option
*/
bool setsockopt (int opt, const void * val, size_t len);
bool getsockopt (int opt, void *value, size_t *len);
/**
* Various properties of the octave_base_value datatype.
*/
bool is_constant (void) const { return true;}
bool is_defined (void) const { return true;}
bool is_object (void) const { return true; }
// required to use subsasn
string_vector map_keys (void) const { return fieldnames; }
dim_vector dims (void) const { static dim_vector dv(1, 1); return dv; }
octave_base_value * clone (void) const;
octave_base_value * empty_clone (void) const;
octave_base_value * unique_clone (void);
/**
* Overloaded methods to print sock as the zeromq id
*/
void print (std::ostream& os, bool pr_as_read_syntax = false) const;
void print (std::ostream& os, bool pr_as_read_syntax = false);
void print_raw (std::ostream& os, bool pr_as_read_syntax) const;
/**
* overloaded methods to get properties
*/
octave_value_list subsref (const std::string& type, const std::list& idx, int nargout);
octave_value subsref (const std::string& type, const std::list& idx)
{
octave_value_list retval = subsref (type, idx, 1);
return (retval.length () > 0 ? retval(0) : octave_value ());
}
octave_value subsasgn (const std::string& type, const std::list& idx, const octave_value& rhs);
private:
octave_zeromq_socket (const octave_zeromq_socket &);
void * sock;
int type;
std::string endpoint;
string_vector fieldnames;
#ifdef DECLARE_OCTAVE_ALLOCATOR
DECLARE_OCTAVE_ALLOCATOR
#endif
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
};
#endif // ZEROMQ_SOCKET_CLASS_H
gnu-octave-octave-zeromq-ffe3cf0/src/strerror.cc 0000664 0000000 0000000 00000002613 15127471011 0022113 0 ustar 00root root 0000000 0000000 // Copyright (C) 2014-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
// zeromq includes
#include
// PKG_ADD: autoload ("zmq_strerror", "zeromq.oct");
DEFUN_DLD (zmq_strerror, args, nargout,
"-*- texinfo -*-\n \
@deftypefn {} {@var{errorstr} =} zmq_strerror ()\n \
\n\
Get the last error from zeromq.\n \
\n \
@subsubheading Inputs\n \
None\n \
@subsubheading Outputs\n \
@var{errorstr} - a string representation of the last error \
\n \
@end deftypefn")
{
if (args.length () > 0)
{
print_usage ();
return octave_value (-1);
}
std::string str = zmq_strerror (errno);
return octave_value (str);
}
gnu-octave-octave-zeromq-ffe3cf0/src/unbind.cc 0000664 0000000 0000000 00000004132 15127471011 0021506 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
// PKG_ADD: autoload ("zmq_unbind", "zeromq.oct");
DEFUN_DLD (zmq_unbind, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {} {@var{status} =} zmq_unbind (@var{sock}, @var{endpoint})\n \
\n\
Unbind a previously bound zeromq socket from a endpoint.\n \
\n \
@subsubheading Inputs\n \
@var{sock} - the socket to unbind.\n \
\n \
@var{endpoint} - the endpoint string to unbind.\n \
\n \
@subsubheading Outputs\n \
@var{status} - status for unbind.\n \
On success, unbind will return a @var{status} of true \n \
\n \
@seealso { zmq_socket, zmq_bind }\n \
@end deftypefn")
{
init_types ();
if (args.length () != 2
|| args (0).type_id () != octave_zeromq_socket::static_type_id ()
|| ! args (1).is_string ())
{
print_usage ();
return octave_value (false);
}
octave_zeromq_socket * sock = NULL;
const octave_base_value& rep = args (0).get_rep ();
sock = &((octave_zeromq_socket &)rep);
bool ret = sock->unbind (args (1).string_value ());
return octave_value (ret);
}
#if 0
%!error zmq_unbind()
%!error zmq_unbind(1)
%!test
%! s = zmq_socket("ZMQ_PUB");
%! zmq_bind(s, "tcp://127.0.0.1:10000");
%! zmq_unbind(s, "tcp://127.0.0.1:10000");
%! zmq_close(s);
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/undef-ah-octave.h 0000664 0000000 0000000 00000000706 15127471011 0023042 0 ustar 00root root 0000000 0000000 /* To be included at the top of config.h (by autoheader). Avoid
warnings for redefining AH-generated preprocessor symbols of
Octave. */
#ifdef PACKAGE_BUGREPORT
#undef PACKAGE_BUGREPORT
#endif
#ifdef PACKAGE_NAME
#undef PACKAGE_NAME
#endif
#ifdef PACKAGE_STRING
#undef PACKAGE_STRING
#endif
#ifdef PACKAGE_TARNAME
#undef PACKAGE_TARNAME
#endif
#ifdef PACKAGE_URL
#undef PACKAGE_URL
#endif
#ifdef PACKAGE_VERSION
#undef PACKAGE_VERSION
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/version.cc 0000664 0000000 0000000 00000003306 15127471011 0021716 0 ustar 00root root 0000000 0000000 // Copyright (C) 2014-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "socket_class.h"
// zeromq includes
#include
// PKG_ADD: autoload ("zmq_version", "zeromq.oct");
DEFUN_DLD (zmq_version, args, nargout,
"-*- texinfo -*-\n \
@deftypefn {} {[@var{major}, @var{minor}, @var{patch}] =} zmq_version ()\n \
\n\
Get the ZeroMQ library version.\n \
\n \
@subsubheading Inputs\n \
None\n \
@subsubheading Outputs\n \
@var{major}, @var{minor} @var{patch} - version of the ZeroMQ library. \
\n \
@end deftypefn")
{
if (args.length () > 0)
{
print_usage ();
return octave_value (-1);
}
int major, minor, patch;
zmq_version (&major, &minor, &patch);
octave_value_list return_list;
return_list (0) = major;
return_list (1) = minor;
return_list (2) = patch;
return return_list;
}
#if 0
%!test
%! [a,b,c] = zmq_version ();
%! assert(~isempty(a));
%! assert(~isempty(b));
%! assert(~isempty(c));
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/z85_decode.cc 0000664 0000000 0000000 00000005265 15127471011 0022170 0 ustar 00root root 0000000 0000000 // Copyright (C) 2019 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
// zeromq includes
#include
// PKG_ADD: autoload ("zmq_z85_decode", "zeromq.oct");
DEFUN_DLD (zmq_z85_decode, args, nargout,
"-*- texinfo -*-\n \
@deftypefn {} {@var{data} =} zmq_z85_decode (@var{instr})\n \
\n\
Decode a z85 encoded string to a binary key.\n \
\n \
@subsubheading Inputs\n \
@var{instr} - a string encoded data\n \
\n \
@subsubheading Outputs\n \
@var{data} - uint8 decoded data\n \
\n \
@end deftypefn")
{
octave_value retval;
if (args.length () != 1)
{
print_usage ();
return octave_value ();
}
if(!args(0).is_string ())
{
error ("zeromq: expected input to be a string");
return octave_value ();
}
std::string in = args (0).string_value ();
int len = in.length ();
if (len % 5 != 0 || len == 0)
{
error ("zeromq: input string size must be divisible by 5");
return octave_value ();
}
#ifdef ZMQ_CURVE
len = (len/5)*4;
OCTAVE_LOCAL_BUFFER (uint8_t, outbuf, len);
if (!outbuf)
{
error ("zeromq: could allocate memory for decoding.\n");
return octave_value ();
}
else
{
uint8_t * out = zmq_z85_decode(outbuf, in.c_str());
if (!out)
{
error ("zeromq: couldn't decode data");
return octave_value ();
}
uint8NDArray data( dim_vector (1,len) );
for (int i=0; i zmq_z85_decode()
%!error zmq_z85_decode("1234", 2)
%!error zmq_z85_decode(1)
%!error zmq_z85_decode("123")
%!assert (zmq_z85_decode("0rJua"), uint8([1 2 3 4]))
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/z85_encode.cc 0000664 0000000 0000000 00000005477 15127471011 0022207 0 ustar 00root root 0000000 0000000 // Copyright (C) 2019 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
// zeromq includes
#include
// PKG_ADD: autoload ("zmq_z85_encode", "zeromq.oct");
DEFUN_DLD (zmq_z85_encode, args, nargout,
"-*- texinfo -*-\n \
@deftypefn {} {@var{dest} =} zmq_z85_encode (@var{data})\n \
\n\
Encode a binary key as Z85 printable text.\n \
\n \
@subsubheading Inputs\n \
@var{data} - uint8 data that must have a size divisible by 4.\n \
\n \
@subsubheading Outputs\n \
@var{dest} - string encoded data\
\n \
@end deftypefn")
{
octave_value retval;
if (args.length () != 1)
{
print_usage ();
return octave_value ();
}
if(!args(0).is_uint8_type ())
{
error ("zeromq: expected input to be uint8 type data");
return octave_value ();
}
NDArray data = args (0).array_value ();
if (data.numel() % 4 != 0 || data.numel() == 0)
{
error ("zeromq: input data size must be divisible by 4");
return octave_value ();
}
#ifdef ZMQ_CURVE
OCTAVE_LOCAL_BUFFER (uint8_t, inbuf, data.numel ());
OCTAVE_LOCAL_BUFFER (char, outbuf, (data.numel () + (data.numel ()/4) + 1));
if (!inbuf || !outbuf)
error ("zeromq: could allocate memory for encoding.\n");
else
{
for(int i=0; i zmq_z85_encode()
%!error zmq_z85_encode(1, 2)
%!error zmq_z85_encode(1)
%!error zmq_z85_encode(uint8([1 2 4]))
%!error zmq_z85_encode([1 2 3 4])
%!assert (zmq_z85_encode(uint8([1 2 3 4])), "0rJua")
#endif
gnu-octave-octave-zeromq-ffe3cf0/src/zeromq.cc 0000664 0000000 0000000 00000010767 15127471011 0021557 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016-2018 John Donoghue
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see .
// Octave Includes
#include
#include
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
// PKG_ADD: autoload ("zeromq", "zeromq.oct");
DEFUN_DLD (zeromq, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {Package} {} zeromq\n \
The zeromq package provides GNU Octave bindings to the ZeroMQ library to provide\n \
fast distributed messaging options using IPC, TCP, TIPC and multi-casting.\n \
\n \
The usage is very close to the ZeroMQ library C language bindings for the socket \n \
creation and manipulation with the exception of creating a zeromq context, \n \
which is automatically done in the bindings internals.\n \
\n \
For example, a basic client that does a request / reply from a server on port\n \
local port 5555 (available as zmq_example1.m):\n \
\n \
@example\n \
\n \
%% Create socket and connect to server\n \
requester = zmq_socket (ZMQ_REQ);\n \
zmq_connect (requester, \"tcp://localhost:5555\");\n \
\n \
%% send some data\n \
zmq_send (requester, uint8(\"Hello\"), 5, 0); \n \
%% try to read up to 10 bytes of reply data.\n \
received = zmq_recv (requester, 10, 0);\n \
\n \
zmq_close (requester);\n \
@end example\n \
\n \
Implemented functions are:\n \
\n \
@table @asis\n \
@item zmq_bind\n \
Bind a zeromq socket to an endpoint.\n \
@item zmq_close\n \
Close a zeromq socket.\n \
@item zmq_connect\n \
Connect a zeromq socket to an endpoint\n \
@item zmq_disconnect\n \
Disconnect a zeromq socket from an endpoint\n \
@item zmq_errno\n \
Get system errno value.\n \
@item zmq_getsockopt\n \
Get current value of a zeromq socket option.\n \
@item zmq_has\n \
Check zmq for a given feature. \n \
@item zmq_poll\n \
Poll a socket or sockets for a timeout or incoming data available.\n \
@item zmq_recv\n \
Attempt to read data from a zeromq socket.\n \
@item zmq_send\n \
Attempt to send data from a zeromq socket.\n \
@item zmq_setsockopt\n \
Set a zeromq socket option.\n \
@item zmq_strerror\n \
Get the last zmq error string.\n \
@item zmq_unbind\n \
Unbind a previously bound zeromq socket.\n \
@item zmq_version\n \
Get the zeromq library version numbers.\n \
@end table\n \
\n \
Implemented functions depending on version of libzmq are:\n \
@table @asis\n \
@item zmq_curve_keypair\n \
Generate a random private/public keypair.\n \
@item zmq_curve_public\n \
Derive the public key from a private key.\n \
@item zmq_z85_decode\n \
decode a z85 encoded string to a binary key.\n \
@item zmq_z85_encode\n \
encode a binary key as Z85 printable text.\n \
@end table\n \
\n \
In addition, a iszmq function is provided to verify whether a object is a zeromq socket\n \
\n \
Example code files for zeromq usage:\n \
\n \
@table @asis\n \
@item zmq_example1\n \
Simple client REQ socket example that attempts to connect to a server and\n \
send a hello command and get back the response.\n \
@item zmq_example2\n \
Simple server REP socket example that creates the server that the client \n \
from example 1 will connect to and responds back to client 'requests'\n \
@item zmq_example3\n \
Simple server PUB socket example that creates 'weather' server sends\n \
weather updates for random zip codes.\n \
@item zmq_example4\n \
Simple client SUB socket example that creates client that connects to the 'weather' \n \
server and subscribes for weather updates from zip-code 10001.\n \
@item zmq_example5\n \
Simple client STREAM socket example that creates client that connects to octave.org \n \
and posts HEAD request.\n \
@end table\n \
\n \
View example code using @code{edit examples/example_name}\n \
\n \
ie: \n \
@example\n \
edit examples/zmq_example1\n \
@end example\n \
\n \
\n \
@seealso{http://zeromq.org, examples/zmq_example1.m, examples/zmq_example2.m, examples/zmq_example3.m, examples/zmq_example4.m, examples/zmq_example5.m}\n \
@end deftypefn")
{
return octave_value();
}
#if 0
%!test zeromq()
#endif