interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / collab / co9page.om

225 lines · 4128 bytes Raw Blame History
1note collab/co9page.om (ForgePatches): GET <o>/<r>/compose/<cid>, the checked text with its preview and
2note the note that publishing is closed for now, and GET compose/<cid>/<file>, the checked text as a file.
3text tcfnc "comment.md"
4text tcfnr "review.md"
5text tcfni "issue.md"
6text tcfnp "patch.md"
7text tcmdct "text/markdown; charset=utf-8"
8text tccdp "attachment; filename=\""
9text tcpg1 "<section class=\"box\"><h2>"
10text tcpk1 "Comment on issue "
11text tcpk2 "Comment on patch "
12text tcpk3 "Review of patch "
13text tcpk4 "New issue"
14text tcpk5 "New patch"
15text tcpkr ", revision "
16text tcpkacc " (accept)"
17text tcpkrej " (reject)"
18text tcpkdr " (draft)"
19text tcpg2 "</h2>\n<p class=\"meta\">The forge checked this text and keeps it for 15 minutes, for this session only. It wrote nothing to this repository.</p>\n<h3>Preview</h3>\n"
20text tcpgt1 "<p><b>"
21text tcpgt2 "</b></p>\n"
22text tcpgnone "<p class=\"muted\">No text.</p>\n"
23text tcpg3 "<h3>Publish it</h3>\n<ol class=\"so-steps\">\n"
24text tcpgdl1 "<li>Save <a href=\""
25text tcpgdl2 "\" download>"
26text tcpgdl3 "</a> to keep a copy.</li>\n"
27text tcpgcl "<li>Publishing it is closed for now: Interplane does not accept comments, reviews, issues or patches yet.</li>\n"
28text tcpgb1 "<li><a href=\""
29text tcpgb2 "\">Back</a>.</li>\n</ol></section>\n"
30note cofneq kd a b: frest[a,b) is the file name of kind kd
31fn cofneq kd ulong a ulong b ulong to bool
32if or eq kd 1 eq kd 2
33ret coseqat a b tcfnc
34end
35if eq kd 3
36ret coseqat a b tcfnr
37end
38if eq kd 4
39ret coseqat a b tcfni
40end
41ret coseqat a b tcfnp
42end
43fn cofname kd ulong to void
44if or eq kd 1 eq kd 2
45fput tcfnc
46ret
47end
48if eq kd 3
49fput tcfnr
50ret
51end
52if eq kd 4
53fput tcfni
54ret
55end
56fput tcfnp
57end
58note cocdlf s: the downloaded file: the body (comments, reviews), or the title, a blank line
59note and the description (new issues and patches)
60fn cocdlf s ulong to long
61kd = get gczk s
62put fkind 0 1
63fsetct tcmdct
64fsetcd tccdp
65cocdname kd
66fcdc 34
67put fobl 0 0
68if ge kd 4
69for k ulong get gcztl s bound 256
70fputc get gczti add mul s 256 k
71end
72fputc 10
73if gt get gczbl s 0
74fputc 10
75end
76end
77n = get gczbl s
78o = mul s 60000
79for k ulong n bound 60000
80fputc get gczb add o k
81end
82if gt n 0
83fputc 10
84end
85ret 200
86end
87fn cocdname kd ulong to void
88if or eq kd 1 eq kd 2
89cocdt tcfnc
90ret
91end
92if eq kd 3
93cocdt tcfnr
94ret
95end
96if eq kd 4
97cocdt tcfni
98ret
99end
100cocdt tcfnp
101end
102fn cocdt t view uchar * to void
103for i ulong len t bound 64
104fcdc get t i
105end
106end
107note ---- the page
108fn cocpage s ulong to long
109kd = get gczk s
110put ftil 0 0
111for i ulong len tctpub
112ftic get tctpub i
113end
114ftirepo
115if or eq kd 1 eq kd 4
116frepohd 6
117else
118frepohd 5
119end
120fput tcpg1
121cocphd s
122fput tcpg2
123if ge kd 4
124fput tcpgt1
125for k ulong get gcztl s bound 256
126fescc get gczti add mul s 256 k
127end
128fput tcpgt2
129end
130comdz s
131fput tcpg3
132cocpdl s
133fput tcpgcl
134fput tcpgb1
135cocpback s
136fput tcpgb2
137ret 200
138end
139note cocphd s: the heading, naming the target
140fn cocphd s ulong to void
141kd = get gczk s
142f = get gczf s
143if eq kd 4
144fput tcpk4
145ret
146end
147if eq kd 5
148fput tcpk5
149if eq and f 8 8
150fput tcpkdr
151end
152ret
153end
154if eq kd 1
155fput tcpk1
156else
157if eq kd 2
158fput tcpk2
159else
160fput tcpk3
161end
162end
163for k ulong 8
164fputc get gcztg add mul s 40 k
165end
166if ge kd 2
167fput tcpkr
168fnum get gczrn s
169end
170if and eq kd 3 eq f 1
171fput tcpkacc
172end
173if and eq kd 3 eq f 2
174fput tcpkrej
175end
176end
177note comdz s: the body of slot s rendered as Markdown (relative links against the default branch)
178fn comdz s ulong to void
179n = get gczbl s
180if eq n 0
181fput tcpgnone
182ret
183end
184o = mul s 60000
185for k ulong n bound 60000
186put fxo k get gczb add o k
187end
188codrefb
189put gbmdl 0 0
190fput tcmd1
191brmd 0 n
192fput tcmd2
193end
194note cocpdl s: the download step (a review without text needs no file)
195fn cocpdl s ulong to void
196if and eq get gczk s 3 eq get gczbl s 0
197ret
198end
199fput tcpgdl1
200fputrl
201fput tccompp
202for k ulong 32
203fputc get gczid add mul s 32 k
204end
205fputc 47
206cofname get gczk s
207fput tcpgdl2
208cofname get gczk s
209fput tcpgdl3
210end
211note cocpback s: link back to the issue, the patch or the list
212fn cocpback s ulong to void
213kd = get gczk s
214fputrl
215if or eq kd 1 eq kd 4
216fput tcissn
217else
218fput tcpatn
219end
220if le kd 3
221for k ulong 40
222fputc get gcztg add mul s 40 k
223end
224end
225end