python-websocketd-0.5.orig/0000755000175000017500000000000014374370616015335 5ustar shevekshevekpython-websocketd-0.5.orig/src/0000755000175000017500000000000014374370616016124 5ustar shevekshevekpython-websocketd-0.5.orig/src/websocketd/0000755000175000017500000000000014374361772020261 5ustar shevekshevekpython-websocketd-0.5.orig/src/websocketd/__main__.py0000644000175000017500000000332714245142245022345 0ustar shevekshevek# Python module for serving WebSockets and web pages. # vim: set fileencoding=utf-8 foldmethod=marker : # {{{ Copyright 2013-2022 Bas Wijnen # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero 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 Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # }}} # This can be run from the commandline as python3 -m websocketd # Without an argument, usage is shown. # With the link argument, all js-files are linked into current directory. # With the copy arguemnt, all js-files are copied into current directory. import sys import os import shutil import importlib.resources if len(sys.argv) != 2 or sys.argv[1] not in ('copy', 'link'): print('''\ This module can be run from the command line to copy or link all javascript files into the working directory. Give "copy" or "link" as argument to specify whether the files should be copied or symlinked.''', file = sys.stderr) sys.exit(1) files = [x for x in importlib.resources.contents(__package__) if x.endswith(os.extsep + 'js')] for file in files: print(file) with importlib.resources.path('websocketd', file) as p: if sys.argv[1] == 'link': os.symlink(os.path.realpath(p), file) else: shutil.copy(p, file) python-websocketd-0.5.orig/src/websocketd/builders.js0000644000175000017500000001330214373077664022432 0ustar shevekshevek"use strict"; // Creating and managing elements and their properties. {{{ // Create a new element and return it. Optionally give it a class. function Create(name, className) { // {{{ return document.createElement(name).AddClass(className); } // }}} // Add a child element and return it (for inline chaining). Optionally give it a class. Object.defineProperty(Object.prototype, 'Add', { // {{{ enumerable: false, configurable: true, writable: true, value: function(object, className) { if (!(object instanceof Array)) object = [object]; for (var i = 0; i < object.length; ++i) { if (typeof object[i] == 'string') this.AddText(object[i]); else { this.appendChild(object[i]); object[i].AddClass(className); } } return object[0]; } }); // }}} // Create a new element and add it as a child. Return the new element (for inline chaining). Object.defineProperty(Object.prototype, 'AddElement', { // {{{ enumerable: false, configurable: true, writable: true, value: function(name, className) { var element = document.createElement(name); return this.Add(element, className); } }); // }}} // Add a child text node and return the element (not the text). Object.defineProperty(Object.prototype, 'AddText', { // {{{ enumerable: false, configurable: true, writable: true, value: function(text) { var t = document.createTextNode(text); this.Add(t); return this; } }); // }}} // Remove all child elements. Object.defineProperty(Object.prototype, 'ClearAll', { // {{{ enumerable: false, configurable: true, writable: true, value: function() { while (this.firstChild) this.removeChild(this.firstChild); return this; } }); // }}} // Add a class to an element. Keep all existing classes. Return the element for inline chaining. Object.defineProperty(Object.prototype, 'AddClass', { // {{{ enumerable: false, configurable: true, writable: true, value: function(className) { if (!className) return this; var classes = this.className.split(' '); var newclasses = className.split(' '); for (var i = 0; i < newclasses.length; ++i) { if (newclasses[i] && classes.indexOf(newclasses[i]) < 0) classes.push(newclasses[i]); } this.className = classes.join(' '); return this; } }); // }}} // Remove a class from an element. Keep all other existing classes. Return the element for inline chaining. Object.defineProperty(Object.prototype, 'RemoveClass', { // {{{ enumerable: false, configurable: true, writable: true, value: function(className) { if (!className) return this; var classes = this.className.split(' '); var oldclasses = className.split(' '); for (var i = 0; i < oldclasses.length; ++i) { var pos = classes.indexOf(oldclasses[i]); if (pos >= 0) classes.splice(pos, 1); } this.className = classes.join(' '); return this; } }); // }}} // Check if an element has a given class. Object.defineProperty(Object.prototype, 'HaveClass', { // {{{ enumerable: false, configurable: true, writable: true, value: function(className) { if (!className) return true; var classes = this.className.split(' '); for (var i = 0; i < classes.length; ++i) { var pos = classes.indexOf(className); if (pos >= 0) return true; } return false; } }); // }}} // Add event listener. Return the object for inline chaining. Object.defineProperty(Object.prototype, 'AddEvent', { // {{{ enumerable: false, configurable: true, writable: true, value: function(name, impl, capture) { this.addEventListener(name, impl, !!capture); return this; } }); // }}} // Remove event listener. Arguments should be identical to previous ones for AddEvent. Return the object for inline chaining. Object.defineProperty(Object.prototype, 'RemoveEvent', { // {{{ enumerable: false, configurable: true, writable: true, value: function(name, impl) { this.removeEventListener(name, impl, false); return this; } }); // }}} // Compute offset of object from page origin. Object.defineProperty(Object.prototype, 'Offset', { // {{{ enumerable: false, configurable: true, writable: true, value: function(e) { if (this.offsetParent) return this.offsetParent.Offset({pageX: e.pageX - this.offsetLeft, pageY: e.pageY - this.offsetTop}); return [e.pageX - this.offsetLeft, e.pageY - this.offsetTop]; } }); // }}} // }}} // Build dictionary for cookies. var cookie = function() { // {{{ var ret = {}; var data = document.cookie.split(';'); for (var c = 0; c < data.length; ++c) { var m = data[c].match(/^(.*?)=(.*)$/); if (m === null) continue; ret[m[1].trim()] = m[2].trim(); } return ret; }(); // }}} // Set a cookie to a (new) value. Set to null to discard it. SameSite defaults to 'Strict'. function SetCookie(key, value, SameSite) { // {{{ if (SameSite === undefined) SameSite = 'Strict'; if (value === null) { delete cookie[key]; document.cookie = key + '=; SameSite=' + SameSite + '; expires=Thu, 01 Jan 1970 00:00:01 GMT'; } else { document.cookie = key + '=' + encodeURIComponent(value) + '; SameSite=' + SameSite; } } // }}} // Build dictionary for query string. var search = function() { // {{{ // search[key] is the first given value for each key. // search[''][key] is an array of all given values. var ret = {'': {}}; var add = function(key, value) { key = decodeURIComponent(key); value = decodeURIComponent(value); if (ret[''][key] === undefined) { ret[''][key] = [value]; ret[key] = value; } else ret[''][key].push(value); }; var s = document.location.search; if (s == '') return ret; s = s.substr(1).split('&'); for (var i = 0; i < s.length; ++i) { var pos = s[i].indexOf('='); if (pos == -1) add(s[i], null); else add(s[i].substr(0, pos), s[i].substr(pos + 1)); } return ret; }(); // }}} // vim: set foldmethod=marker : python-websocketd-0.5.orig/src/websocketd/rpc.js0000644000175000017500000001257514114163714021401 0ustar shevekshevek// vim: set foldmethod=marker : var _rpc_calls = new Object; var _rpc_id = 0; var _rpc_queue = []; var _rpc_busy = 0; // Avoid console errors in browsers that lack a console. {{{ // If an item with the id "debugging_console" is defined, use it to place all the console messages in. var console = (window.console = window.console || {}); (function() { var stub = function(name, args) { var e = document.getElementById('debugging_console'); if (!e) return; var p = document.createElement('p'); e.appendChild(p); var sep = this.name + ': '; for (var a = 0; a < args.length; ++a) { var t = document.createTextNode(sep + args[a]); p.appendChild(t); sep = ', '; } }; var methods = ['assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 'timeStamp', 'trace', 'warn']; for (i = 0; i < methods.length; ++i) { // Only stub undefined methods. if (!console[methods[i]]) console[methods[i]] = function() { stub(methods[i], arguments); }; } }()); // }}} // Don't use JSON.stringify, because it doesn't properly handle NaN and Infinity. function _rpc_tojson(obj) { // {{{ if (typeof obj === 'object') { if (Boolean.prototype.isPrototypeOf(obj)) obj = Boolean(obj); else if (Number.prototype.isPrototypeOf(obj)) obj = Number(obj); else if (String.prototype.isPrototypeOf(obj)) obj = String(obj); } if (typeof obj === 'number') return String(obj); else if (obj === undefined || obj === null || typeof obj === 'boolean' || typeof obj === 'string') return JSON.stringify(obj); else if (typeof obj === 'function') return undefined; else if (typeof obj === 'object') { if (Array.prototype.isPrototypeOf(obj)) { var r = obj.reduce(function(prev, current, index, obj) { var c = _rpc_tojson(current); if (c === undefined) c = 'null'; prev.push(c); return prev; }, []); return '[' + r.join(',') + ']'; } var r = []; for (var a in obj) { var c = _rpc_tojson(obj[a]); if (c === undefined) continue; r.push(JSON.stringify(String(a)) + ':' + c); } return '{' + r.join(',') + '}'; } alert('unparsable object ' + String(obj) + ' passed to tojson'); return undefined; } // }}} function Rpc(obj, onopen, onclose) { // {{{ var proto = document.location.protocol; var wproto = proto[proto.length - 2] == 's' ? 'wss://' : 'ws://'; var slash = document.location.pathname[document.location.pathname.length - 1] == '/' ? '' : '/'; var target = wproto + document.location.host + document.location.pathname + slash + 'websocket/' + document.location.search; var ws = new WebSocket(target); var ret = { _websocket: ws }; ws.onopen = onopen; ws.onclose = onclose; ret.lock = function() { return _rpc_busy++ == 0; }; ret.unlock = function() { if (!--_rpc_busy) return _rpc_process(); }; var _rpc_process = function() { if (_rpc_queue.length == 0) { return; } if (!ret.lock()) { return ret.unlock(); } if (_rpc_queue.length > 0) _rpc_message(ws, obj, _rpc_queue.shift().data); ret.unlock(); setTimeout(_rpc_process, 0); }; ws.onmessage = function(frame) { _rpc_queue.push(frame); setTimeout(_rpc_process, 0); }; ret.close = function() { ws.close(); } ret.call = function(name, a, ka, reply) { if (a === undefined) a = []; if (ka === undefined) ka = {}; var my_id; if (reply) { _rpc_id += 1; my_id = _rpc_id; _rpc_calls[my_id] = function(x) { delete _rpc_calls[my_id]; reply(x); }; } else my_id = null; ws.send(_rpc_tojson(['call', [my_id, name, a, ka]])); }; ret.event = function(name, a, ka) { this.call(name, a, ka, null); }; ret.multicall = function(args, cb, rets, from) { if (!rets) rets = []; if (!from) from = 0; if (from >= args.length) { if (cb) cb(rets); return; } var arg = args[from]; this.call(arg[0], arg[1], arg[2], function(r) { rets.push(r); if (arg[3]) arg[3] (r); ret.multicall(args, cb, rets, from + 1); }); }; if (window.Proxy) { ret.proxy = new Proxy(ret, { get: function(target, name) { return function() { var args = []; for (var i = 0; i < arguments.length; ++i) args.push(arguments[i]); ret.call(name, args, {}, null); }; }}); } return ret; } // }}} function _rpc_message(websocket, obj, frame) { // {{{ // Don't use JSON.parse, because it cannot handle NaN and Infinity. // eval seems like a security risk, but it isn't because the data // and this file come from the same server; if it is compromised, // it will just send malicious data directly. var data = eval('(' + frame + ')'); var cmd = data[0]; if (cmd == 'call') { try { var id = data[1][0]; var ret; if (data[1][1] in obj) ret = obj[data[1][1]].apply(obj, data[1][2]); else if ('' in obj) ret = obj[''].apply(obj, [data[1][1]].concat(data[1][2])); else console.warn('Warning: undefined function ' + data[1][1] + ' called, but no default callback defined'); if (id != null) websocket.send(_rpc_tojson(['return', [id, ret]])); } catch (e) { console.error('call returns error', e); if (id != null) websocket.send(_rpc_tojson(['error', e])); } } else if (cmd == 'error') { alert('error: ' + data[1]); } else if (cmd == 'return') { _rpc_calls[data[1][0]] (data[1][1]); } else { alert('unexpected command on websocket: ' + cmd); } } // }}} python-websocketd-0.5.orig/src/websocketd/__init__.py0000644000175000017500000014362314374361427022400 0ustar shevekshevek# Python module for serving WebSockets and web pages. # vim: set fileencoding=utf-8 foldmethod=marker : # {{{ Copyright 2013-2016 Bas Wijnen # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero 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 Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # }}} # Documentation. {{{ '''@mainpage This module can be used to create websockets servers and clients. A websocket client is an HTTP connection which uses the headers to initiate a protocol change. The server is a web server which serves web pages, and also responds to the protocol change headers that clients can use to set up a websocket. Note that the server is not optimized for high traffic. If you need that, use something like Apache to handle all the other content and set up a virtual proxy to this server just for the websocket. In addition to implementing the protocol, this module contains a simple system to use websockets for making remote procedure calls (RPC). This system allows the called procedures to be generators, so they can yield control to the main program and continue running when they need to. This system can also be used locally by using call(). ''' '''@file This module can be used to create websockets servers and clients. A websocket client is an HTTP connection which uses the headers to initiate a protocol change. The server is a web server which serves web pages, and also responds to the protocol change headers that clients can use to set up a websocket. Note that the server is not optimized for high traffic. If you need that, use something like Apache to handle all the other content and set up a virtual proxy to this server just for the websocket. In addition to implementing the protocol, this module contains a simple system to use websockets for making remote procedure calls (RPC). This system allows the called procedures to be generators, so they can yield control to the main program and continue running when they need to. This system can also be used locally by using call(). ''' '''@package websocketd Client WebSockets and webserver with WebSockets support This module can be used to create websockets servers and clients. A websocket client is an HTTP connection which uses the headers to initiate a protocol change. The server is a web server which serves web pages, and also responds to the protocol change headers that clients can use to set up a websocket. Note that the server is not optimized for high traffic. If you need that, use something like Apache to handle all the other content and set up a virtual proxy to this server just for the websocket. In addition to implementing the protocol, this module contains a simple system to use websockets for making remote procedure calls (RPC). This system allows the called procedures to be generators, so they can yield control to the main program and continue running when they need to. This system can also be used locally by using call(). ''' # }}} # See the example server for how to use this module. # imports. {{{ import network from network import endloop, log, set_log_output, add_read, add_write, add_timeout, add_idle, remove_read, remove_write, remove_timeout, remove_idle import os import re import sys import base64 import hashlib import struct import json import tempfile import time import traceback from urllib.parse import urlparse, parse_qs, unquote from http.client import responses as httpcodes try: import numpy as np have_numpy = True except ImportError: have_numpy = False # }}} #def tracer(a, b, c): # print('trace: %s:%d:\t%s' % (a.f_code.co_filename, a.f_code.co_firstlineno, a.f_code.co_name)) # #sys.settrace(tracer) ## Debug level, set from DEBUG environment variable. # * 0: No debugging (default). # * 1: Tracebacks on errors. # * 2: Incoming and outgoing RPC packets. # * 3: Incomplete packet information. # * 4: All incoming and outgoing data. # * 5: Non-websocket data. DEBUG = 0 if os.getenv('NODEBUG') else int(os.getenv('DEBUG', 1)) class Websocket: # {{{ '''Main class implementing the websocket protocol. ''' def __init__(self, port, recv = None, method = 'GET', user = None, password = None, extra = {}, socket = None, mask = (None, True), websockets = None, data = None, real_remote = None, *a, **ka): # {{{ '''When constructing a Websocket, a connection is made to the requested port, and the websocket handshake is performed. This constructor passes any extra arguments to the network.Socket constructor (if it is called), in particular "tls" can be used to control the use of encryption. There objects are also created by the websockets server. For that reason, there are some arguments that should not be used when calling it directly. @param port: Host and port to connect to, same format as python-network uses, or None for an incoming connection (internally used). @param recv: Function to call when a data packet is received asynchronously. @param method: Connection method to use. @param user: Username for authentication. Only plain text authentication is supported; this should only be used over a link with TLS encryption. @param password: Password for authentication. @param extra: Extra headers to pass to the host. @param socket: Existing socket to use for connection, or None to create a new socket. @param mask: Mostly for internal use by the server. Flag whether or not to send and receive masks. (None, True) is the default, which means to accept anything, and send masked packets. Note that the mask that is used for sending is always (0,0,0,0), which is effectively no mask. It is sent to follow the protocol. No real mask is sent, because masks give a false sense of security and provide no benefit. The unmasking implementation is rather slow. When communicating between two programs using this module, the non-mask is detected and the unmasking step is skipped. @param websockets: For interal use by the server. A set to remove the socket from on disconnect. @param data: For internal use by the server. Data to pass through to callback functions. @param real_remote: For internal use by the server. Override detected remote. Used to have proper remotes behind virtual proxy. ''' self.recv = recv self.mask = mask self.websockets = websockets self.websocket_buffer = b'' self.websocket_fragments = b'' self.opcode = None self._is_closed = False self._pong = True # If false, we're waiting for a pong. if socket is None: socket = network.Socket(port, *a, **ka) self.socket = socket # Use real_remote if it was provided. if real_remote: if isinstance(socket.remote, (tuple, list)): self.remote = [real_remote, socket.remote[1]] else: self.remote = [real_remote, None] else: self.remote = socket.remote hdrdata = b'' if port is not None: elist = [] for e in extra: elist.append('%s: %s\r\n' % (e, extra[e])) if user is not None: userpwd = user + ':' + password + '\r\n' else: userpwd = '' p = re.match('^(?:([a-z0-9-]+)://)?([^:/?#]+)(?::([^:/?#]+))?([:/?#].*)?$', port) # Group 1: protocol or None # Group 2: hostname # Group 3: port # Group 4: everything after the port (address, query string, etc) url = p.group(4) if url is None: url = '/' elif not url.startswith('/'): url = '/' + url socket.send(('''\ %s %s HTTP/1.1\r Connection: Upgrade\r Upgrade: websocket\r Sec-WebSocket-Key: 0\r %s%s\r ''' % (method, url, userpwd, ''.join(elist))).encode('utf-8')) while b'\n' not in hdrdata: r = socket.recv() if r == b'': raise EOFError('EOF while reading reply') hdrdata += r pos = hdrdata.index(b'\n') assert int(hdrdata[:pos].split()[1]) == 101 hdrdata = hdrdata[pos + 1:] data = {} while True: while b'\n' not in hdrdata: r = socket.recv() if len(r) == 0: raise EOFError('EOF while reading reply') hdrdata += r pos = hdrdata.index(b'\n') line = hdrdata[:pos].strip() hdrdata = hdrdata[pos + 1:] if len(line) == 0: break key, value = [x.strip() for x in line.decode('utf-8', 'replace').split(':', 1)] data[key] = value self.data = data self.socket.read(self._websocket_read) def disconnect(socket, data): if not self._is_closed: self._is_closed = True if self.websockets is not None: self.websockets.remove(self) self._websocket_closed() return b'' if self.websockets is not None: self.websockets.add(self) self.socket.disconnect_cb(disconnect) self._websocket_opened() if len(hdrdata) > 0: self._websocket_read(hdrdata) if DEBUG > 2: log('opened websocket') # }}} def _websocket_read(self, data, sync = False): # {{{ # Websocket data consists of: # 1 byte: # bit 7: 1 for last (or only) fragment; 0 for other fragments. # bit 6-4: extension stuff; must be 0. # bit 3-0: opcode. # 1 byte: # bit 7: 1 if masked, 0 otherwise. # bit 6-0: length or 126 or 127. # If 126: # 2 bytes: length # If 127: # 8 bytes: length # If masked: # 4 bytes: mask # length bytes: (masked) payload #log('received: ' + repr(data)) if DEBUG > 2: log('received %d bytes' % len(data)) if DEBUG > 3: log('waiting: ' + ' '.join(['%02x' % x for x in self.websocket_buffer]) + ''.join([chr(x) if 32 <= x < 127 else '.' for x in self.websocket_buffer])) log('data: ' + ' '.join(['%02x' % x for x in data]) + ''.join([chr(x) if 32 <= x < 127 else '.' for x in data])) self.websocket_buffer += data while len(self.websocket_buffer) > 0: if self.websocket_buffer[0] & 0x70: # Protocol error. log('extension stuff %x, not supported!' % self.websocket_buffer[0]) self.socket.close() return None if len(self.websocket_buffer) < 2: # Not enough data for length bytes. if DEBUG > 2: log('no length yet') return None b = self.websocket_buffer[1] have_mask = bool(b & 0x80) b &= 0x7f if have_mask and self.mask[0] is True or not have_mask and self.mask[0] is False: # Protocol error. log('mask error') self.socket.close() return None if b == 127: if len(self.websocket_buffer) < 10: # Not enough data for length bytes. if DEBUG > 2: log('no 4 length yet') return None l = struct.unpack('!Q', self.websocket_buffer[2:10])[0] pos = 10 elif b == 126: if len(self.websocket_buffer) < 4: # Not enough data for length bytes. if DEBUG > 2: log('no 2 length yet') return None l = struct.unpack('!H', self.websocket_buffer[2:4])[0] pos = 4 else: l = b pos = 2 if len(self.websocket_buffer) < pos + (4 if have_mask else 0) + l: # Not enough data for packet. if DEBUG > 2: log('no packet yet(%d < %d)' % (len(self.websocket_buffer), pos + (4 if have_mask else 0) + l)) # Long packets should not cause ping timeouts. self._pong = True return None header = self.websocket_buffer[:pos] opcode = header[0] & 0xf if have_mask: mask = [x for x in self.websocket_buffer[pos:pos + 4]] pos += 4 data = self.websocket_buffer[pos:pos + l] # The following is slow! # Don't do it if the mask is 0; this is always true if talking to another program using this module. if mask != [0, 0, 0, 0]: if have_numpy: padding = 3 - (len(data) - 1) % 4 data_array = np.frombuffer(data + b'\0' * padding, dtype = np.int8).reshape((-1, 4)) data = (data_array ^ np.array(mask, dtype = np.int8).reshape((1, 4))).tobytes() if padding > 0: data = data[:-padding] else: data = bytes([x ^ mask[i & 3] for i, x in enumerate(data)]) else: data = self.websocket_buffer[pos:pos + l] self.websocket_buffer = self.websocket_buffer[pos + l:] if self.opcode is None: self.opcode = opcode elif opcode != 0: # Protocol error. # Exception: pongs are sometimes sent asynchronously. # Theoretically the packet can be fragmented, but that should never happen; asynchronous pongs seem to be a protocol violation anyway... if opcode == 10: # Pong. self._pong = True else: log('invalid fragment') self.socket.close() return None if (header[0] & 0x80) != 0x80: # fragment found; not last. self._pong = True self.websocket_fragments += data if DEBUG > 2: log('fragment recorded') return None # Complete frame has been received. data = self.websocket_fragments + data self.websocket_fragments = b'' opcode = self.opcode self.opcode = None if opcode == 8: # Connection close request. self._websocket_close() return None elif opcode == 9: # Ping. self._websocket_send(data, 10) # Pong elif opcode == 10: # Pong. self._pong = True elif opcode == 1: # Text. data = data.decode('utf-8', 'replace') if sync: return data if self.recv: self.recv(self, data) else: log('warning: ignoring incoming websocket frame') elif opcode == 2: # Binary. if sync: return data if self.recv: self.recv(self, data) else: log('warning: ignoring incoming websocket frame (binary)') else: log('invalid opcode') self.socket.close() # }}} def _websocket_send(self, data, opcode = 1): # Send a WebSocket frame. {{{ '''Send a Websocket frame to the remote end of the connection. @param data: Data to send. @param opcode: Opcade to send. 0 = fragment, 1 = text packet, 2 = binary packet, 8 = close request, 9 = ping, 10 = pong. ''' if DEBUG > 3: log('websend:' + repr(data)) assert opcode in(0, 1, 2, 8, 9, 10) if self._is_closed: return None if opcode == 1: data = data.encode('utf-8') if self.mask[1]: maskchar = 0x80 # Masks are stupid, but the standard requires them. Don't waste time on encoding (or decoding, if also using this module). mask = b'\0\0\0\0' else: maskchar = 0 mask = b'' if len(data) < 126: l = bytes((maskchar | len(data),)) elif len(data) < 1 << 16: l = bytes((maskchar | 126,)) + struct.pack('!H', len(data)) else: l = bytes((maskchar | 127,)) + struct.pack('!Q', len(data)) try: self.socket.send(bytes((0x80 | opcode,)) + l + mask + data) except: # Something went wrong; close the socket(in case it wasn't yet). if DEBUG > 0: traceback.print_exc() log('closing socket due to problem while sending.') self.socket.close() if opcode == 8: self.socket.close() # }}} def _websocket_ping(self, data = b''): # Send a ping; return False if no pong was seen for previous ping. Other received packets also count as a pong. {{{ '''Send a ping, return if a pong was received since last ping. @param data: Data to send with the ping. @return True if a pong was received since last ping, False if not. ''' ret = self._pong self._pong = False self._websocket_send(data, opcode = 9) return ret # }}} def _websocket_close(self): # Close a WebSocket. (Use self.socket.close for other connections.) {{{ '''Send close request, and close the connection. @return None. ''' self._websocket_send(b'', 8) self.socket.close() # }}} def _websocket_opened(self): # {{{ '''This function does nothing by default, but can be overridden by the application. It is called when a new websocket is opened. As this happens from the constructor, it is useless to override it in a Websocket object; it must be overridden in the class. @return None. ''' pass # }}} def _websocket_closed(self): # {{{ '''This function does nothing by default, but can be overridden by the application. It is called when the websocket is closed. @return None. ''' pass # }}} # }}} # Set of inactive websockets, and idle handle for _activate_all. _activation = [set(), None] def call(reply, target, *a, **ka): # {{{ '''Make a call to a function or generator. If target is a generator, the call will return when it finishes. Yielded values are ignored. Extra arguments are passed to target. @param reply: Function to call with return value when it is ready, or None. @param target: Function or generator to call. @param a: Arguments that are passed to target. @param ka: Keyword arguments that are passed to target. @return None. ''' ret = target(*a, **ka) if type(ret) is not RPC._generatortype: if reply is not None: reply(ret) return # Target is a generator. def wake(arg = None): try: return ret.send(arg) except StopIteration as result: if reply is not None: reply(result.value) # Start the generator. wake() # Send it its wakeup function. wake(wake) # }}} class RPC(Websocket): # {{{ '''Remote Procedure Call over Websocket. This class manages a communication object, and on the other end of the connection a similar object should exist. When calling a member of this class, the request is sent to the remote object and the function is called there. The return value is sent back and returned to the caller. Exceptions are also propagated. Instead of calling the method, the item operator can be used, or the event member: obj.remote_function(...) calls the function and waits for the return value; obj.remote_function[...] or obj.remote_function.event(...) will return immediately and ignore the return value. If no communication object is given in the constructor, any calls that the remote end attempts will fail. ''' _generatortype = type((lambda: (yield))()) _index = 0 _calls = {} @classmethod def _get_index(cls): # {{{ while cls._index in cls._calls: cls._index += 1 # Put a limit on the _index values. if cls._index >= 1 << 31: cls._index = 0 while cls._index in cls._calls: cls._index += 1 return cls._index # }}} def __init__(self, port, recv = None, error = None, *a, **ka): # {{{ '''Create a new RPC object. Extra parameters are passed to the Websocket constructor, which passes its extra parameters to the network.Socket constructor. @param port: Host and port to connect to, same format as python-network uses. @param recv: Function (or class) that receives this object as an argument and returns a communication object. ''' _activation[0].add(self) if _activation[1] is None: _activation[1] = add_idle(_activate_all) self._delayed_calls = [] ## Groups are used to do selective broadcast() events. self.groups = set() Websocket.__init__(self, port, recv = RPC._recv, *a, **ka) self._error = error self._target = recv(self) if recv is not None else None # }}} def __call__(self): # {{{ '''Internal use only. Do not call. Activate the websocket; send initial frames. @return None. ''' if self._delayed_calls is None: return calls = self._delayed_calls self._delayed_calls = None for call in calls: if not hasattr(self._target, call[1]) or not callable(getattr(self._target, call[1])): self._send('error', 'invalid delayed call frame %s' % repr(call)) else: self._call(call[0], call[1], call[2], call[3]) # }}} class _wrapper: # {{{ def __init__(self, base, attr): # {{{ self.base = base self.attr = attr # }}} def __call__(self, *a, **ka): # {{{ my_id = RPC._get_index() self.base._send('call', (my_id, self.attr, a, ka)) my_call = [None] RPC._calls[my_id] = lambda x: my_call.__setitem__(0, (x,)) # Make it a tuple so it cannot be None. while my_call[0] is None: data = self.base._websocket_read(self.base.socket.recv(), True) while data is not None: self.base._recv(data) data = self.base._websocket_read(b'') del RPC._calls[my_id] return my_call[0][0] # }}} def __getitem__(self, *a, **ka): # {{{ self.base._send('call', (None, self.attr, a, ka)) # }}} def bg(self, reply, *a, **ka): # {{{ my_id = RPC._get_index() self.base._send('call', (my_id, self.attr, a, ka)) RPC._calls[my_id] = lambda x: self.do_reply(reply, my_id, x) # }}} def wait(self, wake, *a, **ka): # {{{ self.bg(wake, *a, **ka) return (yield) # }}} def do_reply(self, reply, my_id, ret): # {{{ del RPC._calls[my_id] reply(ret) # }}} # alternate names. {{{ def call(self, *a, **ka): self.__call__(*a, **ka) def event(self, *a, **ka): self.__getitem__(*a, **ka) # }}} # }}} def _send(self, type, object): # {{{ '''Send an RPC packet. @param type: The packet type. One of "return", "error", "call". @param object: The data to send. Return value, error message, or function arguments. ''' if DEBUG > 1: log('sending:' + repr(type) + repr(object)) Websocket._websocket_send(self, json.dumps((type, object))) # }}} def _parse_frame(self, frame): # {{{ '''Decode an RPC packet. @param frame: The packet. @return (type, object) or (None, error_message). ''' try: # Don't choke on Chrome's junk at the end of packets. data = json.JSONDecoder().raw_decode(frame)[0] except ValueError: log('non-json frame: %s' % repr(frame)) return (None, 'non-json frame') if type(data) is not list or len(data) != 2 or not isinstance(data[0], str): log('invalid frame %s' % repr(data)) return (None, 'invalid frame') if data[0] == 'call': if not isinstance(data[1], list): log('invalid call frame (no list) %s' % repr(data)) return (None, 'invalid frame') if len(data[1]) != 4: log('invalid call frame (list length is not 4) %s' % repr(data)) return (None, 'invalid frame') if (data[1][0] is not None and not isinstance(data[1][0], int)): log('invalid call frame (invalid id) %s' % repr(data)) return (None, 'invalid frame') if not isinstance(data[1][1], str): log('invalid call frame (no string target) %s' % repr(data)) return (None, 'invalid frame') if not isinstance(data[1][2], list): log('invalid call frame (no list args) %s' % repr(data)) return (None, 'invalid frame') if not isinstance(data[1][3], dict): log('invalid call frame (no dict kwargs) %s' % repr(data)) return (None, 'invalid frame') if self._delayed_calls is None and (not hasattr(self._target, data[1][1]) or not callable(getattr(self._target, data[1][1]))): log('invalid call frame (no callable) %s' % repr(data)) return (None, 'invalid frame') elif data[0] not in ('error', 'return'): log('invalid frame type %s' % repr(data)) return (None, 'invalid frame') return data # }}} def _recv(self, frame): # {{{ '''Receive a websocket packet. @param frame: The packet. @return None. ''' data = self._parse_frame(frame) if DEBUG > 1: log('packet received: %s' % repr(data)) if data[0] is None: self._send('error', data[1]) return elif data[0] == 'error': if DEBUG > 0: traceback.print_stack() if self._error is not None: self._error(data[1]) else: raise ValueError(data[1]) elif data[0] == 'event': # Do nothing with this; the packet is already logged if DEBUG > 1. return elif data[0] == 'return': assert data[1][0] in RPC._calls RPC._calls[data[1][0]] (data[1][1]) return elif data[0] == 'call': try: if self._delayed_calls is not None: self._delayed_calls.append(data[1]) else: self._call(data[1][0], data[1][1], data[1][2], data[1][3]) except: traceback.print_exc() log('error: %s' % str(sys.exc_info()[1])) self._send('error', traceback.format_exc()) else: self._send('error', 'invalid RPC command') # }}} def _call(self, reply, member, a, ka): # {{{ '''Make local function call at remote request. The local function may be a generator, in which case the call will return when it finishes. Yielded values are ignored. @param reply: Return code, or None for event. @param member: Requested function name. @param a: Arguments. @param ka: Keyword arguments. @return None. ''' call((lambda ret: self._send('return', (reply, ret))) if reply is not None else None, getattr(self._target, member), *a, **ka) # }}} def __getattr__(self, attr): # {{{ '''Select member to call on remote communication object. @param attr: Member name. @return Function which calls the remote object when invoked. ''' if attr.startswith('_'): raise AttributeError('invalid RPC function name %s' % attr) return RPC._wrapper(self, attr) # }}} # }}} def _activate_all(): # {{{ '''Internal function to activate all inactive RPC websockets. @return False, so this can be registered as an idle task. ''' if _activation[0] is not None: for s in _activation[0]: s() _activation[0].clear() _activation[1] = None return False # }}} class _Httpd_connection: # {{{ '''Connection object for an HTTP server. This object implements the internals of an HTTP server. It supports GET and POST, and of course websockets. Don't construct these objects directly. ''' def __init__(self, server, socket, websocket = Websocket, proxy = (), error = None): # {{{ '''Constructor for internal use. This should not be called directly. @param server: Server object for which this connection is handled. @param socket: Newly accepted socket. @param httpdirs: Locations of static web pages to serve. @param websocket: Websocket class from which to create objects when a websocket is requested. @param proxy: Tuple of virtual proxy prefixes that should be ignored if requested. ''' self.server = server self.socket = socket self.websocket = websocket self.proxy = (proxy,) if isinstance(proxy, str) else proxy self.error = error self.headers = {} self.address = None self.socket.disconnect_cb(lambda socket, data: b'') # Ignore disconnect until it is a WebSocket. self.socket.readlines(self._line) #log('Debug: new connection from %s\n' % repr(self.socket.remote)) # }}} def _line(self, l): # {{{ if DEBUG > 4: log('Debug: Received line: %s' % l) if self.address is not None: if not l.strip(): self._handle_headers() return try: key, value = l.split(':', 1) except ValueError: log('Invalid header line: %s' % l) return self.headers[key.lower()] = value.strip() return else: try: self.method, url, self.standard = l.split() for prefix in self.proxy: if url.startswith('/' + prefix + '/') or url == '/' + prefix: self.prefix = '/' + prefix break else: self.prefix = '' address = urlparse(url) path = address.path[len(self.prefix):] or '/' self.url = path + url[len(address.path):] self.address = urlparse(self.url) self.query = parse_qs(self.address.query) except: traceback.print_exc() self.server.reply(self, 400, close = True) return # }}} def _handle_headers(self): # {{{ if DEBUG > 4: log('Debug: handling headers') is_websocket = 'connection' in self.headers and 'upgrade' in self.headers and 'upgrade' in self.headers['connection'].lower() and 'websocket' in self.headers['upgrade'].lower() self.data = {} self.data['url'] = self.url self.data['address'] = self.address self.data['query'] = self.query self.data['headers'] = self.headers msg = self.server.auth_message(self, is_websocket) if callable(self.server.auth_message) else self.server.auth_message if msg: if 'authorization' not in self.headers: self.server.reply(self, 401, headers = {'WWW-Authenticate': 'Basic realm="%s"' % msg.replace('\n', ' ').replace('\r', ' ').replace('"', "'")}, close = True) return else: auth = self.headers['authorization'].split(None, 1) if auth[0].lower() != 'basic': self.server.reply(self, 400, close = True) return pwdata = base64.b64decode(auth[1].encode('utf-8')).decode('utf-8', 'replace').split(':', 1) if len(pwdata) != 2: self.server.reply(self, 400, close = True) return self.data['user'] = pwdata[0] self.data['password'] = pwdata[1] if not self.server.authenticate(self): self.server.reply(self, 401, headers = {'WWW-Authenticate': 'Basic realm="%s"' % msg.replace('\n', ' ').replace('\r', ' ').replace('"', "'")}, close = True) return if not is_websocket: if DEBUG > 4: log('Debug: not a websocket') self.body = self.socket.unread() if self.method.upper() == 'POST': if 'content-type' not in self.headers or self.headers['content-type'].lower().split(';')[0].strip() != 'multipart/form-data': log('Invalid Content-Type for POST; must be multipart/form-data (not %s)\n' % (self.headers['content-type'] if 'content-type' in self.headers else 'undefined')) self.server.reply(self, 500, close = True) return args = self._parse_args(self.headers['content-type'])[1] if 'boundary' not in args: log('Invalid Content-Type for POST: missing boundary in %s\n' % (self.headers['content-type'] if 'content-type' in self.headers else 'undefined')) self.server.reply(self, 500, close = True) return self.boundary = b'\r\n' + b'--' + args['boundary'].encode('utf-8') + b'\r\n' self.endboundary = b'\r\n' + b'--' + args['boundary'].encode('utf-8') + b'--\r\n' self.post_state = None self.post = [{}, {}] self.socket.read(self._post) self._post(b'') else: try: if not self.server.page(self): self.socket.close() except: if DEBUG > 0: traceback.print_exc() log('exception: %s\n' % repr(sys.exc_info()[1])) try: self.server.reply(self, 500, close = True) except: self.socket.close() return # Websocket. if self.method.upper() != 'GET' or 'sec-websocket-key' not in self.headers: if DEBUG > 2: log('Debug: invalid websocket') self.server.reply(self, 400, close = True) return newkey = base64.b64encode(hashlib.sha1(self.headers['sec-websocket-key'].strip().encode('utf-8') + b'258EAFA5-E914-47DA-95CA-C5AB0DC85B11').digest()).decode('utf-8') headers = {'Sec-WebSocket-Accept': newkey, 'Connection': 'Upgrade', 'Upgrade': 'websocket', 'Sec-WebSocket-Version': '13'} self.server.reply(self, 101, None, None, headers, close = False) self.websocket(None, recv = self.server.recv, socket = self.socket, error = self.error, mask = (None, False), websockets = self.server.websockets, data = self.data, real_remote = self.headers.get('x-forwarded-for')) # }}} def _parse_headers(self, message): # {{{ lines = [] pos = 0 while True: p = message.index(b'\r\n', pos) ln = message[pos:p].decode('utf-8', 'replace') pos = p + 2 if ln == '': break if ln[0] in ' \t': if len(lines) == 0: log('header starts with continuation') else: lines[-1] += ln else: lines.append(ln) ret = {} for ln in lines: if ':' not in ln: log('ignoring header line without ":": %s' % ln) continue key, value = [x.strip() for x in ln.split(':', 1)] if key.lower() in ret: log('duplicate key in header: %s' % key) ret[key.lower()] = value return ret, message[pos:] # }}} def _parse_args(self, header): # {{{ if ';' not in header: return (header.strip(), {}) pos = header.index(';') + 1 main = header[:pos].strip() ret = {} while pos < len(header): if '=' not in header[pos:]: if header[pos:].strip() != '': log('header argument %s does not have a value' % header[pos:].strip()) return main, ret p = header.index('=', pos) key = header[pos:p].strip().lower() pos = p + 1 value = '' quoted = False while True: first = (len(header), None) if not quoted and ';' in header[pos:]: s = header.index(';', pos) if s < first[0]: first = (s, ';') if '"' in header[pos:]: q = header.index('"', pos) if q < first[0]: first = (q, '"') if '\\' in header[pos:]: b = header.index('\\', pos) if b < first[0]: first = (b, '\\') value += header[pos:first[0]] pos = first[0] + 1 if first[1] == ';' or first[1] is None: break if first[1] == '\\': value += header[pos] pos += 1 continue quoted = not quoted ret[key] = value return main, ret # }}} def _post(self, data): # {{{ #log('post body %s data %s' % (repr(self.body), repr(data))) self.body += data if self.post_state is None: # Waiting for first boundary. if self.boundary not in b'\r\n' + self.body: if self.endboundary in b'\r\n' + self.body: self._finish_post() return self.body = b'\r\n' + self.body self.body = self.body[self.body.index(self.boundary) + len(self.boundary):] self.post_state = 0 # Fall through. a = 20 while True: if self.post_state == 0: # Reading part headers. if b'\r\n\r\n' not in self.body: return headers, self.body = self._parse_headers(self.body) self.post_state = 1 if 'content-type' not in headers: post_type = ('text/plain', {'charset': 'us-ascii'}) else: post_type = self._parse_args(headers['content-type']) if 'content-transfer-encoding' not in headers: self.post_encoding = '7bit' else: self.post_encoding = self._parse_args(headers['content-transfer-encoding'])[0].lower() # Handle decoding of the data. if self.post_encoding == 'base64': self._post_decoder = self._base64_decoder elif self.post_encoding == 'quoted-printable': self._post_decoder = self._quopri_decoder else: self._post_decoder = lambda x, final: (x, b'') if 'content-disposition' in headers: args = self._parse_args(headers['content-disposition'])[1] if 'name' in args: self.post_name = args['name'] else: self.post_name = None if 'filename' in args: fd, self.post_file = tempfile.mkstemp() self.post_handle = os.fdopen(fd, 'wb') if self.post_name not in self.post[1]: self.post[1][self.post_name] = [] self.post[1][self.post_name].append((self.post_file, args['filename'], headers, post_type)) else: self.post_handle = None else: self.post_name = None if self.post_handle is None: self.post[0][self.post_name] = [b'', headers, post_type] # Fall through. if self.post_state == 1: # Reading part body. if self.endboundary in self.body: p = self.body.index(self.endboundary) else: p = None if self.boundary in self.body and (p is None or self.body.index(self.boundary) < p): self.post_state = 0 rest = self.body[self.body.index(self.boundary) + len(self.boundary):] self.body = self.body[:self.body.index(self.boundary)] elif p is not None: self.body = self.body[:p] self.post_state = None else: if len(self.body) <= len(self.boundary): break rest = self.body[-len(self.boundary):] self.body = self.body[:-len(rest)] decoded, self.body = self._post_decoder(self.body, self.post_state != 1) if self.post_handle is not None: self.post_handle.write(decoded) if self.post_state != 1: self.post_handle.close() else: self.post[0][self.post_name][0] += decoded if self.post_state != 1: if self.post[0][self.post_name][2][0] == 'text/plain': self.post[0][self.post_name][0] = self.post[0][self.post_name][0].decode(self.post[0][self.post_name][2][1].get('charset', 'utf-8'), 'replace') if self.post_state is None: self._finish_post() return self.body += rest # }}} def _finish_post(self): # {{{ if not self.server.post(self): self.socket.close() for f in self.post[1]: for g in self.post[1][f]: os.remove(g[0]) del self.post # }}} def _base64_decoder(self, data, final): # {{{ ret = b'' pos = 0 table = b'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' current = [] while len(data) >= pos + 4 - len(current): c = data[pos] pos += 1 if c not in table: if c not in b'\r\n': log('ignoring invalid character %s in base64 string' % c) continue current.append(table.index(c)) if len(current) == 4: # decode ret += bytes((current[0] << 2 | current[1] >> 4,)) if current[2] != 65: ret += bytes((((current[1] << 4) & 0xf0) | current[2] >> 2,)) if current[3] != 65: ret += bytes((((current[2] << 6) & 0xc0) | current[3],)) return (ret, data[pos:]) # }}} def _quopri_decoder(self, data, final): # {{{ ret = b'' pos = 0 while b'=' in data[pos:-2]: p = data.index(b'=', pos) ret += data[:p] if data[p + 1:p + 3] == b'\r\n': ret += b'\n' pos = p + 3 continue if any(x not in b'0123456789ABCDEFabcdef' for x in data[p + 1:p + 3]): log('invalid escaped sequence in quoted printable: %s' % data[p:p + 3].encode('utf-8', 'replace')) pos = p + 1 continue ret += bytes((int(data[p + 1:p + 3], 16),)) pos = p + 3 if final: ret += data[pos:] pos = len(data) elif len(pos) >= 2: ret += data[pos:-2] pos = len(data) - 2 return (ret, data[pos:]) # }}} # }}} class Httpd: # {{{ '''HTTP server. This object implements an HTTP server. It supports GET and POST, and of course websockets. ''' def __init__(self, port, recv = None, httpdirs = None, server = None, proxy = (), http_connection = _Httpd_connection, websocket = Websocket, error = None, *a, **ka): # {{{ '''Create a webserver. Additional arguments are passed to the network.Server. @param port: Port to listen on. Same format as in python-network. @param recv: Communication object class for new websockets. @param httpdirs: Locations of static web pages to serve. @param server: Server to use, or None to start a new server. @param proxy: Tuple of virtual proxy prefixes that should be ignored if requested. ''' ## Communication object for new websockets. self.recv = recv self._http_connection = http_connection ## Sequence of directories that that are searched to serve. # This can be used to make a list of files that are available to the web server. self.httpdirs = httpdirs self._proxy = proxy self._websocket = websocket self._error = error if error is not None else lambda msg: print(msg) ## Extensions which are handled from httpdirs. # More items can be added by the user program. self.exts = {} # Automatically add all extensions for which a mime type exists. try: exts = {} with open('/etc/mime.types') as f: for ln in f: if ln.strip() == '' or ln.startswith('#'): continue items = ln.split() for ext in items[1:]: if ext not in exts: exts[ext] = items[0] else: # Multiple registration: don't choose one. exts[ext] = False except FileNotFoundError: # This is probably a Windows system; use some defaults. exts = { 'html': 'text/html', 'css': 'text/css', 'js': 'text/javascript', 'jpg': 'image/jpeg', 'jpeg': 'image/jpeg', 'png': 'image/png', 'bmp': 'image/bmp', 'gif': 'image/gif', 'pdf': 'application/pdf', 'svg': 'image/svg+xml', 'txt': 'text/plain'} for ext in exts: if exts[ext] is not False: if exts[ext].startswith('text/') or exts[ext] == 'application/javascript': self.handle_ext(ext, exts[ext] + ';charset=utf-8') else: self.handle_ext(ext, exts[ext]) ## Currently connected websocket connections. self.websockets = set() if server is None: ## network.Server object. self.server = network.Server(port, self, *a, **ka) else: self.server = server # }}} def __call__(self, socket): # {{{ '''Add socket to list of accepted connections. Primarily useful for adding standard input and standard output as a fake socket. @param socket: Socket to add. @return New connection object. ''' return self._http_connection(self, socket, proxy = self._proxy, websocket = self._websocket, error = self._error) # }}} def handle_ext(self, ext, mime): # {{{ '''Add file extension to handle successfully. Files with this extension in httpdirs are served to callers with a 200 Ok code and the given mime type. This is a convenience function for adding the item to exts. @param ext: The extension to serve. @param mime: The mime type to use. @return None. ''' self.exts[ext] = lambda socket, message: self.reply(socket, 200, message, mime) # }}} # Authentication. {{{ ## Authentication message. See authenticate() for details. auth_message = None def authenticate(self, connection): # {{{ '''Handle user authentication. To use authentication, set auth_message to a static message or define it as a method which returns a message. The method is called with two arguments, connection and is_websocket. If it is or returns a True value (when cast to bool), authenticate will be called, which should return a bool. If it returns False, the connection will be rejected without notifying the program. connection.data is a dict which contains the items 'user' and 'password', set to their given values. This dict may be changed by authenticate and is passed to the websocket. Apart from filling the initial contents, this module does not touch it. Note that connection.data is empty when auth_message is called. 'user' and 'password' will be overwritten before authenticate is called, but other items can be added at will. *********************** NOTE REGARDING SECURITY *********************** The module uses plain text authentication. Anyone capable of seeing the data can read the usernames and passwords. Therefore, if you want authentication, you will also want to use TLS to encrypt the connection. @param connection: The connection to authenticate. Especially connection.data['user'] and connection.data['password'] are of interest. @return True if the authentication succeeds, False if it does not. ''' return True # }}} # }}} # The following function can be called by the overloaded page function. def reply(self, connection, code, message = None, content_type = None, headers = None, close = False): # Send HTTP status code and headers, and optionally a message. {{{ '''Reply to a request for a document. There are three ways to call this function: * With a message and content_type. This will serve the data as a normal page. * With a code that is not 101, and no message or content_type. This will send an error. * With a code that is 101, and no message or content_type. This will open a websocket. @param connection: Requesting connection. @param code: HTTP response code to send. Use 200 for a valid page. @param message: Data to send (as bytes), or None for an error message just showing the response code and its meaning. @param content_type: Content-Type of the message, or None if message is None. @param headers: Headers to send in addition to Content-Type and Content-Length, or None for no extra headers. @param close: True if the connection should be closed after this reply. @return None. ''' assert code in httpcodes #log('Debug: sending reply %d %s for %s\n' % (code, httpcodes[code], connection.address.path)) connection.socket.send(('HTTP/1.1 %d %s\r\n' % (code, httpcodes[code])).encode('utf-8')) if headers is None: headers = {} if message is None and code != 101: assert content_type is None content_type = 'text/html; charset=utf-8' message = ('%d: %s

%d: %s

' % (code, httpcodes[code], code, httpcodes[code])).encode('utf-8') if close and 'Connection' not in headers: headers['Connection'] = 'close' if content_type is not None: headers['Content-Type'] = content_type headers['Content-Length'] = '%d' % len(message) else: assert code == 101 message = b'' connection.socket.send((''.join(['%s: %s\r\n' % (x, headers[x]) for x in headers]) + '\r\n').encode('utf-8') + message) if close: connection.socket.close() # }}} # If httpdirs is not given, or special handling is desired, this can be overloaded. def page(self, connection, path = None): # A non-WebSocket page was requested. Use connection.address, connection.method, connection.query, connection.headers and connection.body (which should be empty) to find out more. {{{ '''Serve a non-websocket page. Overload this function for custom behavior. Call this function from the overloaded function if you want the default functionality in some cases. @param connection: The connection that requests the page. Attributes of interest are connection.address, connection.method, connection.query, connection.headers and connection.body (which should be empty). @param path: The requested file. @return True to keep the connection open after this request, False to close it. ''' if self.httpdirs is None: self.reply(connection, 501) return if path is None: path = connection.address.path if path == '/': address = 'index' else: address = '/' + unquote(path) + '/' while '/../' in address: # Don't handle this; just ignore it. pos = address.index('/../') address = address[:pos] + address[pos + 3:] address = address[1:-1] if '.' in address.rsplit('/', 1)[-1]: base, ext = address.rsplit('.', 1) base = base.strip('/') if ext not in self.exts and None not in self.exts: log('not serving unknown extension %s' % ext) self.reply(connection, 404) return for d in self.httpdirs: filename = os.path.join(d, base + os.extsep + ext) if os.path.exists(filename): break else: log('file %s not found in %s' % (base + os.extsep + ext, ', '.join(self.httpdirs))) self.reply(connection, 404) return else: base = address.strip('/') for ext in self.exts: for d in self.httpdirs: filename = os.path.join(d, base if ext is None else base + os.extsep + ext) if os.path.exists(filename): break else: continue break else: log('no file %s (with supported extension) found in %s' % (base, ', '.join(self.httpdirs))) self.reply(connection, 404) return return self.exts[ext](connection, open(filename, 'rb').read()) # }}} def post(self, connection): # A non-WebSocket page was requested with POST. Same as page() above, plus connection.post, which is a dict of name:(headers, sent_filename, local_filename). When done, the local files are unlinked; remove the items from the dict to prevent this. The default is to return an error (so POST cannot be used to retrieve static pages!) {{{ '''Handle POST request. This function responds with an error by default. It must be overridden to handle POST requests. @param connection: Same as for page(), plus connection.post, which is a 2-tuple. The first element is a dict of name:['value', ...] for fields without a file. The second element is a dict of name:[(local_filename, remote_filename), ...] for fields with a file. When done, the local files are unlinked; remove the items from the dict to prevent this. @return True to keep connection open after this request, False to close it. ''' log('Warning: ignoring POST request.') self.reply(connection, 501) return False # }}} # }}} class RPChttpd(Httpd): # {{{ '''Http server which serves websockets that implement RPC. ''' class _Broadcast: # {{{ def __init__(self, server, group = None): self.server = server self.group = group def __getitem__(self, item): return RPChttpd._Broadcast(self.server, item) def __getattr__(self, key): if key.startswith('_'): raise AttributeError('invalid member name') def impl(*a, **ka): for c in self.server.websockets.copy(): if self.group is None or self.group in c.groups: getattr(c, key).event(*a, **ka) return impl # }}} def __init__(self, port, target, *a, **ka): # {{{ '''Start a new RPC HTTP server. Extra arguments are passed to the Httpd constructor, which passes its extra arguments to network.Server. @param port: Port to listen on. Same format as in python-network. @param target: Communication object class. A new object is created for every connection. Its constructor is called with the newly created RPC as an argument. @param log: If set, debugging is enabled and logging is sent to this file. If it is a directory, a log file with the current date and time as filename will be used. ''' ## Function to send an event to some or all connected # clients. # To send to some clients, add an identifier to all # clients in a group, and use that identifier in the # item operator, like so: # @code{.py} # connection0.groups.clear() # connection1.groups.add('foo') # connection2.groups.add('foo') # server.broadcast.bar(42) # This is sent to all clients. # server.broadcast['foo'].bar(42) # This is only sent to clients in group 'foo'. # @endcode self.broadcast = RPChttpd._Broadcast(self) if 'log' in ka: name = ka.pop('log') if name: global DEBUG if DEBUG < 2: DEBUG = 2 if os.path.isdir(name): n = os.path.join(name, time.strftime('%F %T%z')) old = n i = 0 while os.path.exists(n): i += 1 n = '%s.%d' % (old, i) else: n = name try: f = open(n, 'a') if n != name: sys.stderr.write('Logging to %s\n' % n) except IOError: fd, n = tempfile.mkstemp(prefix = os.path.basename(n) + '-' + time.strftime('%F %T%z') + '-', text = True) sys.stderr.write('Opening file %s failed, using tempfile instead: %s\n' % (name, n)) f = os.fdopen(fd, 'a') stderr_fd = sys.stderr.fileno() os.close(stderr_fd) os.dup2(f.fileno(), stderr_fd) log('Start logging to %s, commandline = %s' % (n, repr(sys.argv))) Httpd.__init__(self, port, target, websocket = RPC, *a, **ka) # }}} # }}} def fgloop(*a, **ka): # {{{ '''Activate all websockets and start the main loop. See the documentation for python-network for details. @return See python-network documentation. ''' _activate_all() return network.fgloop(*a, **ka) # }}} def bgloop(*a, **ka): # {{{ '''Activate all websockets and start the main loop in the background. See the documentation for python-network for details. @return See python-network documentation. ''' _activate_all() return network.bgloop(*a, **ka) # }}} def iteration(*a, **ka): # {{{ '''Activate all websockets and run one loop iteration. See the documentation for python-network for details. @return See python-network documentation. ''' _activate_all() return network.iteration(*a, **ka) # }}} if __name__ == '__main__': import importlib.resources files = [x for x in importlib.resource.contents(__package__) if x.endswith(os.extsep + 'js')] for file in files: with importlib.resources.path(websocketd, 'rpc.js') as p: print(p) python-websocketd-0.5.orig/.swp0000600000175000017500000003000014374360411016120 0ustar shevekshevekb0VIM 9.0þtshevekapollo U3210#"! Utpad­áûöðéâáclosedopenedclosepingsendpython-websocketd-0.5.orig/tests/0000755000175000017500000000000014230250351016457 5ustar shevekshevekpython-websocketd-0.5.orig/tests/README.md0000644000175000017500000000010114230250351017726 0ustar shevekshevek# Tests for fhs.py This folder may at some point contain tests. python-websocketd-0.5.orig/setup.cfg0000644000175000017500000000172314374367541017164 0ustar shevekshevek[metadata] name = websocket-httpd version = 0.5 author = Bas Wijnen author_email = wijnen@debian.org description = module for creating a http server which uses WebSockets long_description = file:README.md long_description_content_type = text/markdown license = AGPL3+ license_files = debian/copyright url = https://github.com/wijnen/python-websocketd project_urls = Bug Tracker = https://github.com/wijnen/python-websocketd/issues classifiers = Programming Language :: Python :: 3 License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) Intended Audience :: Developers Development Status :: 4 - Beta Operating System :: OS Independent Topic :: System :: Networking Topic :: Internet :: WWW/HTTP :: HTTP Servers [options] zip_safe = False package_dir = =src packages = find: python_requires = >=3 install_requires = fhs-paths network-wrapper include_package_data = True [options.packages.find] where = src [options.package_data] * = *.js python-websocketd-0.5.orig/MANIFEST.in0000644000175000017500000000003414245074054017062 0ustar shevekshevekinclude src/websocketd/*.js python-websocketd-0.5.orig/parse0000755000175000017500000000021314230250234016351 0ustar shevekshevek#!/bin/sh tmp="`mktemp`" sed -e 's/:\s*#\s*{{{\s*$/:/' < "$1" > "$tmp" doxypypy --autobrief "$tmp" || doxypy --autobrief "$tmp" rm "$tmp" python-websocketd-0.5.orig/README.md0000644000175000017500000000147713561317442016620 0ustar shevekshevekThis module uses the network module to create a server, and implements http(s) and WebSockets over those connections. The most useful part of it is the RPC over WebSocket protocol. With only 6 lines of code you have a working system: import websocketd class Rpc: def __init__(self, remote): self.remote = remote s = websocketd.RPChttpd(8000, Rpc) websocketd.fgloop() You only have to add what you want your server to do. Any connection to the server (in this case it listens on port 8000) causes an Rpc object to be instanced. Any calls made through that connection will cause method calls on that object. If the remote side supports the same protocol, calls can be made on it by calling methods on remote. Please see example/server for more details on how to use this module. python-websocketd-0.5.orig/pyproject.toml0000644000175000017500000000012514230250255020232 0ustar shevekshevek[build-system] requires = ['setuptools>=42'] build-backend = 'setuptools.build_meta' python-websocketd-0.5.orig/config.doxygen0000644000175000017500000035052214361014426020176 0ustar shevekshevek# Doxyfile 1.9.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). # # Note: # # Use doxygen to compare the used configuration file with the template # configuration file: # doxygen -x [configFile] # Use doxygen to compare the used configuration file with the template # configuration file without replacing the environment variables: # doxygen -x_noenv [configFile] #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the configuration # file that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = python-websocketd # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = "Python module for creating a http server which uses WebSockets." # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = doxygen-output # If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 # sub-directories (in 2 levels) under the output directory of each output format # and will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to # control the number of sub-directories. # The default value is: NO. CREATE_SUBDIRS = NO # Controls the number of sub-directories that will be created when # CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every # level increment doubles the number of directories, resulting in 4096 # directories at level 8 which is the default and also the maximum value. The # sub-directories are organized in 2 levels, the first level always has a fixed # numer of 16 directories. # Minimum value: 0, maximum value: 8, default value: 8. # This tag requires that the tag CREATE_SUBDIRS is set to YES. CREATE_SUBDIRS_LEVEL = 8 # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, # Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English # (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, # Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with # English messages), Korean, Korean-en (Korean with English messages), Latvian, # Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, # Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, # Swedish, Turkish, Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = YES # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = NO # If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line # such as # /*************** # as being the beginning of a Javadoc-style comment "banner". If set to NO, the # Javadoc-style will behave just like regular comments and it will not be # interpreted by doxygen. # The default value is: NO. JAVADOC_BANNER = NO # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # By default Python docstrings are displayed as preformatted text and doxygen's # special commands cannot be used. By setting PYTHON_DOCSTRING to NO the # doxygen's special commands can be used and the contents of the docstring # documentation blocks is shown as doxygen documentation. # The default value is: YES. PYTHON_DOCSTRING = YES # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = YES # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:^^" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". Note that you cannot put \n's in the value part of an alias # to insert newlines (in the resulting output). You can put ^^ in the value part # of an alias to insert a newline as if a physical newline was in the original # file. When you need a literal { or } or , in the value part of an alias you # have to escape them by means of a backslash (\), this can lead to conflicts # with the commands \{ and \} for these it is advised to use the version @{ and # @} or use a double escape (\\{ and \\}) ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = YES # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice # sources only. Doxygen will then generate output that is more tailored for that # language. For instance, namespaces will be presented as modules, types will be # separated into more groups, etc. # The default value is: NO. OPTIMIZE_OUTPUT_SLICE = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, JavaScript, # Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, # VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: # FortranFree, unknown formatted Fortran: Fortran. In the later case the parser # tries to guess whether the code is fixed or free formatted code, this is the # default for Fortran type files). For instance to make doxygen treat .inc files # as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. When specifying no_extension you should add # * to the FILE_PATTERNS. # # Note see also the list of default file extension mappings. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. # Minimum value: 0, maximum value: 99, default value: 5. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. TOC_INCLUDE_HEADINGS = 5 # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 # The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use # during processing. When set to 0 doxygen will based this on the number of # cores available in the system. You can set it explicitly to a value larger # than 0 to get more control over the balance between CPU load and processing # speed. At this moment only the input processing can be done using multiple # threads. Since this is still an experimental feature the default is set to 1, # which effectively disables parallel processing. Please report any issues you # encounter. Generating dot graphs in parallel is controlled by the # DOT_NUM_THREADS setting. # Minimum value: 0, maximum value: 32, default value: 1. NUM_PROC_THREADS = 1 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO # If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual # methods of a class will be included in the documentation. # The default value is: NO. EXTRACT_PRIV_VIRTUAL = NO # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = YES # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = YES # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = YES # If this flag is set to YES, the name of an unnamed parameter in a declaration # will be determined by the corresponding definition. By default unnamed # parameters remain unnamed in the output. # The default value is: YES. RESOLVE_UNNAMED_PARAMS = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # declarations. If set to NO, these declarations will be included in the # documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = YES # With the correct setting of option CASE_SENSE_NAMES doxygen will better be # able to match the capabilities of the underlying filesystem. In case the # filesystem is case sensitive (i.e. it supports files in the same directory # whose names only differ in casing), the option must be set to YES to properly # deal with such files in case they appear in the input. For filesystems that # are not case sensitive the option should be set to NO to properly deal with # output files written for symbols that only differ in casing, such as for two # classes, one named CLASS and the other named Class, and to also support # references to files without having to specify the exact matching casing. On # Windows (including Cygwin) and MacOS, users should typically set this option # to NO, whereas on Linux or other Unix flavors it should typically be set to # YES. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_HEADERFILE tag is set to YES then the documentation for a class # will show which file needs to be included to use the class. # The default value is: YES. SHOW_HEADERFILE = YES # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. See also section "Changing the # layout of pages" for information. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as documenting some parameters in # a documented function twice, or documenting parameters that don't exist or # using markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete # function parameter documentation. If set to NO, doxygen will accept that some # parameters have no documentation without warning. # The default value is: YES. WARN_IF_INCOMPLETE_DOC = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong parameter # documentation, but not about the absence of documentation. If EXTRACT_ALL is # set to YES then this flag will automatically be disabled. See also # WARN_IF_INCOMPLETE_DOC # The default value is: NO. WARN_NO_PARAMDOC = YES # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS # then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but # at the end of the doxygen process doxygen will return with a non-zero status. # Possible values are: NO, YES and FAIL_ON_WARNINGS. # The default value is: NO. WARN_AS_ERROR = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # See also: WARN_LINE_FORMAT # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # In the $text part of the WARN_FORMAT command it is possible that a reference # to a more specific place is given. To make it easier to jump to this place # (outside of doxygen) the user can define a custom "cut" / "paste" string. # Example: # WARN_LINE_FORMAT = "'vi $file +$line'" # See also: WARN_FORMAT # The default value is: at line $line of file $file. WARN_LINE_FORMAT = "at line $line of file $file" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). In case the file specified cannot be opened for writing the # warning and error messages are written to standard error. When as file - is # specified the warning and error messages are written to standard output # (stdout). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = websocketd.py # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: # https://www.gnu.org/software/libiconv/) for the list of possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # Note the list of default checked file patterns might differ from the list of # default file extension mappings. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, # *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C # comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, # *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # ANamespace::AClass, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = _* \ long \ makebytes \ makestr \ isstr \ byte \ bytelist \ bord # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = ./parse # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = YES # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the # clang parser (see: # http://clang.llvm.org/) for more accurate parsing at the cost of reduced # performance. This can be particularly helpful with template rich C++ code for # which doxygen's built-in parser lacks the necessary type information. # Note: The availability of this option depends on whether or not doxygen was # generated with the -Duse_libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO # If the CLANG_ASSISTED_PARSING tag is set to YES and the CLANG_ADD_INC_PATHS # tag is set to YES then doxygen will add the directory of each input to the # include path. # The default value is: YES. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. CLANG_ADD_INC_PATHS = YES # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that # the include paths will already be set by doxygen for the files and directories # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. CLANG_OPTIONS = # If clang assisted parsing is enabled you can provide the clang parser with the # path to the directory containing a file called compile_commands.json. This # file is the compilation database (see: # http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the # options used when the source files were built. This is equivalent to # specifying the -p option to a clang tool, such as clang-check. These options # will then be passed to the parser. Any options specified with CLANG_OPTIONS # will be added as well. # Note: The availability of this option depends on whether or not doxygen was # generated with the -Duse_libclang=ON option for CMake. CLANG_DATABASE_PATH = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = YES # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a color-wheel, see # https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use gray-scales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML # documentation will contain a main index with vertical navigation menus that # are dynamically created via JavaScript. If disabled, the navigation index will # consists of multiple levels of tabs that are statically embedded in every HTML # page. Disable this option to support browsers that do not have JavaScript, # like the Qt help browser. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_MENUS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: # https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To # create a documentation set, doxygen will generate a Makefile in the HTML # output directory. Running make will produce the docset in that directory and # running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy # genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag determines the URL of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDURL = # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # on Windows. In the beginning of 2021 Microsoft took the original page, with # a.o. the download links, offline the HTML help workshop was already many years # in maintenance mode). You can download the HTML help workshop from the web # archives at Installation executable (see: # http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo # ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location (absolute path # including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to # run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine tune the look of the index (see "Fine-tuning the output"). As an # example, the default style sheet generated by doxygen has an example that # shows how to put an image at the root of the tree instead of the PROJECT_NAME. # Since the tree basically has the same information as the tab index, you could # consider setting DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO # When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the # FULL_SIDEBAR option determines if the side bar is limited to only the treeview # area (value NO) or if it should extend to the full height of the window (value # YES). Setting this to YES gives a layout similar to # https://docs.readthedocs.io with more room for contents, but less room for the # project logo, title, and description. If either GENERATE_TREEVIEW or # DISABLE_INDEX is set to NO, this option has no effect. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. FULL_SIDEBAR = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email # addresses. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. OBFUSCATE_EMAILS = YES # If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg # tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see # https://inkscape.org) to generate formulas as SVG images instead of PNGs for # the HTML output. These images will generally look nicer at scaled resolutions. # Possible values are: png (the default) and svg (looks nicer but requires the # pdf2svg or inkscape tool). # The default value is: png. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FORMULA_FORMAT = png # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands # to create new LaTeX commands to be used in formulas as building blocks. See # the section "Including formulas" for details. FORMULA_MACROFILE = # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # With MATHJAX_VERSION it is possible to specify the MathJax version to be used. # Note that the different versions of MathJax have different requirements with # regards to the different settings, so it is possible that also other MathJax # settings have to be changed when switching between the different MathJax # versions. # Possible values are: MathJax_2 and MathJax_3. # The default value is: MathJax_2. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_VERSION = MathJax_2 # When MathJax is enabled you can set the default output format to be used for # the MathJax output. For more details about the output format see MathJax # version 2 (see: # http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 # (see: # http://docs.mathjax.org/en/latest/web/components/output.html). # Possible values are: HTML-CSS (which is slower, but has the best # compatibility. This is the name for Mathjax version 2, for MathJax version 3 # this will be translated into chtml), NativeMML (i.e. MathML. Only supported # for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This # is the name for Mathjax version 3, for MathJax version 2 this will be # translated into HTML-CSS) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from https://www.mathjax.org before deployment. The default value is: # - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 # - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # for MathJax version 2 (see # https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # For example for MathJax version 3 (see # http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): # MATHJAX_EXTENSIONS = ams # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: # http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /