first steps towards spell checking documentation

This commit is contained in:
arvidn 2017-06-17 11:35:53 -04:00 committed by Arvid Norberg
parent 0810793372
commit 53cbb607d0
26 changed files with 62882 additions and 75 deletions

View File

@ -7,6 +7,10 @@ import sys
verbose = '--verbose' in sys.argv
dump = '--dump' in sys.argv
internal = '--internal' in sys.argv
plain_output = '--plain-output' in sys.argv
if plain_output:
plain_file = open('plain_text_out.txt', 'w+')
in_code = None
paths = ['include/libtorrent/*.hpp', 'include/libtorrent/kademlia/*.hpp', 'include/libtorrent/extensions/*.hpp']
@ -334,6 +338,24 @@ def parse_class(lno, lines, filename):
if l.startswith('//'):
if verbose: print 'desc %s' % l
# plain output prints just descriptions and filters out c++ code.
# it's used to run spell checker over
if plain_output:
line = l.split('//')[1]
# if the first character is a space, strip it
if len(line) > 0 and line[0] == ' ': line = line[1:]
global in_code
if in_code != None and not line.startswith(in_code) and len(line) > 1:
in_code = None
if line.strip().startswith('.. code::'):
in_code = line.split('.. code::')[0] + '\t'
# strip out C++ code from the plain text output since it's meant for
# running spell checking over
if not line.strip().startswith('.. ') and in_code == None:
plain_file.write(line + '\n')
l = l[2:]
if len(l) and l[0] == ' ': l = l[1:]
context += l + '\n'

466
docs/hunspell/en_US.aff Normal file
View File

@ -0,0 +1,466 @@
SET ISO8859-1
KEY qwertyuiop|asdfghjkl|zxcvbnm
TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ'-
NOSUGGEST !
# ordinal numbers (1st, 2nd, 3th, 11th) and decads (0s, 10s, 1990s)
COMPOUNDMIN 1
# only in compounds: 1th, 2th, 3th
ONLYINCOMPOUND c
# compound rules:
# 1. [0-9]*1[0-9]th (10th, 11th, 12th, 56714th, etc.)
# 2. [0-9]*[02-9](1st|2nd|3rd|[4-9]th) (21st, 22nd, 123rd, 1234th, etc.)
COMPOUNDRULE 2
COMPOUNDRULE n*1t
COMPOUNDRULE n*mp
WORDCHARS 0123456789'
PFX A Y 1
PFX A 0 re .
PFX I Y 1
PFX I 0 in .
PFX U Y 1
PFX U 0 un .
PFX C Y 1
PFX C 0 de .
PFX E Y 1
PFX E 0 dis .
PFX F Y 1
PFX F 0 con .
PFX K Y 1
PFX K 0 pro .
SFX V N 2
SFX V e ive e
SFX V 0 ive [^e]
SFX N Y 3
SFX N e ion e
SFX N y ication y
SFX N 0 en [^ey]
SFX X Y 3
SFX X e ions e
SFX X y ications y
SFX X 0 ens [^ey]
SFX H N 2
SFX H y ieth y
SFX H 0 th [^y]
SFX Y Y 1
SFX Y 0 ly .
SFX G Y 2
SFX G e ing e
SFX G 0 ing [^e]
SFX J Y 2
SFX J e ings e
SFX J 0 ings [^e]
SFX D Y 4
SFX D 0 d e
SFX D y ied [^aeiou]y
SFX D 0 ed [^ey]
SFX D 0 ed [aeiou]y
SFX T N 4
SFX T 0 st e
SFX T y iest [^aeiou]y
SFX T 0 est [aeiou]y
SFX T 0 est [^ey]
SFX R Y 4
SFX R 0 r e
SFX R y ier [^aeiou]y
SFX R 0 er [aeiou]y
SFX R 0 er [^ey]
SFX Z Y 4
SFX Z 0 rs e
SFX Z y iers [^aeiou]y
SFX Z 0 ers [aeiou]y
SFX Z 0 ers [^ey]
SFX S Y 4
SFX S y ies [^aeiou]y
SFX S 0 s [aeiou]y
SFX S 0 es [sxzh]
SFX S 0 s [^sxzhy]
SFX P Y 3
SFX P y iness [^aeiou]y
SFX P 0 ness [aeiou]y
SFX P 0 ness [^y]
SFX M Y 1
SFX M 0 's .
SFX B Y 3
SFX B 0 able [^aeiou]
SFX B 0 able ee
SFX B e able [^aeiou]e
SFX L Y 1
SFX L 0 ment .
REP 97
REP nt n't
REP alot a_lot
REP avengence a_vengeance
REP ninties 1990s
REP teached taught
REP rised rose
REP a ei
REP ei a
REP a ey
REP ey a
REP ai ie
REP ie ai
REP are air
REP are ear
REP are eir
REP air are
REP air ere
REP ere air
REP ere ear
REP ere eir
REP ear are
REP ear air
REP ear ere
REP eir are
REP eir ere
REP ch te
REP te ch
REP ch ti
REP ti ch
REP ch tu
REP tu ch
REP ch s
REP s ch
REP ch k
REP k ch
REP f ph
REP ph f
REP gh f
REP f gh
REP i igh
REP igh i
REP i uy
REP uy i
REP i ee
REP ee i
REP j di
REP di j
REP j gg
REP gg j
REP j ge
REP ge j
REP s ti
REP ti s
REP s ci
REP ci s
REP k cc
REP cc k
REP k qu
REP qu k
REP kw qu
REP o eau
REP eau o
REP o ew
REP ew o
REP oo ew
REP ew oo
REP ew ui
REP ui ew
REP oo ui
REP ui oo
REP ew u
REP u ew
REP oo u
REP u oo
REP u oe
REP oe u
REP u ieu
REP ieu u
REP ue ew
REP ew ue
REP uff ough
REP oo ieu
REP ieu oo
REP ier ear
REP ear ier
REP ear air
REP air ear
REP w qu
REP qu w
REP z ss
REP ss z
REP shun tion
REP shun sion
REP shun cion
REP tion ssion
REP ys ies
REP u ough
# PHONEtic_english.h - #PHONEtic transformation rules for use with #PHONEtic.c
# Copyright (C) 2000 Björn Jacke
#
# This rule set is based on Lawrence Phillips original metaPHONE
# algorithm with modifications made by Michael Kuhn in his
# C implantation, more modifications by Björn Jacke when
# converting the algorithm to a rule set and minor
# touch ups by Kevin Atkinson
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation;
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Björn Jacke may be reached by email at bjoern.jacke@gmx.de
#
# Changelog:
#
# 2000-01-05 Björn Jacke <bjoern.jacke@gmx.de>
# - first version with translation rules derived from
# metaPHONE.cc distributed with aspell 0.28.3
# - "TH" is now representated as "@" because "0" is a
# meta character
# - removed TH(!vowel) --> T; always use TH --> # instead
# - dropped "^AE" -> "E" (redundant)
# - "ing" is transformed to "N", not "NK"
# - "SCH(EO)" transforms to "SK" now
# - added R --> SILENT if (after a vowel) and no (vowel or
# "y" follows) like in "Marcy" or "abort"
# - H is SILENT in RH at beginning of words
# - H is SILENT if vowel leads and "Y" follows
# - some ".OUGH.." --> ...F exceptions added
# - "^V" transforms to "W"
# 2000-01-07 Kevin Atkinson <kevinatk@home.com>
# Converted from header to data file.
#
# 2007-08-23 László Németh <nemeth AT OOo>
# Add PHONE header and #PHONE keywords
#
# version 1.1
# Documentation: http://aspell.net/man-html/PHONEtic-Code.html
PHONE 105
PHONE AH(AEIOUY)-^ *H
PHONE AR(AEIOUY)-^ *R
PHONE A(HR)^ *
PHONE A^ *
PHONE AH(AEIOUY)- H
PHONE AR(AEIOUY)- R
PHONE A(HR) _
PHONE BB- _
PHONE B B
PHONE CQ- _
PHONE CIA X
PHONE CH X
PHONE C(EIY)- S
PHONE CK K
PHONE COUGH^ KF
PHONE CC< C
PHONE C K
PHONE DG(EIY) K
PHONE DD- _
PHONE D T
PHONE É< E
PHONE EH(AEIOUY)-^ *H
PHONE ER(AEIOUY)-^ *R
PHONE E(HR)^ *
PHONE ENOUGH^$ *NF
PHONE E^ *
PHONE EH(AEIOUY)- H
PHONE ER(AEIOUY)- R
PHONE E(HR) _
PHONE FF- _
PHONE F F
PHONE GN^ N
PHONE GN$ N
PHONE GNS$ NS
PHONE GNED$ N
PHONE GH(AEIOUY)- K
PHONE GH _
PHONE GG9 K
PHONE G K
PHONE H H
PHONE IH(AEIOUY)-^ *H
PHONE IR(AEIOUY)-^ *R
PHONE I(HR)^ *
PHONE I^ *
PHONE ING6 N
PHONE IH(AEIOUY)- H
PHONE IR(AEIOUY)- R
PHONE I(HR) _
PHONE J K
PHONE KN^ N
PHONE KK- _
PHONE K K
PHONE LAUGH^ LF
PHONE LL- _
PHONE L L
PHONE MB$ M
PHONE MM M
PHONE M M
PHONE NN- _
PHONE N N
PHONE OH(AEIOUY)-^ *H
PHONE OR(AEIOUY)-^ *R
PHONE O(HR)^ *
PHONE O^ *
PHONE OH(AEIOUY)- H
PHONE OR(AEIOUY)- R
PHONE O(HR) _
PHONE PH F
PHONE PN^ N
PHONE PP- _
PHONE P P
PHONE Q K
PHONE RH^ R
PHONE ROUGH^ RF
PHONE RR- _
PHONE R R
PHONE SCH(EOU)- SK
PHONE SC(IEY)- S
PHONE SH X
PHONE SI(AO)- X
PHONE SS- _
PHONE S S
PHONE TI(AO)- X
PHONE TH @
PHONE TCH-- _
PHONE TOUGH^ TF
PHONE TT- _
PHONE T T
PHONE UH(AEIOUY)-^ *H
PHONE UR(AEIOUY)-^ *R
PHONE U(HR)^ *
PHONE U^ *
PHONE UH(AEIOUY)- H
PHONE UR(AEIOUY)- R
PHONE U(HR) _
PHONE V^ W
PHONE V F
PHONE WR^ R
PHONE WH^ W
PHONE W(AEIOU)- W
PHONE X^ S
PHONE X KS
PHONE Y(AEIOU)- Y
PHONE ZZ- _
PHONE Z S
#The rules in a different view:
#
# Exceptions:
#
# Beginning of word: "gn", "kn-", "pn-", "wr-" ----> drop first letter
# "Aebersold", "Gnagy", "Knuth", "Pniewski", "Wright"
#
# Beginning of word: "x" ----> change to "s"
# as in "Deng Xiaopeng"
#
# Beginning of word: "wh-" ----> change to "w"
# as in "Whalen"
# Beginning of word: leading vowels are transformed to "*"
#
# "[crt]ough" and "enough" are handled separately because of "F" sound
#
#
# A --> A at beginning
# _ otherwise
#
# B --> B unless at the end of word after "m", as in "dumb", "McComb"
#
# C --> X (sh) if "-cia-" or "-ch-"
# S if "-ci-", "-ce-", or "-cy-"
# SILENT if "-sci-", "-sce-", or "-scy-", or "-cq-"
# K otherwise, including in "-sch-"
#
# D --> K if in "-dge-", "-dgy-", or "-dgi-"
# T otherwise
#
# E --> A at beginnig
# _ SILENT otherwise
#
# F --> F
#
# G --> SILENT if in "-gh-" and not at end or before a vowel
# in "-gn" or "-gned" or "-gns"
# in "-dge-" etc., as in above rule
# K if before "i", or "e", or "y" if not double "gg"
#
# K otherwise (incl. "GG"!)
#
# H --> SILENT if after vowel and no vowel or "Y" follows
# or after "-ch-", "-sh-", "-ph-", "-th-", "-gh-"
# or after "rh-" at beginning
# H otherwise
#
# I --> A at beginning
# _ SILENT otherwise
#
# J --> K
#
# K --> SILENT if after "c"
# K otherwise
#
# L --> L
#
# M --> M
#
# N --> N
#
# O --> A at beginning
# _ SILENT otherwise
#
# P --> F if before "h"
# P otherwise
#
# Q --> K
#
# R --> SILENT if after vowel and no vowel or "Y" follows
# R otherwise
#
# S --> X (sh) if before "h" or in "-sio-" or "-sia-"
# SK if followed by "ch(eo)" (SCH(EO))
# S otherwise
#
# T --> X (sh) if "-tia-" or "-tio-"
# 0 (th) if before "h"
# silent if in "-tch-"
# T otherwise
#
# U --> A at beginning
# _ SILENT otherwise
#
# V --> V if first letter of word
# F otherwise
#
# W --> SILENT if not followed by a vowel
# W if followed by a vowel
#
# X --> KS
#
# Y --> SILENT if not followed by a vowel
# Y if followed by a vowel
#
# Z --> S

62155
docs/hunspell/en_US.dic Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,156 @@
'
's
libtorrent
API
APIs
ABI
SHA-1
ed25519
const
BEP
bdecode
bdecoded
bencode
bencoded
int64
uint64
enum
enums
struct
bool
realloc
merkle
hpp
bittyrant
bittorrent
bitmask
bitmasks
SSL
asio
uTP
TCP
UDP
IP
IPv4
IPv6
QoS
TOS
unchoke
unchoked
dict
kiB
MiB
DHT
adler32
LRU
UPnP
NAT-PMP
Arvid
Norberg
RTT
internet
TODO
UNC
plugin
plugins
symlink
symlinks
CRC32
UTF
bitfield
RSS
socks5
socks4
metadata
posix
downloaders
bitset
kB
hostname
indices
dht
noseed
BFpe
BFsd
i2p
async
uTorrent
pred
sha1
pread
preadv
pwrite
pwritev
ftruncate
iovec
uint8
addr
iov
reannounce
PEM
pem
dh_params
outform
pex
trackerless
sig
ip
HTTP
URL
URLs
username
auth
idx
num
passphrase
UUID
UUIDs
uuid
performant
preformatted
SHA
buf
bufs
sizeof
params
ptr
msvc
mutex
eventfd
uint32
HWND
IPs
CIDR
kademlia
userdata
dont
OR
ORed
Diffie
OpenSSL
openssl
libtorrent's
filesystem
url
fs
io
ssl
errc
dh
dhparam
dhparams
0x01
0x02
0x04
0x08
http
failcount
superseeding
foo
baz
JSON
HTTPS
v4
v6
upnp
x509

View File

@ -96,8 +96,11 @@ ifneq ($(STAGE),)
cp $@ $(WEB_PATH)/$@
endif
$(REFERENCE_TARGETS:=.rst):gen_reference_doc.py ../include/libtorrent/*.hpp ../include/libtorrent/kademlia/*.hpp manual.rst settings.rst stats_counters.rst
python gen_reference_doc.py
$(REFERENCE_TARGETS:=.rst) plain_text_out.txt:gen_reference_doc.py ../include/libtorrent/*.hpp ../include/libtorrent/kademlia/*.hpp manual.rst settings.rst stats_counters.rst
python gen_reference_doc.py --plain-output
spell:plain_text_out.txt
hunspell -d hunspell/en_US -p hunspell/libtorrent.dic -l plain_text_out.txt
%.epub:%.rst
rst2epub --exit-status=2 $? $@

View File

@ -317,7 +317,7 @@ It limits the number of started seeds to settings_pack::active_seeds.
On top of this basic bias, *seed priority* can be controller by specifying a
seed ratio (the upload to download ratio), a seed-time ratio (the download
time to seeding time ratio) and a seed-time (the abosulte time to be seeding a
time to seeding time ratio) and a seed-time (the absolute time to be seeding a
torrent). Until all those targets are hit, the torrent will be prioritized for
seeding.
@ -352,7 +352,7 @@ anything. If peers are allowed, torrents may:
2. announce to the DHT
3. announce to local peer discovery (local service discovery)
Each of those actions are associated with a cost and hence may need a seprarate
Each of those actions are associated with a cost and hence may need a separate
limit. These limits are controlled by settings_pack::active_tracker_limit,
settings_pack::active_dht_limit and settings_pack::active_lsd_limit
respectively.
@ -601,7 +601,7 @@ It will of course still check for existing pieces and fast resume data. The main
drawbacks of this mode are:
* It may take longer to start the torrent, since it will need to fill the files
with zeroes. This delay is linear to the size of the download.
with zeros. This delay is linear to the size of the download.
* The download may occupy unnecessary disk space between download sessions.
@ -835,7 +835,9 @@ rate limits.
When the rate limits are adjusted for a specific torrent, a class is created
implicitly for that torrent.
The default peer class IDs are defined as enums in the ``session`` class::
The default peer class IDs are defined as enums in the ``session`` class:
.. code:: c++
enum {
global_peer_class_id,

View File

@ -316,7 +316,7 @@ namespace libtorrent
// paths. This means they must use backslashes as directory separators
// and may not contain the special directories "." or "..".
//
// Setting this to an absolute path is slightly more performant than a
// Setting this to an absolute path performs slightly better than a
// relative path.
std::string save_path;

View File

@ -288,7 +288,7 @@ namespace libtorrent {
#endif
private:
// explicitly disallow assignment and copyconstruction
// explicitly disallow assignment and copy construction
alert& operator=(alert const&);
time_point m_timestamp;

View File

@ -585,7 +585,7 @@ namespace libtorrent
virtual std::string message() const TORRENT_OVERRIDE;
// tells how many peers the tracker returned in this response. This is
// not expected to be more thant the ``num_want`` settings. These are not necessarily
// not expected to be greater than the ``num_want`` settings. These are not necessarily
// all new peers, some of them may already be connected.
int num_peers;
};
@ -786,7 +786,7 @@ namespace libtorrent
bool peer_interested;
// if this is true, the peer is not allowed to download this piece because
// of superseeding rules.
// of super-seeding rules.
bool withheld;
};

View File

@ -140,10 +140,10 @@ namespace libtorrent
symlinks = 8,
// to create a torrent that can be updated via a *mutable torrent*
// (see BEP38_). This also needs to be enabled for torrents that update
// (see `BEP 38`_). This also needs to be enabled for torrents that update
// another torrent.
//
// .. _BEP38: http://www.bittorrent.org/beps/bep_0038.html
// .. _`BEP 38`: http://www.bittorrent.org/beps/bep_0038.html
mutable_torrent_support = 16
};
@ -155,7 +155,7 @@ namespace libtorrent
// the specified number of bytes will be preceded by a pad file to align it
// with the start of a piece. The pad_file_limit is ignored unless the
// ``optimize_alignment`` flag is passed. Typically it doesn't make sense
// to set this any lower than 4kiB.
// to set this any lower than 4 kiB.
//
// The overload that takes a ``torrent_info`` object will make a verbatim
// copy of its info dictionary (to preserve the info-hash). The copy of
@ -309,7 +309,7 @@ namespace libtorrent
// the info dictionary
entry m_info_dict;
// the urls to the trackers
// the URLs to the trackers
typedef std::pair<std::string, int> announce_entry;
std::vector<announce_entry> m_urls;

View File

@ -92,7 +92,7 @@ namespace libtorrent
// the modification time of this file specified in posix time.
std::time_t mtime;
// a sha-1 hash of the content of the file, or zeroes, if no
// a sha-1 hash of the content of the file, or zeros, if no
// file hash was present in the torrent file. It can be used to potentially
// find alternative sources for the file.
sha1_hash filehash;
@ -241,7 +241,7 @@ namespace libtorrent
// file attribute flags
enum flags_t
{
// the file is a pad file. It's required to contain zeroes
// the file is a pad file. It's required to contain zeros
// at it will not be saved to disk. Its purpose is to make
// the following file start on a piece boundary.
pad_file = 1,
@ -346,7 +346,7 @@ namespace libtorrent
// returns a peer_request representing the piece index, byte offset
// and size the specified file range overlaps. This is the inverse
// mapping ove map_block(). Note that the ``peer_request`` return type
// mapping over map_block(). Note that the ``peer_request`` return type
// is meant to hold bittorrent block requests, which may not be larger
// than 16 kiB. Mapping a range larger than that may return an overflown
// integer.
@ -404,7 +404,7 @@ namespace libtorrent
int num_pieces() const { TORRENT_ASSERT(m_piece_length > 0); return m_num_pieces; }
// set and get the size of each piece in this torrent. This size is typically an even power
// of 2. It doesn't have to be though. It should be divisible by 16kiB however.
// of 2. It doesn't have to be though. It should be divisible by 16 kiB however.
void set_piece_length(int l) { m_piece_length = l; }
int piece_length() const { TORRENT_ASSERT(m_piece_length > 0); return m_piece_length; }
@ -506,7 +506,7 @@ namespace libtorrent
{
// this file is a pad file. The creator of the
// torrent promises the file is entirely filled with
// zeroes and does not need to be downloaded. The
// zeros and does not need to be downloaded. The
// purpose is just to align the next file to either
// a block or piece boundary.
flag_pad_file = 1,
@ -634,7 +634,7 @@ namespace libtorrent
// all unique paths files have. The internal_file_entry::path_index
// points into this array. The paths don't include the root directory
// name for multi-file torrents. The m_name field need to be
// prepended to these paths, and the filename of a specific file
// pre-pended to these paths, and the filename of a specific file
// entry appended, to form full file paths
std::vector<std::string> m_paths;

View File

@ -344,7 +344,7 @@ public:
// test the specified port (``port``) for whether it is blocked
// or not. The returned value is the flags set for this port.
// see acces_flags.
// see access_flags.
int access(boost::uint16_t port) const;
private:

View File

@ -1081,7 +1081,7 @@ namespace libtorrent
// by sending choke, unchoke.
int m_num_invalid_requests;
// if [0] is -1, superseeding is not active. If it is >= 0
// if [0] is -1, super-seeding is not active. If it is >= 0
// this is the piece that is available to this peer. Only
// these two pieces can be downloaded from us by this peer.
// This will remain the current piece for this peer until

View File

@ -259,7 +259,7 @@ namespace libtorrent
// download queue
int timed_out_requests;
// the number of busy requests in the download queue. A budy request is a
// the number of busy requests in the download queue. A busy request is a
// request for a block we've also requested from a different peer
int busy_requests;

View File

@ -159,7 +159,7 @@ namespace libtorrent
{
public:
// Constructs the session obects which acts as the container of torrents.
// Constructs the session objects which acts as the container of torrents.
// It provides configuration options across torrents (such as rate limits,
// disk cache, ip filter etc.). In order to avoid a race condition between
// starting the session and configuring it, you can pass in a

View File

@ -263,7 +263,7 @@ namespace libtorrent
// and discouraged*
//
// This function enables dynamic-loading-of-torrent-files_. When a
// torrent is unloaded but needs to be availabe in memory, this function
// torrent is unloaded but needs to be available in memory, this function
// is called **from within the libtorrent network thread**. From within
// this thread, you can **not** use any of the public APIs of libtorrent
// itself. The the info-hash of the torrent is passed in to the function
@ -424,7 +424,7 @@ namespace libtorrent
// to be set to the value to be stored by the function.
//
// boost::array<char,64>& signature
// the signature authenticating the current value. This may be zeroes
// the signature authenticating the current value. This may be zeros
// if there is currently no value stored. The function is expected to
// fill in this buffer with the signature of the new value to store.
// To generate the signature, you may want to use the
@ -483,11 +483,11 @@ namespace libtorrent
// in libtorrent are:
//
// metadata extension
// Allows peers to download the metadata (.torren files) from the swarm
// Allows peers to download the metadata (.torrent files) from the swarm
// directly. Makes it possible to join a swarm with just a tracker and
// info-hash.
//
// ::
// .. code:: c++
//
// #include <libtorrent/extensions/metadata_transfer.hpp>
// ses.add_extension(&libtorrent::create_metadata_plugin);
@ -495,7 +495,7 @@ namespace libtorrent
// uTorrent metadata
// Same as ``metadata extension`` but compatible with uTorrent.
//
// ::
// .. code:: c++
//
// #include <libtorrent/extensions/ut_metadata.hpp>
// ses.add_extension(&libtorrent::create_ut_metadata_plugin);
@ -503,7 +503,7 @@ namespace libtorrent
// uTorrent peer exchange
// Exchanges peers between clients.
//
// ::
// .. code:: c++
//
// #include <libtorrent/extensions/ut_pex.hpp>
// ses.add_extension(&libtorrent::create_ut_pex_plugin);
@ -513,7 +513,7 @@ namespace libtorrent
// that sends bad data with very high accuracy. Should
// eliminate most problems on poisoned torrents.
//
// ::
// .. code:: c++
//
// #include <libtorrent/extensions/smart_ban.hpp>
// ses.add_extension(&libtorrent::create_smart_ban_plugin);
@ -629,7 +629,9 @@ namespace libtorrent
// For more info, see ip_filter.
//
// For example, to make all peers in the range 200.1.1.0 - 200.1.255.255
// belong to their own peer class, apply the following filter::
// belong to their own peer class, apply the following filter:
//
// .. code:: c++
//
// ip_filter f;
// int my_class = ses.create_peer_class("200.1.x.x IP range");

View File

@ -849,7 +849,7 @@ namespace libtorrent
// suggest messages to create a bias of its peers to request certain
// pieces. The modes are:
//
// * ``no_piece_suggestsions`` which is the default and will not send
// * ``no_piece_suggestions`` which is the default and will not send
// out suggest messages.
// * ``suggest_read_cache`` which will send out suggest messages for
// the most recent pieces that are in the read cache.

View File

@ -126,7 +126,7 @@ POSSIBILITY OF SUCH DAMAGE.
// // if there are padding files, those blocks will be considered
// // completed even though they haven't been written to the storage.
// // in this case, just extend the piece buffer to its full size
// // and fill it with zeroes.
// // and fill it with zeros.
// if (data.size() < piece_size) data.resize(piece_size, 0);
// ph.h.update(&data[ph.offset], left);
// }
@ -184,7 +184,7 @@ namespace libtorrent
// the torrent in the way one would assume a torrent is saved to disk.
// Implementing your own storage interface makes it possible to store all
// data in RAM, or in some optimized order on disk (the order the pieces are
// received for instance), or saving multifile torrents in a single file in
// received for instance), or saving multi file torrents in a single file in
// order to be able to take advantage of optimized disk-I/O.
//
// It is also possible to write a thin class that uses the default storage
@ -321,7 +321,7 @@ namespace libtorrent
//
virtual void release_files(storage_error& ec) = 0;
// Rename file with index ``file`` to the thame ``new_name``.
// Rename the file with index ``file`` to name ``new_name``.
//
// If an error occurs, ``storage_error`` should be set to reflect it.
//
@ -336,21 +336,22 @@ namespace libtorrent
// If an error occurs, ``storage_error`` should be set to reflect it.
//
// The ``disk_buffer_pool`` is used to allocate and free disk buffers. It
// has the following members::
// has the following members:
//
// struct disk_buffer_pool : boost::noncopyable
// {
// char* allocate_buffer(char const* category);
// void free_buffer(char* buf);
//
// char* allocate_buffers(int blocks, char const* category);
// void free_buffers(char* buf, int blocks);
//
// int block_size() const { return m_block_size; }
//
// void release_memory();
// };
// .. code:: c++
//
// struct disk_buffer_pool : boost::noncopyable
// {
// char* allocate_buffer(char const* category);
// void free_buffer(char* buf);
//
// char* allocate_buffers(int blocks, char const* category);
// void free_buffers(char* buf, int blocks);
//
// int block_size() const { return m_block_size; }
//
// void release_memory();
// };
virtual void delete_files(int options, storage_error& ec) = 0;
#ifndef TORRENT_NO_DEPRECATE
@ -513,7 +514,7 @@ namespace libtorrent
virtual void write_resume_data(entry&, storage_error&) const TORRENT_OVERRIDE {}
};
// this storage implementation always reads zeroes, and always discards
// this storage implementation always reads zeros, and always discards
// anything written to it
struct zero_storage TORRENT_FINAL : storage_interface
{

View File

@ -414,7 +414,7 @@ namespace libtorrent
// priority, but the priority is used as a weight.
//
// Peers whose Torrent has a higher priority will take precedence when
// distributing unchoke slots. This is a strict prioritization where
// distributing unchoke slots. This is a strict prioritisation where
// every interested peer on a high priority torrent will be unchoked
// before any other, lower priority, torrents have any peers unchoked.
void set_priority(int prio) const;
@ -500,7 +500,7 @@ namespace libtorrent
// pieces from it, unless it's paused, queued, checking or seeding.
// ``remove_url_seed()`` removes the given url if it exists already.
// ``url_seeds()`` return a set of the url seeds currently in this
// torrent. Note that urls that fails may be removed automatically from
// torrent. Note that URLs that fails may be removed automatically from
// the list.
//
// See http-seeding_ for more information.
@ -568,7 +568,7 @@ namespace libtorrent
// .. note::
// Torrents that are auto-managed may be automatically resumed again. It
// does not make sense to pause an auto-managed torrent without making it
// not automanaged first. Torrents are auto-managed by default when added
// not auto-managed first. Torrents are auto-managed by default when added
// to the session. For more information, see queuing_.
//
void pause(int flags = 0) const;
@ -886,7 +886,7 @@ namespace libtorrent
//
// Note that when a torrent first starts up, and it needs a certificate,
// it will suspend connecting to any peers until it has one. It's
// typically desirable to resume the torrent after setting the ssl
// typically desirable to resume the torrent after setting the SSL
// certificate.
//
// If you receive a torrent_need_cert_alert, you need to call this to
@ -1140,7 +1140,7 @@ namespace libtorrent
// Magnet links, and other torrents that start out without having
// metadata are pinned automatically. This is to give the client a chance
// to get the metadata and save it before it's unloaded. In this case, it
// may be useful to un-pin the torrent once its metadata has been saved
// may be useful to unpin the torrent once its metadata has been saved
// to disk.
//
// For more information about dynamically loading and unloading torrents,
@ -1164,7 +1164,7 @@ namespace libtorrent
// can be done by using this other than an unnecessary connection attempt
// is made. If the torrent is uninitialized or in queued or checking
// mode, this will throw libtorrent_exception. The second (optional)
// argument will be bitwised ORed into the source mask of this peer.
// argument will be bitwise ORed into the source mask of this peer.
// Typically this is one of the source flags in peer_info. i.e.
// ``tracker``, ``pex``, ``dht`` etc.
//
@ -1178,7 +1178,7 @@ namespace libtorrent
// 0x04 supports uTP. If this is not set, the peer will only be contacted
// over TCP.
//
// 0x08 supports holepunching protocol. If this
// 0x08 supports hole punching protocol. If this
// flag is received from a peer, it can be
// used as a rendezvous point in case direct
// connections to the peer fail
@ -1258,7 +1258,7 @@ namespace libtorrent
// directory, if there is one. The source files will still be removed in
// that case.
//
// Files that have been renamed to have absolute pahts are not moved by
// Files that have been renamed to have absolute paths are not moved by
// this function. Keep in mind that files that don't belong to the
// torrent but are stored in the torrent's directory may be moved as
// well. This goes for files that have been renamed to absolute paths

View File

@ -206,7 +206,7 @@ namespace libtorrent
// filename is reflected by the ``file_storage`` returned by ``files()``
// but not by the one returned by ``orig_files()``.
//
// If you want to rename the base name of the torrent (for a multifile
// If you want to rename the base name of the torrent (for a multi file
// torrent), you can copy the ``file_storage`` (see files() and
// orig_files() ), change the name, and then use `remap_files()`_.
//
@ -253,13 +253,13 @@ namespace libtorrent
void add_tracker(std::string const& url, int tier = 0);
std::vector<announce_entry> const& trackers() const { return m_urls; }
// These two functions are related to BEP38_ (mutable torrents). The
// These two functions are related to `BEP 38`_ (mutable torrents). The
// vectors returned from these correspond to the "similar" and
// "collections" keys in the .torrent file. Both info-hashes and
// collections from within the info-dict and from outside of it are
// included.
//
// .. _BEP38: http://www.bittorrent.org/beps/bep_0038.html
// .. _`BEP 38`: http://www.bittorrent.org/beps/bep_0038.html
std::vector<sha1_hash> similar_torrents() const;
std::vector<std::string> collections() const;
@ -518,7 +518,7 @@ namespace libtorrent
std::map<int, sha1_hash> build_merkle_list(int piece) const;
// returns whether or not this is a merkle torrent.
// see BEP30__.
// see `BEP 30`__.
//
// __ http://bittorrent.org/beps/bep_0030.html
bool is_merkle_torrent() const { return !m_merkle_tree.empty(); }
@ -550,7 +550,7 @@ namespace libtorrent
// filenames are preserved.
copy_ptr<const file_storage> m_orig_files;
// the urls to the trackers
// the URLs to the trackers
std::vector<announce_entry> m_urls;
std::vector<web_seed_entry> m_web_seeds;
nodes_t m_nodes;
@ -587,7 +587,7 @@ namespace libtorrent
boost::shared_array<char> m_info_section;
// this is a pointer into the m_info_section buffer
// pointing to the first byte of the first sha-1 hash
// pointing to the first byte of the first SHA-1 hash
char const* m_piece_hashes;
// if a comment is found in the torrent file
@ -619,7 +619,7 @@ namespace libtorrent
// this is used when creating a torrent. If there's
// only one file there are cases where it's impossible
// to know if it should be written as a multifile torrent
// to know if it should be written as a multi file torrent
// or not. e.g. test/test there's one file and one directory
// and they have the same name.
bool m_multifile:1;

View File

@ -342,7 +342,7 @@ namespace libtorrent
// piece(s). Divide this number by 1000 to get the fraction.
//
// For example, if ``distributed_full_copies`` is 2 and
// ``distrbuted_fraction`` is 500, it means that the rarest pieces have
// ``distributed_fraction`` is 500, it means that the rarest pieces have
// only 2 copies among the peers this torrent is connected to, and that
// 50% of all the pieces have more than two copies.
//

View File

@ -2124,7 +2124,7 @@ namespace libtorrent
// and don't send a bitfield
m_sent_bitfield = true;
// bootstrap superseeding by sending two have message
// bootstrap super-seeding by sending two have message
int piece = t->get_piece_to_super_seed(get_bitfield());
if (piece >= 0) superseed_piece(-1, piece);
piece = t->get_piece_to_super_seed(get_bitfield());

View File

@ -1856,9 +1856,9 @@ namespace libtorrent
if (t->super_seeding() && !m_settings.get_bool(settings_pack::strict_super_seeding))
{
// if we're superseeding and the peer just told
// us that it completed the piece we're superseeding
// to it, change the superseeding piece for this peer
// if we're super-seeding and the peer just told
// us that it completed the piece we're super-seeding
// to it, change the super-seeding piece for this peer
// if the peer optimizes out redundant have messages
// this will be handled when the peer sends not-interested
// instead.

View File

@ -2199,7 +2199,7 @@ namespace libtorrent
if (m_refcount == 0)
inc_stats_counter(counters::num_pinned_torrents, p ? 1 : -1);
// if the torrent was just un-pinned, we need to insert
// if the torrent was just unpinned, we need to insert
// it into the LRU
m_ses.bump_torrent(this, true);
}
@ -5076,7 +5076,7 @@ namespace libtorrent
{
if ((*j)->super_seeded_piece(i))
{
// avoid superseeding the same piece to more than one
// avoid super-seeding the same piece to more than one
// peer if we can avoid it. Do this by artificially
// increase the availability
availability = 999;

View File

@ -1180,7 +1180,7 @@ namespace libtorrent
file_storage files;
files.set_piece_length(piece_length);
// extract file name (or the directory name if it's a multifile libtorrent)
// extract file name (or the directory name if it's a multi file libtorrent)
bdecode_node name_ent = info.dict_find_string("name.utf-8");
if (!name_ent) name_ent = info.dict_find_string("name");
if (!name_ent)

View File

@ -175,7 +175,7 @@ namespace libtorrent { namespace
// 0x04 - supports uTP. This is only a positive flags
// passing 0 doesn't mean the peer doesn't
// support uTP
// 0x08 - supports holepunching protocol. If this
// 0x08 - supports hole punching protocol. If this
// flag is received from a peer, it can be
// used as a rendezvous point in case direct
// connections to the peer fail
@ -564,7 +564,7 @@ namespace libtorrent { namespace
// 0x04 - supports uTP. This is only a positive flags
// passing 0 doesn't mean the peer doesn't
// support uTP
// 0x08 - supports holepunching protocol. If this
// 0x08 - supports hole punching protocol. If this
// flag is received from a peer, it can be
// used as a rendezvous point in case direct
// connections to the peer fail