Commit ac091d40988ebb00b87d4e56311db6f309d37bdf

  • avatar
  • Duke Leto <jonathan @le…o.net>
  • Tue Nov 03 08:30:11 CET 2009
Make src/lib/Glue.pir Perl 5 POD, not Perl 6 POD
  
11
2=begin
3
42=head1 NAME
53
64Glue.pir - Rakudo "glue" builtins (functions/globals) converted for NQP
6060 our $OS;
6161 our $OSVER;
6262
63=end
6463
6564.namespace []
6665
6767.include 'sysinfo.pasm'
6868.include 'iglobals.pasm'
6969
70=begin
7170
7271=head1 DESCRIPTION
7372
8080the status code of the spawned process, which is equal the the result
8181of the waitpid system call, right bitshifted by 8.
8282
83=end
8483
8584.sub 'run'
8685 .param pmc command_and_args :slurpy
9494 .return (status)
9595.end
9696
97=begin
9897
9998=item $success := do_run($command, $and, $args, ...)
10099
101101arguments as a new process; return 1 if the process exited successfully, or
1021020 if not.
103103
104=end
105104
106105.sub 'do_run'
107106 .param pmc command_and_args :slurpy
118118 .return (0)
119119.end
120120
121=begin
122121
123122=item $output := qx($command, $and, $args, ...)
124123
126126
127127B<WARNING>: Parrot currently implements this B<INSECURELY>!
128128
129=end
130129
131130.sub 'qx'
132131 .param pmc command_and_args :slurpy
150150 die $S0
151151.end
152152
153=begin
154153
155154=item die($message)
156155
157156Kill program, reporting error C<$message>.
158157
159=end
160158
161159.sub 'die'
162160 .param string message
162162 die message
163163.end
164164
165=begin
166165
167166=item $ret := try(&code, @args [, &handler])
168167
174174 catch($ex) { $ret := &handler ?? &handler($ex, &code, @args) !! 0 }
175175 return $ret;
176176
177=end
178177
179178.sub 'try'
180179 .param pmc code
198198 .return (0)
199199.end
200200
201=begin
202201
203202=item @keys := keys(%hash)
204203
205204Return an array containing the keys of the C<%hash>.
206205
207=end
208206
209207.sub 'keys'
210208 .param pmc hash
223223 .return(key_list)
224224.end
225225
226=begin
227226
228227=item $found := exists(%hash, $key)
229228
230229Determine if C<$key> exists in C<%hash>, returning a true value if so, and a
231230false value if not.
232231
233=end
234232
235233.sub 'exists'
236234 .param pmc hash
239239 .return($I0)
240240.end
241241
242=begin
243242
244243=item $does_role := does($object, $role)
245244
246245Determine if C<$object> does the C<$role>, returning a true value if so, and a
247246false value if not.
248247
249=end
250248
251249.sub 'does'
252250 .param pmc object
255255 .return($I0)
256256.end
257257
258=begin
259258
260259=item $contents := slurp($filename)
261260
262261Read the C<$contents> of a file as a single string.
263262
264=end
265263
266264.sub 'slurp'
267265 .param string filename
271271 .return(contents)
272272.end
273273
274=begin
275274
276275=item spew($filename, $contents)
277276
278277Write the string C<$contents> to a file.
279278
280=end
281279
282280.sub 'spew'
283281 .param string filename
286286 close $P0
287287.end
288288
289=begin
290289
291290=item append($filename, $contents)
292291
293292Append the string C<$contents> to a file.
294293
295=end
296294
297295.sub 'append'
298296 .param string filename
301301 close $P0
302302.end
303303
304=begin
305304
306305=item $regex_object := rx($regex_source)
307306
308308Perl 6 Regex) into a C<$regex_object>, suitable for using in C<match()> and
309309C<subst()>.
310310
311=end
312311
313312.sub 'rx'
314313 .param string source
319319 .return(object)
320320.end
321321
322=begin
323322
324323=item @matches := all_matches($regex, $text)
325324
326325Find all matches (C<:g> style, not C<:exhaustive>) for C<$regex> in the
327326C<$text>. The C<$regex> must be a regex object returned by C<rx()>.
328327
329=end
330328
331329.sub 'all_matches'
332330 .param pmc regex
349349 .return(matches)
350350.end
351351
352=begin
353352
354353=item $edited := subst($original, $regex, $replacement)
355354
360360with each match object in turn, and must return the proper replacement string
361361for that match.
362362
363=end
364363
365364.sub 'subst'
366365 .param string original
407407 .return(edited)
408408.end
409409
410=begin
411410
412411=item chdir($path)
413412
414413Change the current working directory to the specified C<$path>.
415414
416=end
417415
418416.sub 'chdir'
419417 .param string path
421421 os.'chdir'(path)
422422.end
423423
424=begin
425424
426425=item $path := cwd()
427426
428427Return the current working directory.
429428
430=end
431429
432430.sub 'cwd'
433431 .local pmc os
437437 .return(path)
438438.end
439439
440=begin
441440
442441=item mkdir($path [, $mode])
443442
444444optional and defaults to octal C<777> (full permissions) if absent. C<$mode>
445445is modified by the user's current C<umask> as usual.
446446
447=end
448447
449448.sub 'mkdir'
450449 .param string path
459459 os.'mkdir'(path, mode)
460460.end
461461
462=begin
463462
464463=item unlink($path)
465464
466465Unlink (delete) a file or empty directory named C<$path> in the filesystem.
467466
468=end
469467
470468.sub 'unlink'
471469 .param string path
473473 os.'rm'(path)
474474.end
475475
476=begin
477476
478477=item @info := stat($path)
479478
480479Returns a 13-item list of information about the given C<$path>, as in Perl 5.
481480(See C<perldoc -f stat> for more details.)
482481
483=end
484482
485483.sub 'stat'
486484 .param string path
490490 .return (stat_list)
491491.end
492492
493=begin
494493
495494=item $found := path_exists($path);
496495
497496Return a true value if the C<$path> exists on the filesystem, or a false
498497value if not.
499498
500=end
501499
502500.sub 'path_exists'
503501 .param string path
511511 .return (0)
512512.end
513513
514=begin
515514
516515=item @names := readdir($directory)
517516
518517List the names of all entries in the C<$directory>.
519518
520=end
521519
522520.sub 'readdir'
523521 .param string dir
527527 .return (names)
528528.end
529529
530=begin
531530
532531=item $path := fscat(@path_parts [, $filename])
533532
535535trailing slash (though slashes inside the C<@path_parts> will not be removed,
536536so don't do that).
537537
538=end
539538
540539.sub 'fscat'
541540 .param pmc parts
557557 .return (joined)
558558.end
559559
560=begin
561560
562561=item $joined := join($delimiter, @strings)
563562
564563Join C<@strings> together with the specified C<$delimiter>.
565564
566=end
567565
568566.sub 'join'
569567 .param string delim
573573 .return (joined)
574574.end
575575
576=begin
577576
578577=item @pieces := split($delimiter, $original)
579578
580579Split the C<$original> string with the specified C<$delimiter>, which is not
581580included in the resulting C<@pieces>.
582581
583=end
584582
585583.sub 'split'
586584 .param string delim
590590 .return (pieces)
591591.end
592592
593=begin
594593
595594=item @array := as_array($list, $of, $items, ...)
596595
597596Slurp the list of arguments into an array and return it.
598597
599=end
600598
601599.sub 'as_array'
602600 .param pmc items :slurpy
602602 .return (items)
603603.end
604604
605=begin
606605
607606=item $result := call_flattened(&code, $mixed, @args, $list, ...)
608607
615615
616616 call_flattened(&code, as_array(@protected), @will_flatten)
617617
618=end
619618
620619.sub 'call_flattened'
621620 .param pmc code
643643 .tailcall code(flattened :flat)
644644.end
645645
646=begin
647
648646=back
649647
650648
676676
677677=back
678678
679=end
680679
681680.sub 'onload' :anon :load :init
682681 load_bytecode 'config.pbc'