←︎ anope :: 945f758


1
commit 945f758fa7e179f53a059edb8f7a938722debadf
2
Author: acidvegas <acid.vegas@acid.vegas>
3
Date:   Sun Mar 8 22:07:04 2020 -0400
4
5
    Initial commit
6
---
7
 .BANNER                                            |    18 +
8
 .mailmap                                           |    39 +
9
 .travis.yml                                        |    16 +
10
 CMakeLists.txt                                     |   559 +
11
 Config                                             |   414 +
12
 Config.exe                                         |   Bin 0 -> 18944 bytes
13
 README.md                                          |    46 +
14
 cmake/Anope.cmake                                  |   547 +
15
 cmake/FindGettext.cmake                            |    26 +
16
 cmake/NSIS.template.in                             |   825 ++
17
 cmake/ReadFile.cmake                               |     5 +
18
 data/CMakeLists.txt                                |     4 +
19
 data/botserv.conf                                  |   127 +
20
 data/chanserv.conf                                 |   430 +
21
 data/global.conf                                   |    19 +
22
 data/hostserv.conf                                 |    46 +
23
 data/nickserv.conf                                 |   143 +
24
 data/operserv.conf                                 |   120 +
25
 data/services.conf                                 |   109 +
26
 docs/ASTYLE                                        |     1 +
27
 docs/BUGS                                          |     1 +
28
 docs/C++CASTING                                    |   111 +
29
 docs/CMakeLists.txt                                |    15 +
30
 docs/CODING                                        |   239 +
31
 docs/COPYING                                       |   347 +
32
 docs/Changes                                       |   356 +
33
 docs/Changes.conf                                  |   200 +
34
 docs/DEFCON                                        |    93 +
35
 docs/EVENTS                                        |    34 +
36
 docs/FAQ                                           |    10 +
37
 docs/INSTALL                                       |   135 +
38
 docs/INSTALL.fr                                    |   149 +
39
 docs/LANGUAGE                                      |    53 +
40
 docs/MODULES                                       |   128 +
41
 docs/NEWS                                          |     6 +
42
 docs/README                                        |   258 +
43
 docs/REDIS                                         |   160 +
44
 docs/TOOLS                                         |    25 +
45
 docs/WIN32.txt                                     |   161 +
46
 docs/XMLRPC/XMLRPC                                 |    29 +
47
 docs/XMLRPC/xmlrpc.php                             |   145 +
48
 extras                                             |   168 +
49
 include/CMakeLists.txt                             |    64 +
50
 include/access.h                                   |   174 +
51
 include/account.h                                  |   282 +
52
 include/anope.h                                    |   781 ++
53
 include/base.h                                     |   143 +
54
 include/bots.h                                     |   135 +
55
 include/channels.h                                 |   310 +
56
 include/commands.h                                 |   187 +
57
 include/config.h                                   |   184 +
58
 include/defs.h                                     |    53 +
59
 include/extensible.h                               |   263 +
60
 include/hashcomp.h                                 |   199 +
61
 include/language.h                                 |   127 +
62
 include/lists.h                                    |    94 +
63
 include/logger.h                                   |   144 +
64
 include/mail.h                                     |    56 +
65
 include/memo.h                                     |    55 +
66
 include/messages.h                                 |   173 +
67
 include/modes.h                                    |   422 +
68
 include/module.h                                   |    54 +
69
 include/modules.h                                  |  1232 ++
70
 include/modules/bs_badwords.h                      |    70 +
71
 include/modules/bs_kick.h                          |    44 +
72
 include/modules/cs_entrymsg.h                      |    34 +
73
 include/modules/cs_log.h                           |    42 +
74
 include/modules/cs_mode.h                          |    89 +
75
 include/modules/dns.h                              |   178 +
76
 include/modules/encryption.h                       |    35 +
77
 include/modules/httpd.h                            |   243 +
78
 include/modules/ldap.h                             |   171 +
79
 include/modules/ns_cert.h                          |    70 +
80
 include/modules/os_forbid.h                        |    55 +
81
 include/modules/os_ignore.h                        |    43 +
82
 include/modules/os_news.h                          |    52 +
83
 include/modules/os_session.h                       |    94 +
84
 include/modules/pseudoclients/chanserv.h           |    25 +
85
 include/modules/pseudoclients/global.h             |    27 +
86
 include/modules/pseudoclients/memoserv.h           |    41 +
87
 include/modules/pseudoclients/nickserv.h           |    24 +
88
 include/modules/redis.h                            |    74 +
89
 include/modules/sasl.h                             |   139 +
90
 include/modules/set_misc.h                         |    17 +
91
 include/modules/sql.h                              |   216 +
92
 include/modules/ssl.h                              |    15 +
93
 include/modules/suspend.h                          |    19 +
94
 include/modules/xmlrpc.h                           |    47 +
95
 include/opertype.h                                 |   127 +
96
 include/protocol.h                                 |   316 +
97
 include/pstdint.h                                  |   800 ++
98
 include/regchannel.h                               |   252 +
99
 include/regexpr.h                                  |    45 +
100
 include/serialize.h                                |   335 +
101
 include/servers.h                                  |   187 +
102
 include/service.h                                  |   173 +
103
 include/services.h                                 |    68 +
104
 include/socketengine.h                             |    50 +
105
 include/sockets.h                                  |   511 +
106
 include/sysconf.h.cmake                            |    47 +
107
 include/threadengine.h                             |   120 +
108
 include/timers.h                                   |   131 +
109
 include/uplink.h                                   |    53 +
110
 include/users.h                                    |   374 +
111
 include/version.cpp                                |   188 +
112
 include/xline.h                                    |   184 +
113
 language/CMakeLists.txt                            |    37 +
114
 language/anope.ca_ES.po                            | 11919 ++++++++++++++++++
115
 language/anope.de_DE.po                            | 11637 ++++++++++++++++++
116
 language/anope.el_GR.po                            | 11857 ++++++++++++++++++
117
 language/anope.en_US.po                            | 11069 +++++++++++++++++
118
 language/anope.es_ES.po                            | 11197 +++++++++++++++++
119
 language/anope.fr_FR.po                            | 11320 +++++++++++++++++
120
 language/anope.hu_HU.po                            | 11828 ++++++++++++++++++
121
 language/anope.it_IT.po                            | 11224 +++++++++++++++++
122
 language/anope.nl_NL.po                            | 11211 +++++++++++++++++
123
 language/anope.pl_PL.po                            | 11124 +++++++++++++++++
124
 language/anope.pt_PT.po                            | 11800 ++++++++++++++++++
125
 language/anope.ru_RU.po                            | 12086 +++++++++++++++++++
126
 language/anope.tr_TR.po                            | 11766 ++++++++++++++++++
127
 language/update.sh                                 |    16 +
128
 modules/CMakeLists.txt                             |   169 +
129
 modules/bs_autoassign.cpp                          |    36 +
130
 modules/commands/bs_assign.cpp                     |   256 +
131
 modules/commands/bs_badwords.cpp                   |   469 +
132
 modules/commands/bs_bot.cpp                        |   385 +
133
 modules/commands/bs_botlist.cpp                    |    82 +
134
 modules/commands/bs_control.cpp                    |   146 +
135
 modules/commands/bs_info.cpp                       |   134 +
136
 modules/commands/bs_kick.cpp                       |  1474 +++
137
 modules/commands/bs_set.cpp                        |   228 +
138
 modules/commands/cs_access.cpp                     |   917 ++
139
 modules/commands/cs_akick.cpp                      |   584 +
140
 modules/commands/cs_ban.cpp                        |   248 +
141
 modules/commands/cs_clone.cpp                      |   261 +
142
 modules/commands/cs_drop.cpp                       |    95 +
143
 modules/commands/cs_enforce.cpp                    |   292 +
144
 modules/commands/cs_entrymsg.cpp                   |   289 +
145
 modules/commands/cs_flags.cpp                      |   504 +
146
 modules/commands/cs_getkey.cpp                     |    73 +
147
 modules/commands/cs_info.cpp                       |    98 +
148
 modules/commands/cs_invite.cpp                     |   111 +
149
 modules/commands/cs_kick.cpp                       |   147 +
150
 modules/commands/cs_list.cpp                       |   266 +
151
 modules/commands/cs_log.cpp                        |   399 +
152
 modules/commands/cs_mode.cpp                       |  1069 ++
153
 modules/commands/cs_register.cpp                   |   124 +
154
 modules/commands/cs_seen.cpp                       |   460 +
155
 modules/commands/cs_set.cpp                        |  1311 ++
156
 modules/commands/cs_set_misc.cpp                   |   219 +
157
 modules/commands/cs_status.cpp                     |   125 +
158
 modules/commands/cs_suspend.cpp                    |   285 +
159
 modules/commands/cs_sync.cpp                       |    66 +
160
 modules/commands/cs_topic.cpp                      |   270 +
161
 modules/commands/cs_unban.cpp                      |   126 +
162
 modules/commands/cs_updown.cpp                     |   243 +
163
 modules/commands/cs_xop.cpp                        |   627 +
164
 modules/commands/gl_global.cpp                     |    60 +
165
 modules/commands/greet.cpp                         |   216 +
166
 modules/commands/help.cpp                          |   205 +
167
 modules/commands/hs_del.cpp                        |   113 +
168
 modules/commands/hs_group.cpp                      |   117 +
169
 modules/commands/hs_list.cpp                       |   160 +
170
 modules/commands/hs_off.cpp                        |    69 +
171
 modules/commands/hs_on.cpp                         |    75 +
172
 modules/commands/hs_request.cpp                    |   394 +
173
 modules/commands/hs_set.cpp                        |   229 +
174
 modules/commands/ms_cancel.cpp                     |   101 +
175
 modules/commands/ms_check.cpp                      |    87 +
176
 modules/commands/ms_del.cpp                        |   159 +
177
 modules/commands/ms_ignore.cpp                     |   132 +
178
 modules/commands/ms_info.cpp                       |   231 +
179
 modules/commands/ms_list.cpp                       |   164 +
180
 modules/commands/ms_read.cpp                       |   224 +
181
 modules/commands/ms_rsend.cpp                      |   104 +
182
 modules/commands/ms_send.cpp                       |    88 +
183
 modules/commands/ms_sendall.cpp                    |    70 +
184
 modules/commands/ms_set.cpp                        |   315 +
185
 modules/commands/ms_staff.cpp                      |    67 +
186
 modules/commands/ns_access.cpp                     |   206 +
187
 modules/commands/ns_ajoin.cpp                      |   405 +
188
 modules/commands/ns_alist.cpp                      |   149 +
189
 modules/commands/ns_cert.cpp                       |   407 +
190
 modules/commands/ns_drop.cpp                       |    86 +
191
 modules/commands/ns_getemail.cpp                   |    74 +
192
 modules/commands/ns_getpass.cpp                    |    74 +
193
 modules/commands/ns_group.cpp                      |   396 +
194
 modules/commands/ns_identify.cpp                   |   128 +
195
 modules/commands/ns_info.cpp                       |   282 +
196
 modules/commands/ns_list.cpp                       |   301 +
197
 modules/commands/ns_logout.cpp                     |    91 +
198
 modules/commands/ns_recover.cpp                    |   298 +
199
 modules/commands/ns_register.cpp                   |   436 +
200
 modules/commands/ns_resetpass.cpp                  |   143 +
201
 modules/commands/ns_set.cpp                        |  1350 +++
202
 modules/commands/ns_set_misc.cpp                   |   234 +
203
 modules/commands/ns_status.cpp                     |    87 +
204
 modules/commands/ns_suspend.cpp                    |   288 +
205
 modules/commands/ns_update.cpp                     |    62 +
206
 modules/commands/os_akill.cpp                      |   483 +
207
 modules/commands/os_chankill.cpp                   |   119 +
208
 modules/commands/os_config.cpp                     |   150 +
209
 modules/commands/os_defcon.cpp                     |   603 +
210
 modules/commands/os_dns.cpp                        |   948 ++
211
 modules/commands/os_forbid.cpp                     |   571 +
212
 modules/commands/os_ignore.cpp                     |   416 +
213
 modules/commands/os_info.cpp                       |   290 +
214
 modules/commands/os_jupe.cpp                       |    80 +
215
 modules/commands/os_kick.cpp                       |    84 +
216
 modules/commands/os_kill.cpp                       |    67 +
217
 modules/commands/os_list.cpp                       |   276 +
218
 modules/commands/os_login.cpp                      |   132 +
219
 modules/commands/os_logsearch.cpp                  |   185 +
220
 modules/commands/os_mode.cpp                       |   192 +
221
 modules/commands/os_modinfo.cpp                    |   214 +
222
 modules/commands/os_module.cpp                     |   188 +
223
 modules/commands/os_news.cpp                       |   464 +
224
 modules/commands/os_noop.cpp                       |   100 +
225
 modules/commands/os_oline.cpp                      |    78 +
226
 modules/commands/os_oper.cpp                       |   292 +
227
 modules/commands/os_reload.cpp                     |    67 +
228
 modules/commands/os_session.cpp                    |   737 ++
229
 modules/commands/os_set.cpp                        |   267 +
230
 modules/commands/os_shutdown.cpp                   |   108 +
231
 modules/commands/os_stats.cpp                      |   276 +
232
 modules/commands/os_svs.cpp                        |   178 +
233
 modules/commands/os_sxline.cpp                     |   732 ++
234
 modules/commands/os_update.cpp                     |    52 +
235
 modules/cs_statusupdate.cpp                        |    65 +
236
 modules/database/db_flatfile.cpp                   |   413 +
237
 modules/database/db_old.cpp                        |  1360 +++
238
 modules/database/db_redis.cpp                      |   668 +
239
 modules/database/db_sql.cpp                        |   268 +
240
 modules/database/db_sql_live.cpp                   |   264 +
241
 modules/encryption/enc_bcrypt.cpp                  |   964 ++
242
 modules/encryption/enc_md5.cpp                     |   395 +
243
 modules/encryption/enc_none.cpp                    |    69 +
244
 modules/encryption/enc_old.cpp                     |   110 +
245
 modules/encryption/enc_sha1.cpp                    |   252 +
246
 modules/encryption/enc_sha256.cpp                  |   335 +
247
 modules/extra/CMakeLists.txt                       |     3 +
248
 modules/extra/m_ldap.cpp                           |   621 +
249
 modules/extra/m_ldap_authentication.cpp            |   304 +
250
 modules/extra/m_ldap_oper.cpp                      |   138 +
251
 modules/extra/m_mysql.cpp                          |   555 +
252
 modules/extra/m_regex_pcre.cpp                     |    83 +
253
 modules/extra/m_regex_posix.cpp                    |    84 +
254
 modules/extra/m_regex_tre.cpp                      |    85 +
255
 modules/extra/m_sql_authentication.cpp             |   148 +
256
 modules/extra/m_sql_log.cpp                        |   108 +
257
 modules/extra/m_sql_oper.cpp                       |   180 +
258
 modules/extra/m_sqlite.cpp                         |   334 +
259
 modules/extra/m_ssl_gnutls.cpp                     |   656 +
260
 modules/extra/m_ssl_openssl.cpp                    |   422 +
261
 modules/extra/stats/cs_fantasy_stats.cpp           |   176 +
262
 modules/extra/stats/cs_fantasy_top.cpp             |   188 +
263
 modules/extra/stats/irc2sql/CMakeLists.txt         |     1 +
264
 modules/extra/stats/irc2sql/irc2sql.cpp            |   327 +
265
 modules/extra/stats/irc2sql/irc2sql.h              |    84 +
266
 modules/extra/stats/irc2sql/tables.cpp             |   338 +
267
 modules/extra/stats/irc2sql/utils.cpp              |    68 +
268
 modules/extra/stats/m_chanstats.cpp                |   655 +
269
 modules/fantasy.cpp                                |   218 +
270
 modules/m_dns.cpp                                  |  1125 ++
271
 modules/m_dnsbl.cpp                                |   198 +
272
 modules/m_helpchan.cpp                             |    32 +
273
 modules/m_httpd.cpp                                |   472 +
274
 modules/m_proxyscan.cpp                            |   378 +
275
 modules/m_redis.cpp                                |   625 +
276
 modules/m_rewrite.cpp                              |   187 +
277
 modules/m_sasl.cpp                                 |   357 +
278
 modules/m_xmlrpc.cpp                               |   228 +
279
 modules/m_xmlrpc_main.cpp                          |   306 +
280
 modules/ns_maxemail.cpp                            |   114 +
281
 modules/protocol/bahamut.cpp                       |   569 +
282
 modules/protocol/charybdis.cpp                     |   427 +
283
 modules/protocol/hybrid.cpp                        |   720 ++
284
 modules/protocol/inspircd12.cpp                    |  1400 +++
285
 modules/protocol/inspircd20.cpp                    |  1106 ++
286
 modules/protocol/inspircd3.cpp                     |  1928 +++
287
 modules/protocol/ngircd.cpp                        |   679 ++
288
 modules/protocol/plexus.cpp                        |   451 +
289
 modules/protocol/ratbox.cpp                        |   373 +
290
 modules/protocol/unreal.cpp                        |  1340 ++
291
 modules/protocol/unreal4.cpp                       |  1498 +++
292
 modules/pseudoclients/botserv.cpp                  |   214 +
293
 modules/pseudoclients/chanserv.cpp                 |   480 +
294
 modules/pseudoclients/global.cpp                   |    95 +
295
 modules/pseudoclients/hostserv.cpp                 |   121 +
296
 modules/pseudoclients/memoserv.cpp                 |   233 +
297
 modules/pseudoclients/nickserv.cpp                 |   567 +
298
 modules/pseudoclients/operserv.cpp                 |   298 +
299
 modules/third/README                               |     2 +
300
 modules/third/language/CMakeLists.txt              |    38 +
301
 modules/third/language/README                      |     1 +
302
 modules/third/language/update.sh                   |    14 +
303
 modules/webcpanel/CMakeLists.txt                   |     5 +
304
 modules/webcpanel/pages/chanserv/access.cpp        |   127 +
305
 modules/webcpanel/pages/chanserv/access.h          |    26 +
306
 modules/webcpanel/pages/chanserv/akick.cpp         |    93 +
307
 modules/webcpanel/pages/chanserv/akick.h           |    26 +
308
 modules/webcpanel/pages/chanserv/drop.cpp          |    58 +
309
 modules/webcpanel/pages/chanserv/drop.h            |    25 +
310
 modules/webcpanel/pages/chanserv/info.cpp          |    27 +
311
 modules/webcpanel/pages/chanserv/info.h            |    24 +
312
 modules/webcpanel/pages/chanserv/modes.cpp         |   111 +
313
 modules/webcpanel/pages/chanserv/modes.h           |    26 +
314
 modules/webcpanel/pages/chanserv/set.cpp           |   154 +
315
 modules/webcpanel/pages/chanserv/set.h             |    26 +
316
 modules/webcpanel/pages/chanserv/utils.cpp         |    44 +
317
 modules/webcpanel/pages/chanserv/utils.h           |    18 +
318
 modules/webcpanel/pages/confirm.cpp                |    31 +
319
 modules/webcpanel/pages/confirm.h                  |    21 +
320
 modules/webcpanel/pages/hostserv/request.cpp       |    36 +
321
 modules/webcpanel/pages/hostserv/request.h         |    24 +
322
 modules/webcpanel/pages/index.cpp                  |   137 +
323
 modules/webcpanel/pages/index.h                    |    26 +
324
 modules/webcpanel/pages/logout.cpp                 |    22 +
325
 modules/webcpanel/pages/logout.h                   |    19 +
326
 modules/webcpanel/pages/memoserv/memos.cpp         |   114 +
327
 modules/webcpanel/pages/memoserv/memos.h           |    24 +
328
 modules/webcpanel/pages/nickserv/access.cpp        |    39 +
329
 modules/webcpanel/pages/nickserv/access.h          |    24 +
330
 modules/webcpanel/pages/nickserv/alist.cpp         |    57 +
331
 modules/webcpanel/pages/nickserv/alist.h           |    24 +
332
 modules/webcpanel/pages/nickserv/cert.cpp          |    42 +
333
 modules/webcpanel/pages/nickserv/cert.h            |    24 +
334
 modules/webcpanel/pages/nickserv/info.cpp          |   117 +
335
 modules/webcpanel/pages/nickserv/info.h            |    24 +
336
 modules/webcpanel/pages/operserv/akill.cpp         |    63 +
337
 modules/webcpanel/pages/operserv/akill.h           |    24 +
338
 modules/webcpanel/pages/register.cpp               |    23 +
339
 modules/webcpanel/pages/register.h                 |    21 +
340
 modules/webcpanel/static_fileserver.cpp            |    41 +
341
 modules/webcpanel/static_fileserver.h              |    18 +
342
 modules/webcpanel/template_fileserver.cpp          |   267 +
343
 modules/webcpanel/template_fileserver.h            |    26 +
344
 .../templates/default/chanserv/access.html         |    77 +
345
 .../templates/default/chanserv/akick.html          |    61 +
346
 .../templates/default/chanserv/chanlist.html       |    17 +
347
 .../webcpanel/templates/default/chanserv/drop.html |    32 +
348
 .../webcpanel/templates/default/chanserv/main.html |     3 +
349
 .../templates/default/chanserv/modes.html          |    56 +
350
 .../webcpanel/templates/default/chanserv/set.html  |    93 +
351
 modules/webcpanel/templates/default/confirm.html   |    51 +
352
 modules/webcpanel/templates/default/cubes.png      |   Bin 0 -> 723 bytes
353
 modules/webcpanel/templates/default/favicon.ico    |   Bin 0 -> 3774 bytes
354
 modules/webcpanel/templates/default/footer.html    |    14 +
355
 modules/webcpanel/templates/default/header.html    |    64 +
356
 .../templates/default/hostserv/request.html        |    45 +
357
 modules/webcpanel/templates/default/login.html     |    55 +
358
 modules/webcpanel/templates/default/logo.png       |   Bin 0 -> 19247 bytes
359
 .../templates/default/memoserv/memos.html          |   112 +
360
 .../templates/default/nickserv/access.html         |    42 +
361
 .../templates/default/nickserv/alist.html          |    23 +
362
 .../webcpanel/templates/default/nickserv/cert.html |    42 +
363
 .../webcpanel/templates/default/nickserv/info.html |    72 +
364
 .../templates/default/operserv/akill.html          |    77 +
365
 modules/webcpanel/templates/default/register.html  |    65 +
366
 modules/webcpanel/templates/default/style.css      |   166 +
367
 modules/webcpanel/webcpanel.cpp                    |   317 +
368
 modules/webcpanel/webcpanel.h                      |   181 +
369
 src/CMakeLists.txt                                 |   116 +
370
 src/access.cpp                                     |   475 +
371
 src/account.cpp                                    |    91 +
372
 src/base.cpp                                       |    48 +
373
 src/base64.cpp                                     |   163 +
374
 src/bots.cpp                                       |   277 +
375
 src/channels.cpp                                   |   961 ++
376
 src/command.cpp                                    |   314 +
377
 src/config.cpp                                     |   941 ++
378
 src/extensible.cpp                                 |    71 +
379
 src/hashcomp.cpp                                   |   163 +
380
 src/init.cpp                                       |   562 +
381
 src/language.cpp                                   |   127 +
382
 src/logger.cpp                                     |   418 +
383
 src/mail.cpp                                       |   162 +
384
 src/main.cpp                                       |   218 +
385
 src/memos.cpp                                      |   140 +
386
 src/messages.cpp                                   |   501 +
387
 src/misc.cpp                                       |   765 ++
388
 src/modes.cpp                                      |   896 ++
389
 src/module.cpp                                     |   129 +
390
 src/modulemanager.cpp                              |   526 +
391
 src/nickalias.cpp                                  |   216 +
392
 src/nickcore.cpp                                   |   269 +
393
 src/opertype.cpp                                   |   147 +
394
 src/pipeengine.cpp                                 |    80 +
395
 src/process.cpp                                    |   182 +
396
 src/protocol.cpp                                   |   511 +
397
 src/regchannel.cpp                                 |   694 ++
398
 src/serialize.cpp                                  |   177 +
399
 src/servers.cpp                                    |   360 +
400
 src/socket_clients.cpp                             |    98 +
401
 src/socket_transport.cpp                           |   198 +
402
 src/socketengines/socketengine_epoll.cpp           |   121 +
403
 src/socketengines/socketengine_kqueue.cpp          |   123 +
404
 src/socketengines/socketengine_poll.cpp            |   148 +
405
 src/socketengines/socketengine_select.cpp          |   148 +
406
 src/sockets.cpp                                    |   611 +
407
 src/threadengine.cpp                               |   136 +
408
 src/timers.cpp                                     |   126 +
409
 src/tools/CMakeLists.txt                           |    52 +
410
 src/tools/anoperc.in                               |   137 +
411
 src/tools/anopesmtp.cpp                            |   535 +
412
 src/tools/geoipupdate.sh                           |    81 +
413
 src/uplink.cpp                                     |   213 +
414
 src/users.cpp                                      |   846 ++
415
 src/version.sh                                     |     6 +
416
 src/win32/Config.cs                                |   363 +
417
 src/win32/anope-icon.ico                           |   Bin 0 -> 3774 bytes
418
 src/win32/anope.bat                                |     3 +
419
 src/win32/anope_windows.h                          |    81 +
420
 src/win32/dir/dir.cpp                              |    48 +
421
 src/win32/dir/dir.h                                |    27 +
422
 src/win32/dl/dl.cpp                                |    33 +
423
 src/win32/dl/dl.h                                  |    14 +
424
 src/win32/pipe/pipe.cpp                            |    61 +
425
 src/win32/pipe/pipe.h                              |     9 +
426
 src/win32/pthread/pthread.cpp                      |   119 +
427
 src/win32/pthread/pthread.h                        |    35 +
428
 src/win32/resource.h                               |    28 +
429
 src/win32/sigaction/sigaction.cpp                  |    31 +
430
 src/win32/sigaction/sigaction.h                    |    28 +
431
 src/win32/socket.cpp                               |   153 +
432
 src/win32/socket.h                                 |    32 +
433
 src/win32/win32.rc.cmake                           |    92 +
434
 src/win32/win32_memory.cpp                         |    64 +
435
 src/win32/windows.cpp                              |   261 +
436
 src/xline.cpp                                      |   469 +
437
 430 files changed, 244667 insertions(+)
438
439
diff --git a/.BANNER b/.BANNER
440
new file mode 100644
441
index 0000000..f6a9f89
442
--- /dev/null
443
+++ b/.BANNER
444
@@ -0,0 +1,18 @@
445
+   ___
446
+  / _ \  http://www.anope.org
447
+ | /_\ | _ __  _ _  _ _   ___
448
+ |  _  || '_ \/ _ \/ _ \ / _ \
449
+ | | | || | |  |_|  |_| |  __/
450
+ |_| |_||_| |_\___/|  _/ \___|
451
+                   | |
452
+                   |_| IRC Services
453
+                             CURVER
454
+This program will help you to compile your Services, and ask you
455
+questions regarding the compile-time settings of it during the
456
+process. For more options type SOURCE_DIR/Config --help
457
+
458
+Anope is a set of Services for IRC networks that allows users to
459
+manage their nicks and channels in a secure and efficient way,
460
+and administrators to manage their network with powerful tools.
461
+
462
+For all your Anope needs please visit our portal at www.anope.org
463
diff --git a/.mailmap b/.mailmap
464
new file mode 100644
465
index 0000000..dac503a
466
--- /dev/null
467
+++ b/.mailmap
468
@@ -0,0 +1,39 @@
469
+Adam <adam@anope.org> <adam-@5417fbe8-f217-4b02-8779-1006273d7864>
470
+Adam <adam@anope.org> <adam@adam-laptop.(none)>
471
+Adam <adam@anope.org> <Adam@anope.org>
472
+Adam <adam@anope.org> <Adam@drink-coca-cola.info>
473
+Adam <adam@anope.org> <Adam@sigterm.info>
474
+Adam Kramer <ribosome@anope.org> <ribosome ribosome@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
475
+Alvaro Toledo <atoledo@keldon.org> <atoledo atoledo@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
476
+Björn Stiddien <keeper@anope.org> <keeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
477
+Charles Kingsley <chaz@anope.org>
478
+Charles Kingsley <chaz@anope.org> <sjaz@5417fbe8-f217-4b02-8779-1006273d7864>
479
+Daniel Engel <dane@zero.org> <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
480
+David Robson <rob@anope.org> <robbeh@5417fbe8-f217-4b02-8779-1006273d7864>
481
+David Robson <rob@anope.org> <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
482
+Dennis Friis <peavey@inspircd.org> <peavey peavey@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
483
+Fabio Scotoni <cculex@gmail.com>
484
+Florian Schulze <certus@anope.org> <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
485
+Gabriel Acevedo H. <drstein@anope.org> <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
486
+Jan Milants <viper@anope.org>
487
+Jan Milants <viper@anope.org> <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>
488
+Jan Milants <viper@anope.org> <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
489
+Jens Voss <dukepyrolator@anope.org> <anope@s15355730.onlinehome-server.info>
490
+Jens Voss <dukepyrolator@anope.org> <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864>
491
+Jens Voss <dukepyrolator@anope.org> <DukePyrolator@anope.org>
492
+Jens Voss <dukepyrolator@anope.org> Jens Voß <jens@pyrobook.(none)>
493
+Lee Holmes <lethality@anope.org>
494
+Mark Summers <mark@goopler.net> <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
495
+Naram Qashat <cyberbotx@anope.org> <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>
496
+Naram Qashat <cyberbotx@anope.org> <cyberbotx@cyberbotx.com>
497
+Naram Qashat <cyberbotx@anope.org> <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>
498
+Pieter Bootsma <geniusdex@anope.org> <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
499
+Robby <robby@anope.org>
500
+Robby <robby@chat.be>
501
+Robby <robby@chatbelgie.be>
502
+Robin Burchell <w00t@inspircd.org> <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>
503
+Robin Burchell <w00t@inspircd.org> <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
504
+Sebastian V. <hal9000@denorastats.org>
505
+Sebastian V. <hal9000@denorastats.org> <pimpmylinux@5417fbe8-f217-4b02-8779-1006273d7864>
506
+(svnadmin) <svn@localhost> <svn svn@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
507
+Trystan S. Lee <trystan@nomadirc.net> <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
508
diff --git a/.travis.yml b/.travis.yml
509
new file mode 100644
510
index 0000000..84753c2
511
--- /dev/null
512
+++ b/.travis.yml
513
@@ -0,0 +1,16 @@
514
+language: cpp
515
+
516
+compiler:
517
+  - gcc
518
+
519
+before_script:
520
+  - mkdir build
521
+  - cd build
522
+  - cmake -DINSTDIR:STRING=~/services -DDEFUMASK:STRING=077 -DCMAKE_BUILD_TYPE:STRING=DEBUG -DUSE_RUN_CC_PL:BOOLEAN=ON ..
523
+
524
+script:
525
+  - make
526
+
527
+notifications:
528
+  irc:
529
+    - "irc.anope.org#anope-devel"
530
diff --git a/CMakeLists.txt b/CMakeLists.txt
531
new file mode 100644
532
index 0000000..518c198
533
--- /dev/null
534
+++ b/CMakeLists.txt
535
@@ -0,0 +1,559 @@
536
+# This usage of CMake requires at least version 2.4 (checks are made to determine what to use when certain versions lack functions)
537
+cmake_minimum_required(VERSION 2.4 FATAL_ERROR)
538
+if(COMMAND cmake_policy)
539
+  cmake_policy(SET CMP0003 NEW)
540
+  if(POLICY CMP0026)
541
+    cmake_policy(SET CMP0026 OLD)
542
+  endif(POLICY CMP0026)
543
+  if(POLICY CMP0007)
544
+    cmake_policy(SET CMP0007 OLD)
545
+  endif(POLICY CMP0007)
546
+endif(COMMAND cmake_policy)
547
+
548
+# Set the project as C++ primarily, but have C enabled for the checks required later
549
+project(Anope CXX)
550
+enable_language(C)
551
+
552
+# Detect the version of CMake for the later conditional checks
553
+execute_process(COMMAND ${CMAKE_COMMAND} --version OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
554
+string(REGEX REPLACE "cmake version 2\\.(.*)" "\\1" ONLY_VERSION "${VERSION}")
555
+string(REGEX MATCH "-patch .*$" HAS_PATCH "${ONLY_VERSION}")
556
+if(HAS_PATCH)
557
+  string(REGEX REPLACE "(.*)-patch .*" "\\1" MINOR_VERSION "${ONLY_VERSION}")
558
+  string(REGEX REPLACE ".*-patch (.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}")
559
+else(HAS_PATCH)
560
+  string(REGEX MATCH "\\." HAS_DOT "${ONLY_VERSION}")
561
+  if(HAS_DOT)
562
+    string(REGEX REPLACE "(.*)\\..*" "\\1" MINOR_VERSION "${ONLY_VERSION}")
563
+    string(REGEX REPLACE ".*\\.(.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}")
564
+  else(HAS_DOT)
565
+    string(REGEX REPLACE "(.*)-beta" "\\1" MINOR_VERSION "${ONLY_VERSION}")
566
+    if(MINOR_VERSION STREQUAL "4-1\n")
567
+      set(PATCH_VERSION 1)
568
+    else(MINOR_VERSION STREQUAL "4-1\n")
569
+      set(PATCH_VERSION 0)
570
+    endif(MINOR_VERSION STREQUAL "4-1\n")
571
+    set(MINOR_VERSION 4)
572
+  endif(HAS_DOT)
573
+endif(HAS_PATCH)
574
+
575
+# Detect is we are using CMake 2.6 or better, these versions include functions that require less work than CMake 2.4 does
576
+if(MINOR_VERSION GREATER 5)
577
+  set(CMAKE26_OR_BETTER TRUE)
578
+  set(CMAKE248_OR_BETTER TRUE)
579
+  set(CMAKE244_OR_BETTER TRUE)
580
+  set(CMAKE242_OR_BETTER TRUE)
581
+else(MINOR_VERSION GREATER 5)
582
+  set(CMAKE26_OR_BETTER FALSE)
583
+  # Also detect if we are using CMake 2.4.8 or better, the FIND sub-command of list() is nonexistent in earlier versions
584
+  if(PATCH_VERSION GREATER 7)
585
+    set(CMAKE248_OR_BETTER TRUE)
586
+    set(CMAKE244_OR_BETTER TRUE)
587
+    set(CMAKE242_OR_BETTER TRUE)
588
+  else(PATCH_VERSION GREATER 7)
589
+    set(CMAKE248_OR_BETTER FALSE)
590
+    # Also detect if we are using CMake 2.4.4 or better, the CheckCXXCompilerFlag module and SORT sub-command of list() are nonexistent in earlier versions
591
+    if(PATCH_VERSION GREATER 3)
592
+      set(CMAKE244_OR_BETTER TRUE)
593
+      set(CMAKE242_OR_BETTER TRUE)
594
+    else(PATCH_VERSION GREATER 3)
595
+      set(CMAKE244_OR_BETTER FALSE)
596
+      # ALSO detect if we are using CMake 2.4.2 or better, the APPEND sub-command of list() is nonexistent in earlier versions
597
+      if(PATCH_VERSION GREATER 1)
598
+        set(CMAKE242_OR_BETTER TRUE)
599
+      else(PATCH_VERSION GREATER 1)
600
+        set(CMAKE242_OR_BETTER FALSE)
601
+      endif(PATCH_VERSION GREATER 1)
602
+    endif(PATCH_VERSION GREATER 3)
603
+  endif(PATCH_VERSION GREATER 7)
604
+endif(MINOR_VERSION GREATER 5)
605
+
606
+# Override the module include path to include our directory, for our Anope.cmake, as well as we are using our own version of the NSIS template
607
+set(CMAKE_MODULE_PATH ${Anope_SOURCE_DIR}/cmake)
608
+
609
+include(Anope)
610
+
611
+# Force the locale to C for later uses of things like gcc so the messages come up in English, not the user's default language
612
+set(ENV{LC_ALL} C)
613
+
614
+# Start with empty defaults for library and include directories, to be used by GNU compilers only
615
+set(DEFAULT_LIBRARY_DIRS)
616
+set(DEFAULT_INCLUDE_DIRS)
617
+
618
+# Check that we aren't running on an ancient broken GCC
619
+if(CMAKE_COMPILER_IS_GNUCXX)
620
+  execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_FULL_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
621
+  string(REGEX REPLACE "^(\\d+\\.\\d+)" "\\1" GCC_VERSION ${GCC_FULL_VERSION})
622
+  if(GCC_VERSION LESS 4.2)
623
+    message(FATAL_ERROR "Your compiler is too old to build Anope. Upgrade to GCC 4.2 or newer!")
624
+  endif(GCC_VERSION LESS 4.2)
625
+  if(GCC_VERSION GREATER 6.0 OR GCC_VERSION EQUAL 6.0)
626
+    set(CXXFLAGS "${CXXFLAGS} -fno-delete-null-pointer-checks")
627
+  endif(GCC_VERSION GREATER 6.0 OR GCC_VERSION EQUAL 6.0)
628
+endif(CMAKE_COMPILER_IS_GNUCXX)
629
+
630
+# If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes
631
+if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
632
+  # First look for the compiler's default library directories
633
+  execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
634
+  # Find only the part after "libraries: "
635
+  string(REGEX REPLACE ".*\nlibraries: (.*)$" "\\1" LINE "${LINES}")
636
+  # Replace the colons in the list with semicolons (only when not on MinGW, which uses semicolons already), and if on MinGW, just copy the line
637
+  if(NOT MINGW)
638
+    string(REGEX REPLACE ":" ";" LIBRARIES ${LINE})
639
+  else(NOT MINGW)
640
+    set(LIBRARIES "${LINE}")
641
+  endif(NOT MINGW)
642
+  # Iterate through the libraries
643
+  foreach(LIBRARY ${LIBRARIES})
644
+    # Check if the first character is an equal sign, and skip that library directory as it is (I believe) the primary default and shows up later in the list anyways
645
+    string(SUBSTRING ${LIBRARY} 0 1 FIRST_CHAR)
646
+    if(NOT FIRST_CHAR STREQUAL "=")
647
+      # If the directory had no = in front of it, make sure it's absolute and add it to the list of default library directories
648
+      get_filename_component(LIBRARY ${LIBRARY} ABSOLUTE)
649
+      append_to_list(DEFAULT_LIBRARY_DIRS ${LIBRARY})
650
+    endif(NOT FIRST_CHAR STREQUAL "=")
651
+  endforeach(LIBRARY)
652
+  # Remove duplicate entries from the list
653
+  if(DEFAULT_LIBRARY_DIRS)
654
+    remove_list_duplicates(DEFAULT_LIBRARY_DIRS)
655
+  endif(DEFAULT_LIBRARY_DIRS)
656
+  # Create a temporary file to test for the default include directories
657
+  FILE(WRITE empty.cpp "")
658
+  # Next, we look for the compiler's default include directories
659
+  # Run the command to find the default include directories
660
+  execute_process(COMMAND ${CMAKE_C_COMPILER} -v -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp ERROR_VARIABLE LINES OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE)
661
+  # Remove the empty file, it is no longer needed
662
+  FILE(REMOVE empty.cpp)
663
+  # Convert the new lines to semicolons
664
+  string(REGEX REPLACE "\n" ";" LINES ${LINES})
665
+  # Temporary variable saying if we are in the search list or not
666
+  set(IN_SEARCH_LIST FALSE)
667
+  # Iterate through the lines
668
+  foreach(LINE ${LINES})
669
+    # If the line has the following on it, the next lines will contain directory names
670
+    if(LINE STREQUAL "#include <...> search starts here:")
671
+      set(IN_SEARCH TRUE)
672
+    else(LINE STREQUAL "#include <...> search starts here:")
673
+      # If the line has the following on it, we hit the end of the list
674
+      if(LINE STREQUAL "End of search list.")
675
+        set(IN_SEARCH FALSE)
676
+      else(LINE STREQUAL "End of search list.")
677
+        # If we are within the block between the above two lines...
678
+        if(IN_SEARCH)
679
+          # Get everything but the first character of the line
680
+          string(LENGTH ${LINE} LINE_LENGTH)
681
+          math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
682
+          string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
683
+          # For systems like Mac OS X, look for include paths that say " (framework directory)" at the end of them and strip that off
684
+          string(REGEX REPLACE " \\(framework directory\\)$" "" INCLUDE ${INCLUDE})
685
+          # Convert the path to an absolute one, just in case it wasn't
686
+          get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
687
+          # Add that directory to the list of default include directories
688
+          append_to_list(DEFAULT_INCLUDE_DIRS ${INCLUDE})
689
+        endif(IN_SEARCH)
690
+      endif(LINE STREQUAL "End of search list.")
691
+    endif(LINE STREQUAL "#include <...> search starts here:")
692
+  endforeach(LINE)
693
+  # Remove duplicate entries from the list
694
+  if(DEFAULT_INCLUDE_DIRS)
695
+    remove_list_duplicates(DEFAULT_INCLUDE_DIRS)
696
+  endif(DEFAULT_INCLUDE_DIRS)
697
+endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
698
+
699
+# If we are using Visual Studio, locate the path of the Windows Server 2008 SDK or Windows Server 2003 Platform SDK, depending on which is installed
700
+if(MSVC)
701
+  # If the path comes up as "/registry" from any of these, the path wasn't found, otherwise, we'll set WSDK_PATH to the corresponding path
702
+  # Look for the 2008 SDK under HKLM first
703
+  get_filename_component(WSDK2008_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
704
+  if(WSDK2008_PATH STREQUAL "/registry")
705
+    # If not found, look for the 2003 SDK under HKLM
706
+    get_filename_component(WSDK2003_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE)
707
+    if(WSDK2003_PATH STREQUAL "/registry")
708
+      # If not found, look for the 2008 SDK under HKCU
709
+      get_filename_component(WSDK2008_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
710
+      if(WSDK2008_PATH STREQUAL "/registry")
711
+        # If not found, look for the 2003 SDK under HKCU
712
+        get_filename_component(WSDK2003_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE)
713
+        if(WSDK2003_PATH STREQUAL "/registry")
714
+          # The SDK was never found, set the path to nothing
715
+          set(WSDK_PATH "")
716
+        else(WSDK2003_PATH STREQUAL "/registry")
717
+          set(WSDK_PATH "${WSDK2003_PATH}")
718
+        endif(WSDK2003_PATH STREQUAL "/registry")
719
+      else(WSDK2008_PATH STREQUAL "/registry")
720
+        set(WSDK_PATH "${WSDK2008_PATH}")
721
+      endif(WSDK2008_PATH STREQUAL "/registry")
722
+    else(WSDK2003_PATH STREQUAL "/registry")
723
+      set(WSDK_PATH "${WSDK2003_PATH}")
724
+    endif(WSDK2003_PATH STREQUAL "/registry")
725
+  else(WSDK2008_PATH STREQUAL "/registry")
726
+    set(WSDK_PATH "${WSDK2008_PATH}")
727
+  endif(WSDK2008_PATH STREQUAL "/registry")
728
+endif(MSVC)
729
+
730
+# If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their definition
731
+# and dump it in the cache along with proper documentation, otherwise set CMAKE_BUILD_TYPE
732
+# to Debug
733
+# Only do this if not using Visual Studio
734
+if(NOT MSVC)
735
+  if(CMAKE_BUILD_TYPE)
736
+    set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
737
+  else(CMAKE_BUILD_TYPE)
738
+    set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
739
+  endif(CMAKE_BUILD_TYPE)
740
+endif(NOT MSVC)
741
+
742
+# If running under MinGW, we have to force the resource compiler settings (hopefully this will be fixed in a later version of CMake)
743
+if(MINGW)
744
+  set(CMAKE_RC_COMPILER_INIT windres)
745
+  enable_language(RC)
746
+  set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>")
747
+endif(MINGW)
748
+
749
+# Include the checking functions used later in this CMakeLists.txt
750
+include(CheckFunctionExists)
751
+include(CheckIncludeFile)
752
+include(CheckTypeSize)
753
+include(CheckLibraryExists)
754
+if(CMAKE244_OR_BETTER)
755
+  include(CheckCXXCompilerFlag)
756
+else(CMAKE244_OR_BETTER)
757
+  include(TestCXXAcceptsFlag)
758
+endif(CMAKE244_OR_BETTER)
759
+
760
+# If extra include directories were specified, tell cmake about them.
761
+if(EXTRA_INCLUDE)
762
+  include_directories(${EXTRA_INCLUDE})
763
+endif(EXTRA_INCLUDE)
764
+
765
+# If extra library directories were specified, tell cmake about them.
766
+if(EXTRA_LIBS)
767
+  link_directories(${EXTRA_LIBS})
768
+endif(EXTRA_LIBS)
769
+
770
+# Find gettext
771
+find_package(Gettext)
772
+
773
+option(USE_PCH "Use precompiled headers" OFF)
774
+
775
+# Use the following directories as includes
776
+# Note that it is important the binary include directory comes before the
777
+# source include directory so the precompiled headers work correctly.
778
+include_directories(${Anope_BINARY_DIR}/include ${Anope_SOURCE_DIR}/include ${Anope_BINARY_DIR}/language ${Anope_SOURCE_DIR}/modules/pseudoclients)
779
+
780
+# Pass on REPRODUCIBLE_BUILD
781
+if(REPRODUCIBLE_BUILD)
782
+  add_definitions(-DREPRODUCIBLE_BUILD)
783
+endif(REPRODUCIBLE_BUILD)
784
+
785
+# If using Windows, always add the _WIN32 define
786
+if(WIN32)
787
+  add_definitions(-D_WIN32)
788
+  # And include the windows specific folder for our anope_windows.h
789
+  include_directories(${Anope_SOURCE_DIR}/src/win32)
790
+endif(WIN32)
791
+
792
+# If using Visual Studio, set the C++ flags accordingly
793
+if(MSVC)
794
+  # Remove the default exception handling flags, also remove default warning level flag
795
+  string(REPLACE "/EHsc " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
796
+  string(REPLACE "/GX " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
797
+  string(REPLACE "/W3 " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
798
+  # Set the compile flags to have warnings on the max setting (but disable a few annoying ones), exception handling turned on, the proper defines
799
+  set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4127 /wd4250 /wd4251 /wd4355 /wd4706 /wd4800 /wd4996 /EHs")
800
+  add_definitions(-DMSVCPP -D_CRT_SECURE_NO_WARNINGS)
801
+# Otherwise, we're not using Visual Studio
802
+else(MSVC)
803
+  # Set the compile flags to have all warnings on (including shadowed variables)
804
+  set(CXXFLAGS "${CXXFLAGS} -Wall -Wshadow")
805
+  # If on a *nix system, also set the compile flags to remove GNU extensions (favor ISO C++) as well as reject non-ISO C++ code, also remove all leading underscores in exported symbols (only on GNU compiler)
806
+  if(UNIX)
807
+    set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic ${CMAKE_CXX_FLAGS}")
808
+    if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
809
+      set(CXXFLAGS "${CXXFLAGS} -Wno-long-long -fno-leading-underscore")
810
+    endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
811
+  # If we aren't on a *nix system, we are using MinGW
812
+  else(UNIX)
813
+    # Also, if we are building under MinGW, add another define for MinGW
814
+    if(MINGW)
815
+      add_definitions(-DMINGW)
816
+    endif(MINGW)
817
+  endif(UNIX)
818
+endif(MSVC)
819
+
820
+# If CMake has found that the given system requires a special library for dl* calls, include it with the linker flags
821
+if(CMAKE_DL_LIBS)
822
+  append_to_list(LINK_LIBS ${CMAKE_DL_LIBS})
823
+endif(CMAKE_DL_LIBS)
824
+
825
+# Under MinGW, the -shared flag isn't properly set in the module-specific linker flags, add it from the C flags for shared libraries
826
+if(MINGW)
827
+  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
828
+endif(MINGW)
829
+
830
+if(NOT PROGRAM_NAME)
831
+  # Under Windows, we set the executable name for Anope to be anope
832
+  if(WIN32)
833
+    set(PROGRAM_NAME anope)
834
+  # Under *nix, we set the executable name for Anope to be services
835
+  else(WIN32)
836
+    set(PROGRAM_NAME services)
837
+  endif(WIN32)
838
+endif(NOT PROGRAM_NAME)
839
+
840
+# If we are not using Visual Studio, we'll run the following checks
841
+if(NOT MSVC)
842
+  # Check if the C++ compiler can accept the -pipe flag, and add it to the compile flags if it works
843
+  if(CMAKE244_OR_BETTER)
844
+    # If using CMake 2.4.4 or better, we can use check_cxx_compiler_flag
845
+    check_cxx_compiler_flag(-pipe HAVE_PIPE_FLAG)
846
+  else(CMAKE244_OR_BETTER)
847
+    # If using CMake 2.4.3 or older, we will use check_cxx_accepts_flags instead
848
+    check_cxx_accepts_flag(-pipe HAVE_PIPE_FLAG)
849
+  endif(CMAKE244_OR_BETTER)
850
+  # If the flag was accepted, add it to the list of flags
851
+  if(HAVE_PIPE_FLAG)
852
+    set(CXXFLAGS "${CXXFLAGS} -pipe")
853
+  endif(HAVE_PIPE_FLAG)
854
+
855
+  # The following are additional library checks, they are not required for Windows
856
+  if(NOT WIN32)
857
+    # Check if socket is within the socket library (if the library exists), and add it to the linker flags if needed
858
+    check_library_exists(socket socket "" HAVE_SOCKET_LIB)
859
+    if(HAVE_SOCKET_LIB)
860
+      append_to_list(LINK_LIBS socket)
861
+    endif(HAVE_SOCKET_LIB)
862
+    # Check if inet_addr is within the nsl library (if the library exists), and add it to the linker flags if needed
863
+    check_library_exists(nsl inet_addr "" HAVE_NSL_LIB)
864
+    if(HAVE_NSL_LIB)
865
+      append_to_list(LINK_LIBS nsl)
866
+    endif(HAVE_NSL_LIB)
867
+    # Check if pthread_create is within the pthread library (if the library exists), and add it to the linker flags if needed
868
+    check_library_exists(pthread pthread_create "" HAVE_PTHREAD)
869
+    if(HAVE_PTHREAD)
870
+      if(NOT APPLE)
871
+        set(LDFLAGS "${LDFLAGS} -pthread")
872
+      endif(NOT APPLE)
873
+    else(HAVE_PTHREAD)
874
+      message(FATAL_ERROR "The pthread library is required to build Anope")
875
+    endif(HAVE_PTHREAD)
876
+  endif(NOT WIN32)
877
+endif(NOT MSVC)
878
+
879
+# If DEFUMASK wasn't passed to CMake, set a default depending on if RUNGROUP was passed in or not
880
+if(NOT DEFUMASK)
881
+  if(RUNGROUP)
882
+    set(DEFUMASK "007")
883
+  else(RUNGROUP)
884
+    set(DEFUMASK "077")
885
+  endif(RUNGROUP)
886
+endif(NOT DEFUMASK)
887
+
888
+# Set the DEBUG_BUILD for sysconf.h
889
+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
890
+  set(DEBUG_BUILD TRUE)
891
+endif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
892
+
893
+# Check for the existence of the following include files
894
+check_include_file(cstdint HAVE_CSTDINT)
895
+check_include_file(stdint.h HAVE_STDINT_H)
896
+check_include_file(strings.h HAVE_STRINGS_H)
897
+
898
+# Check for the existence of the following functions
899
+check_function_exists(strcasecmp HAVE_STRCASECMP)
900
+check_function_exists(stricmp HAVE_STRICMP)
901
+check_function_exists(umask HAVE_UMASK)
902
+check_function_exists(epoll_wait HAVE_EPOLL)
903
+check_function_exists(poll HAVE_POLL)
904
+check_function_exists(kqueue HAVE_KQUEUE)
905
+
906
+# Strip the leading and trailing spaces from the compile flags
907
+if(CXXFLAGS)
908
+  strip_string(${CXXFLAGS} CXXFLAGS)
909
+endif(CXXFLAGS)
910
+# Strip the leading and trailing spaces from the linker flags
911
+if(LDFLAGS)
912
+  strip_string(${LDFLAGS} LDFLAGS)
913
+endif(LDFLAGS)
914
+
915
+# Search for the following programs
916
+find_program(GREP grep)
917
+find_program(SH sh)
918
+find_program(CHGRP chgrp)
919
+find_program(CHMOD chmod)
920
+
921
+# If a INSTDIR was passed in to CMake, use it as the install prefix, otherwise set the default install prefix to the services directory under the user's home directory
922
+if(INSTDIR)
923
+  set(CMAKE_INSTALL_PREFIX "${INSTDIR}")
924
+elseif(NOT CMAKE_INSTALL_PREFIX)
925
+  set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/services")
926
+endif(INSTDIR)
927
+
928
+# Set default paths for various directories if not already defined
929
+if(NOT BIN_DIR)
930
+  set(BIN_DIR "bin")
931
+endif(NOT BIN_DIR)
932
+if(NOT DB_DIR)
933
+  set(DB_DIR "data")
934
+endif(NOT DB_DIR)
935
+if(NOT DOC_DIR)
936
+  set(DOC_DIR "doc")
937
+endif(NOT DOC_DIR)
938
+if(NOT CONF_DIR)
939
+  set(CONF_DIR "conf")
940
+endif(NOT CONF_DIR)
941
+if(NOT LIB_DIR)
942
+  set(LIB_DIR "lib")
943
+endif(NOT LIB_DIR)
944
+if(NOT LOCALE_DIR)
945
+  set(LOCALE_DIR "locale")
946
+endif(NOT LOCALE_DIR)
947
+if(NOT LOGS_DIR)
948
+  set(LOGS_DIR "logs")
949
+endif(NOT LOGS_DIR)
950
+
951
+# Version number processing
952
+# Find all lines in src/version.sh that start with VERSION_
953
+read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS)
954
+# Iterate through the strings found
955
+foreach(VERSION_STR ${VERSIONS})
956
+  string(REGEX REPLACE "^VERSION_([A-Z]+)=\"?([^\"]*)\"?$" "\\1;\\2" VERSION_OUT ${VERSION_STR})
957
+  # Depends on CMP0007 OLD
958
+  list(LENGTH VERSION_OUT VERSION_LEN)
959
+  list(GET VERSION_OUT 0 VERSION_TYPE)
960
+  if(${VERSION_LEN} GREATER 1)
961
+    list(GET VERSION_OUT 1 VERSION_DATA)
962
+    set(VERSION_${VERSION_TYPE} ${VERSION_DATA})
963
+  endif(${VERSION_LEN} GREATER 1)
964
+endforeach(VERSION_STR ${VERSIONS})
965
+
966
+# Default build version to 0
967
+set(VERSION_BUILD 0)
968
+
969
+# Only change the build number if version.h exists
970
+if(EXISTS "${Anope_SOURCE_DIR}/include/version.h")
971
+  # Attempt to read the build number from include/version.h
972
+  read_from_file(${Anope_SOURCE_DIR}/include/version.h "^#define VERSION_BUILD" VERSIONS)
973
+  foreach(VERSION_STR ${VERSIONS})
974
+    # Get the length of the string
975
+    string(LENGTH ${VERSION_STR} VERSION_LEN)
976
+    # Subtract 22 from the string's length
977
+    math(EXPR VERSION_NUM_LEN "${VERSION_LEN} - 22")
978
+    # Extract the value from the string
979
+    string(SUBSTRING ${VERSION_STR} 22 ${VERSION_NUM_LEN} VERSION)
980
+    # Set VERSION_BUILD correctly
981
+    set(VERSION_BUILD ${VERSION})
982
+  endforeach(VERSION_STR ${VERSIONS})
983
+endif(EXISTS "${Anope_SOURCE_DIR}/include/version.h")
984
+
985
+# Set the version variables based on what was found above
986
+set(VERSION_COMMA "${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_BUILD}")
987
+set(VERSION_DOTTED_NOBUILD "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
988
+set(VERSION_DOTTED "${VERSION_DOTTED_NOBUILD}.${VERSION_BUILD}")
989
+set(VERSION_FULL "${VERSION_DOTTED}${VERSION_EXTRA}")
990
+set(VERSION_FULL_NOBUILD "${VERSION_DOTTED_NOBUILD}${VERSION_EXTRA}")
991
+
992
+# Only do the following for Windows
993
+if(WIN32)
994
+  # Generate the win32.rc file using the above variables
995
+  configure_file(${Anope_SOURCE_DIR}/src/win32/win32.rc.cmake ${Anope_BINARY_DIR}/src/win32/win32.rc)
996
+endif(WIN32)
997
+
998
+# Add the initial files to ignore which will be ignored regardless of if you are building in-source or out-of-source
999
+add_to_cpack_ignored_files(".git\;config.cache\;CMakeFiles\;sysconf.h$\;build" TRUE)