-
Notifications
You must be signed in to change notification settings - Fork 0
/
writing_retroshare_plugins.lyx
1543 lines (1068 loc) · 27.9 KB
/
writing_retroshare_plugins.lyx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass scrartcl
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_title "RetroShare: Developing Plugins"
\pdf_subject "retroshare, plugins"
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder false
\pdf_colorlinks false
\pdf_backref false
\pdf_pdfusetitle true
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Title
RetroShare: Writing Plugins
\end_layout
\begin_layout Author
RetroShare Team
\end_layout
\begin_layout Standard
\begin_inset Note Note
status open
\begin_layout Plain Layout
There are 3 basic parts to a plugin: 4:55 PM drBob: 1) Serialiser - messages
that you want to send over the network.
4:56 PM drBob: 2) libretroshare service - send/recv msgs and prepare data
for GUI.
4:56 PM drBob: 3) rs-gui window - get info from service, and display it!
\end_layout
\begin_layout Plain Layout
electron: now i would like to make a plugin based on gxs.
For this the Plugin needs access to the gxs id service.
Is it the correct way to pass the idservice with the RsPluginInterfaces
to the plugin? 4:57 PM drBob: haha, nice - but its not quite ready! We
probably need to modify stuff to make gxsId service available, and the
GxsCircle service available.
4:58 PM drBob: what plugin where you thinking about? 4:59 PM electron:
first a gxs-testing plugin and later someday a file sync plugin 5:03 PM
Morpheus Being: And will think of a couple of suitable plugins - chess/gomoku
like in psi+? 5:03 PM drBob: @electron, perhaps better to write them as
normal services - compiled in.
5:03 PM electron: about serielisers: do you write the serialisers by hand?
because i don't like to write 100 lines of code, just to serialise a simple
string.
I have a idea of how to let the compiler write serialisers using templates.
But i'm not sure if i missed something.
5:04 PM drBob: we write the serialisers by hand.
5:04 PM electron: drbob: yes i thought of this.
5:05 PM Cyril: hi 5:05 PM electron: hi Cyril 5:05 PM drBob: when you find
we need access to stuff, that isn't in the plugin manager - then we can
add the access.
5:05 PM Cyril: serialisers are not so tedious to write.
5:05 PM drBob: (like gxsIds) 5:06 PM Cyril: Just copy what's done in existing
serialisers.
The most recent ones are in rsmsgitems.cc in v0.6-initdev branch.
5:08 PM electron: i just feel like doing something wrong when copieng code
5:08 PM drBob: haha.
5:08 PM Cyril: just dont forget to update the items' IDs  5:10 PM Cyril:
we could do some fancy things, like classes that derive from an automatic
serialisation base class.
I've done that in my own projects for GUIs.
You automatically get a gui entry for each member of a class.
But it is not really needed for us now.
5:13 PM electron: i was unhappy with writing serielisers by hand, and so
i thought about something using templates.
Then you just have to write a serialiser like this: serialise/deserialise_tool<
<var.
It is harder to understand what is going on later, but it was fun to think
about this 5:18 PM Lobby management: dasweiss-2 joined the lobby.
5:29 PM Lobby management: Like has left the lobby.
5:40 PM Lobby management: Stu Pid has left the lobby.
6:01 PM Cyril: @electron: well, actually you cna do that.
You just need in the constructor of your class to declare each member and
what type it needs to be serialized with.
It's anyway not an urgent thing to do, since we don't add new serialised
classes everyday.
It would be potentially useful for plugins anyway.
\end_layout
\begin_layout Plain Layout
5:14 PM Cyril: Basically there's multiple points: GUI part, and service
part.
The later is divided into 3 categories: (1) services based on friend communicat
ion, (2) services based on turtle router, (3) services based on cache exchange
5:14 PM Cyril: the currency plugin is type (2)
\end_layout
\begin_layout Plain Layout
5:15 PM Cyril: VOIP is type (1) 5:15 PM Cyril: LinksCloud is type (3) 5:16
PM Cyril: Aout the alternate currency plugin, there's a simple version
of it, called tortoise plugin, that only deadls with the tunnel-based communica
tion.
Is that what you're talking about? I'd like to include that one in the
sources, as a code example.
5:19 PM Cyril: https://github.com/zeroreserve/tortoise 5:20 PM Morpheus
Being: yep 5:20 PM Cyril: that's the one I'm talking about 5:20 PM Morpheus
Being: ok 5:20 PM Cyril: ok 5:20 PM Morpheus Being: I haven't looked at
it yet to start understanding it 5:20 PM Cyril: no need to go into the
real bitcoin plugin.
Too complicated for a plugin squeleton example 5:20 PM Morpheus Being:
Does only of these services disappear with gxs 5:21 PM ASmith: EmptyPluginRS-ma
ster.zip
\end_layout
\begin_layout Plain Layout
5:21 PM Morpheus Being: I do any of these services disappear with gs 5:21
PM Cyril: no.
All the plugins will continue to work with GXS.
5:21 PM Morpheus Being: gxs 5:21 PM Morpheus Being: Ahh that is good to
know, thanks 5:22 PM Morpheus Being: fingers misbehaving 5:22 PM Morpheus
Being: I have a bit of short circuit in nerves in neck 5:22 PM Cyril: only
questions: LinksCloud will be using the old cache system.
We'll replace it by the Posted service, which uses GXS and does at least
the same thing 5:22 PM Morpheus Being: k 5:24 PM Lobby management: jenster
joined the lobby.
5:24 PM ASmith: FeedReader has optional Proxy support, why can't that be
added to the main Retroshare Platform? 5:25 PM Morpheus Being: I haven't
used links cloud a lot, but use feedreader a lot 5:26 PM Morpheus Being:
will look at the code and differences over weekend 5:26 PM Morpheus Being:
Have to go for a bit now, and feed/water animals, be back a bit later.
\end_layout
\end_inset
\begin_inset Newpage newpage
\end_inset
\end_layout
\begin_layout Section
Introduction
\end_layout
\begin_layout Standard
So you have been using RetroShare for a while, and as a computer programmer,
you want to add your favourite plugin to share with others.
\end_layout
\begin_layout Standard
Where to start?
\end_layout
\begin_layout Standard
Well, that is the purpose of this guide.
It will provide a guide for developing it and getting it working with RetroShar
e with the least amount of effort possible.
\end_layout
\begin_layout Standard
This was written as a plugin was being developed, so the screen shots displayed
are for that plugin.
\end_layout
\begin_layout Section
Concepts
\end_layout
\begin_layout Standard
There are 2 parts to a plugin:
\end_layout
\begin_layout Enumerate
services - can often run under RetroShare-NoGui
\end_layout
\begin_layout Enumerate
GUI - Loaded by RetroShare-GUI to interact with it's service or other parts
of
\end_layout
\begin_layout Standard
Most existing plugins have both, but can be one or the other, depending
on the needs of the plugin.
\end_layout
\begin_layout Standard
There are 3 types of Service:
\end_layout
\begin_layout Enumerate
services based on friend communication eg VoIP
\end_layout
\begin_layout Enumerate
services based on turtle router eg ZeroReserve
\end_layout
\begin_layout Enumerate
services based on cache exchange eg LinksCloud
\end_layout
\begin_layout Standard
Common Parts:
\end_layout
\begin_layout Enumerate
Serialiser - messages that you want to send over the network.
Serialisation is normally done by hand in RS, but there are other ways.
Both simple string encoding and JSON have been used.
\begin_inset Note Note
status open
\begin_layout Plain Layout
Saw notes at top of this doc.
\begin_inset Quotes eld
\end_inset
You just need in the constructor of your class to declare each member and
what type it needs to be serialized with.
\begin_inset Quotes erd
\end_inset
needs more info -chozabu.
\end_layout
\end_inset
\end_layout
\begin_layout Enumerate
Service interface - When loading a plugin, Retroshare provides a list of
interfaces, to access Forums, Channels, DHT, Discovery, Messages, Files
or other parts of retroshare.
Though these interfaces are declared extern, they should be accessed from
\end_layout
\begin_layout Standard
All non-cache based plugins working in the 0.5.* version and releases, will
continue to work with 0.6 which changes to a new system using GXS.
Anything that interacts with Forums/Channels (such as feedreader and WSRS)
will need to make some changes.
\begin_inset Note Note
status open
\begin_layout Plain Layout
Upgrades and changes will be needed.
feedreader and WSRS interact with the forums directly, and GXS has quite
a different interface.
\end_layout
\end_inset
\end_layout
\begin_layout Section
Important Things
\end_layout
\begin_layout Subsection
Language
\end_layout
\begin_layout Standard
RetroShare is written in c++ with some parts in c.
You need to have a good understanding of c++.
\end_layout
\begin_layout Standard
It will be possible to add other features from other languages that can
be called from c/c++ and return values into the calling program eg Haskell.
\end_layout
\begin_layout Standard
Another alternative is to use WSRS or PYRS both of which are available from
github.
\end_layout
\begin_layout Subsection
Tools and Libraries
\end_layout
\begin_layout Subsubsection
QtCreator
\end_layout
\begin_layout Standard
QtCreator is a free tool that can be used to develop the project, as well
as editing, and compiling to create a library as either a *.so for Gnu/Linux
or *.dll for Windows or *.so for Mac.
\end_layout
\begin_layout Subsubsection
Editor
\end_layout
\begin_layout Standard
Many programmers use vim ( from
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://www.vim.org/
\end_layout
\end_inset
) with some addons to make editing easier and faster, especially on older,
slower computers.
You can get a complete collection of plugins and settings for vim from
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
https://github.com/morpheusbeing/vim
\end_layout
\end_inset
.
\end_layout
\begin_layout Standard
Emacs is another editor that can be used.
\end_layout
\begin_layout Subsubsection
Libraries
\end_layout
\begin_layout Standard
Unless your plugin is very complicated, all the required libraries should
be available on your computer if you can compile a working version of RetroShar
e.
\end_layout
\begin_layout Subsubsection
Version Control
\begin_inset CommandInset label
LatexCommand label
name "sub:Version-Control"
\end_inset
\end_layout
\begin_layout Standard
At present, RetroShare uses svn for its version control.
If you are compiling your own, you will understand the use of the
\emph on
svn up
\emph default
command on Gnu/Linux or on MS Windows or on MAC OS.
\end_layout
\begin_layout Standard
For a project like this, git and
\begin_inset Flex URL
status open
\begin_layout Plain Layout
https://github.com
\end_layout
\end_inset
is a good option to manage a local and remote repository.
Most of the current plugins have a git repository.
\end_layout
\begin_layout Standard
For example, the FriendMap plugin, using the KDE Marble development libraries
is found at
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
https://github.com/chozabu/FriendMap
\end_layout
\end_inset
.
\end_layout
\begin_layout Standard
You will need to create an account if you don't have one, and create a repositor
y to store your code in.
This allows you to keep an offsite copy of your work, as well as allowing
for collaboration.
There are many useful tutorials on using git, but essentially it is as
follows:
\end_layout
\begin_layout Enumerate
Login or create an account at
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
https://github.com
\end_layout
\end_inset
.
\end_layout
\begin_layout Enumerate
Create a new repository (best to use the same name with same character case
as your plugin name).
\end_layout
\begin_layout Enumerate
cd into the plugin folder you are working with
\end_layout
\begin_layout Enumerate
create a README.md file and edit the contents of it.
\end_layout
\begin_layout Enumerate
Initialise your local repository:
\begin_inset listings
inline false
status open
\begin_layout Plain Layout
git init
\end_layout
\end_inset
\end_layout
\begin_layout Enumerate
Add the file you just created to your repository:
\begin_inset listings
inline false
status open
\begin_layout Plain Layout
git add readme.md
\end_layout
\end_inset
\end_layout
\begin_layout Enumerate
Commit the changes made into your repository:
\begin_inset listings
lstparams "basicstyle={\footnotesize\ttfamily}"
inline false
status open
\begin_layout Plain Layout
git commit -a -m "first commit"
\end_layout
\end_inset
\end_layout
\begin_layout Enumerate
Map your repository to the remote repository using the command:
\begin_inset listings
lstparams "basicstyle={\scriptsize\ttfamily}"
inline false
status open
\begin_layout Plain Layout
\paragraph_spacing single
\noindent
\align left
git remote add origin https://github.com/[your user name]/[your plugin].git
\end_layout
\end_inset
\end_layout
\begin_layout Enumerate
Now add any other files you have created.
To add a folder, just use the folder name, and will track all the files.
\end_layout
\begin_layout Enumerate
Now copy your repository to the remote :
\begin_inset listings
lstparams "basicstyle={\footnotesize\ttfamily}"
inline false
status open
\begin_layout Plain Layout
\noindent
\align left
git push -u origin master
\end_layout
\end_inset
\end_layout
\begin_layout Enumerate
Now check the status of local git:
\begin_inset listings
lstparams "basicstyle={\ttfamily}"
inline false
status open
\begin_layout Plain Layout
git status
\end_layout
\end_inset
\end_layout
\begin_layout Paragraph
More Information About git
\end_layout
\begin_layout Standard
For more information about using git, check the internet for tutorials and
information.
\end_layout
\begin_layout Standard
You can find a good, one page cheat sheet at
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
https://github.com/AlexZeitler/gitcheatsheet
\end_layout
\end_inset
.
\end_layout
\begin_layout Standard
For a git reference that can be found on internet or download or installed
on your computer visit
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://www-cs-students.stanford.edu/~blynn/gitmagic/
\end_layout
\end_inset
.
\end_layout
\begin_layout Subsection
Structure
\end_layout
\begin_layout Standard
It is possible to put all the files in one folder of the plugin name so
that it is ~/retroshare/plugins[your plugin] as shown in
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:folder structure"
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Float figure
placement h
wide false
sideways false
status open
\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
filename folder_structure.png
lyxscale 50
scale 80
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption
\begin_layout Plain Layout
Folder Structure For Plugin
\begin_inset CommandInset label
LatexCommand label
name "fig:folder structure"
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
As a suggestion, establish some folders in you plugin to store various parts
of your project into (refer to
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:plugin subfolders"
\end_inset
)
\end_layout
\begin_layout Standard
\noindent
\align center
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
filename project_subfolders.png
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption
\begin_layout Plain Layout
Sub-folders for the plugin (suggested)
\begin_inset CommandInset label
LatexCommand label
name "fig:plugin subfolders"
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
You will notice a folder .git - this is for versioning control - refer to
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:Version-Control"
\end_inset
.
\end_layout
\begin_layout Standard
You should also create the .gitignore file now to prevent some issues with
including unwanted files in the version control.
Refer to .gitignore
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:Appendix-A--gitignore"
\end_inset
.
\end_layout
\begin_layout Subsubsection
gui folder
\end_layout
\begin_layout Standard
This folder contains parts only loaded by RetroShare-GUI for the user to
interact with.
EG the forum
\end_layout
\begin_layout Subsubsection
interface folder
\end_layout
\begin_layout Standard
Some of the larger, more complicated plugins, have all the interface code
stored in this directory.
\end_layout
\begin_layout Subsubsection
services folder
\end_layout
\begin_layout Standard
Anything here should be loadable by RetroShare-NOGUI.
For example, the forum service that syncs messages with other people
\end_layout
\begin_layout Subsubsection
lang folder
\end_layout
\begin_layout Standard
This folder contains all the files required for translating the strings
used in the plugin to the appropriate user language.
\end_layout
\begin_layout Subsection
Coding Style
\end_layout
\begin_layout Section
Putting It Together
\end_layout
\begin_layout Subsection
Serialiser
\end_layout
\begin_layout Standard
\begin_inset Note Note
status open
\begin_layout Plain Layout
You just need in the constructor of your class to declare each member and
what type it needs to be serialized with.
It's anyway not an urgent thing to do, since we don't add new serialised
classes everyday.
It would be potentially useful for plugins anyway.
\begin_inset Note Note
status open
\begin_layout Plain Layout
I'd missed that - looks to me like serialisation need to be done by hand
(I'm mostly encoding stuff as json, and sending a string.
Easy, but not very optimal!)
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Subsection
How To Set Icon
\end_layout
\begin_layout Standard
\begin_inset Note Note
status open
\begin_layout Plain Layout
Tried this with FriendMap, and while I can get the icon to show, the plugin
crashes RS
\end_layout
\end_inset
\end_layout
\begin_layout Section
readme.md
\end_layout
\begin_layout Standard
When creating your repository on github, it is a good idea to create this
file at the same.
\end_layout
\begin_layout Standard
It should contain at least the following information:
\end_layout
\begin_layout Enumerate
What the plugin is for
\end_layout
\begin_layout Enumerate
Licence for the plugin
\end_layout
\begin_layout Enumerate
Required libraries and their repositories (where they can be obtained from)
in the readme.md file.
\end_layout
\begin_layout Enumerate
Compiling and installation instructions for all of the platforms that the
plugin
\end_layout
\begin_layout Section
Example
\end_layout
\begin_layout Standard
This is a simple example that just displays a popup message.
\begin_inset Note Note
status open
\begin_layout Plain Layout
Two very helpfull examples for me were the emptyplugin I wrote (could do
with a cleanup) and the example plugin that shows basic networking.
I only know of the emptyplugin.
\end_layout
\end_inset
\end_layout
\begin_layout Section
Documentation Processes
\end_layout
\begin_layout Standard
RetroShare uses doxygen to comment all of the code.
Good comments make it easier for people who come behind you to understand
the code and to find and fix issues or make improvements.
\end_layout
\begin_layout Standard
There are several different styles of doxygen coding that can be used.
\end_layout
\begin_layout Standard
Refer to
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://www.doxygen.org/
\end_layout
\end_inset
for more information relating to Doxygen.
\end_layout
\begin_layout Standard
The @ and
\backslash
are interchangeable.
\end_layout
\begin_layout Subsection
Blocks
\end_layout
\begin_layout Standard
Blocks are the basic units of documentation for Doxygen from
\begin_inset CommandInset href
LatexCommand href
name "Doxygen home page"
target "http://www.stack.nl/~dimitri/doxygen/"
\end_inset
.
At first it will feel like overkill to use blocks, but realize that Doxygen
was initially designed to operate on header and source files, and then
the blocks of documentation would be before the definition or declaration
of the methods, functions, etcetera.
Doxygen is used to operating on blocks, and that's why we need to reproduce
them in our dox files.
\end_layout
\begin_layout Standard
Blocks should adhere to the following standards:
\end_layout
\begin_layout Itemize
All blocks open with
\begin_inset listings
inline false
status open
\begin_layout Plain Layout
/*!
\end_layout