Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

302 lines
13 KiB

  1. package Pod::Functions;
  2. #:vi:set ts=20
  3. require Exporter;
  4. @ISA = qw(Exporter);
  5. @EXPORT = qw(%Kinds %Type %Flavor %Type_Description @Type_Order);
  6. %Type_Description = (
  7. 'ARRAY' => 'Functions for real @ARRAYs',
  8. 'Binary' => 'Functions for fixed length data or records',
  9. 'File' => 'Functions for filehandles, files, or directories',
  10. 'Flow' => 'Keywords related to control flow of your perl program',
  11. 'HASH' => 'Functions for real %HASHes',
  12. 'I/O' => 'Input and output functions',
  13. 'LIST' => 'Functions for list data',
  14. 'Math' => 'Numeric functions',
  15. 'Misc' => 'Miscellaneous functions',
  16. 'Modules' => 'Keywords related to perl modules',
  17. 'Network' => 'Fetching network info',
  18. 'Objects' => 'Keywords related to classes and object-orientedness',
  19. 'Process' => 'Functions for processes and process groups',
  20. 'Regexp' => 'Regular expressions and pattern matching',
  21. 'Socket' => 'Low-level socket functions',
  22. 'String' => 'Functions for SCALARs or strings',
  23. 'SysV' => 'System V interprocess communication functions',
  24. 'Time' => 'Time-related functions',
  25. 'User' => 'Fetching user and group info',
  26. 'Namespace' => 'Keywords altering or affecting scoping of identifiers',
  27. );
  28. @Type_Order = qw{
  29. String
  30. Regexp
  31. Math
  32. ARRAY
  33. LIST
  34. HASH
  35. I/O
  36. Binary
  37. File
  38. Flow
  39. Namespace
  40. Misc
  41. Process
  42. Modules
  43. Objects
  44. Socket
  45. SysV
  46. User
  47. Network
  48. Time
  49. };
  50. while (<DATA>) {
  51. chomp;
  52. s/#.*//;
  53. next unless $_;
  54. ($name, $type, $text) = split " ", $_, 3;
  55. $Type{$name} = $type;
  56. $Flavor{$name} = $text;
  57. for $type ( split /[,\s]+/, $type ) {
  58. push @{$Kinds{$type}}, $name;
  59. }
  60. }
  61. close DATA;
  62. unless (caller) {
  63. foreach $type ( @Type_Order ) {
  64. $list = join(", ", sort @{$Kinds{$type}});
  65. $typedesc = $Type_Description{$type} . ":";
  66. write;
  67. }
  68. }
  69. format =
  70. ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  71. $typedesc
  72. ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  73. $typedesc
  74. ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  75. $list
  76. .
  77. 1
  78. __DATA__
  79. -X File a file test (-r, -x, etc)
  80. abs Math absolute value function
  81. accept Socket accept an incoming socket connect
  82. alarm Process schedule a SIGALRM
  83. atan2 Math arctangent of Y/X in the range -PI to PI
  84. bind Socket binds an address to a socket
  85. binmode I/O prepare binary files for I/O
  86. bless Objects create an object
  87. caller Flow,Namespace get context of the current subroutine call
  88. chdir File change your current working directory
  89. chmod File changes the permissions on a list of files
  90. chomp String remove a trailing record separator from a string
  91. chop String remove the last character from a string
  92. chown File change the owership on a list of files
  93. chr String get character this number represents
  94. chroot File make directory new root for path lookups
  95. close I/O close file (or pipe or socket) handle
  96. closedir I/O close directory handle
  97. connect Socket connect to a remote socket
  98. continue Flow optional trailing block in a while or foreach
  99. cos Math cosine function
  100. crypt String one-way passwd-style encryption
  101. dbmclose Objects,I/O breaks binding on a tied dbm file
  102. dbmopen Objects,I/O create binding on a tied dbm file
  103. defined Misc test whether a value, variable, or function is defined
  104. delete HASH deletes a value from a hash
  105. die I/O,Flow raise an exception or bail out
  106. do Flow,Modules turn a BLOCK into a TERM
  107. dump Misc,Flow create an immediate core dump
  108. each HASH retrieve the next key/value pair from a hash
  109. endgrent User be done using group file
  110. endhostent User be done using hosts file
  111. endnetent User be done using networks file
  112. endprotoent Network be done using protocols file
  113. endpwent User be done using passwd file
  114. endservent Network be done using services file
  115. eof I/O test a filehandle for its end
  116. eval Flow,Misc catch exceptions or compile and run code
  117. exec Process abandon this program to run another
  118. exists HASH test whether a hash key is present
  119. exit Flow terminate this program
  120. exp Math raise I<e> to a power
  121. fcntl File file control system call
  122. fileno I/O return file descriptor from filehandle
  123. flock I/O lock an entire file with an advisory lock
  124. fork Process create a new process just like this one
  125. format I/O declare a picture format with use by the write() function
  126. formline Misc internal function used for formats
  127. getc I/O get the next character from the filehandle
  128. getgrent User get next group record
  129. getgrgid User get group record given group user ID
  130. getgrnam User get group record given group name
  131. gethostbyaddr Network get host record given its address
  132. gethostbyname Network get host record given name
  133. gethostent Network get next hosts record
  134. getlogin User return who logged in at this tty
  135. getnetbyaddr Network get network record given its address
  136. getnetbyname Network get networks record given name
  137. getnetent Network get next networks record
  138. getpeername Socket find the other end of a socket connection
  139. getpgrp Process get process group
  140. getppid Process get parent process ID
  141. getpriority Process get current nice value
  142. getprotobyname Network get protocol record given name
  143. getprotobynumber Network get protocol record numeric protocol
  144. getprotoent Network get next protocols record
  145. getpwent User get next passwd record
  146. getpwnam User get passwd record given user login name
  147. getpwuid User get passwd record given user ID
  148. getservbyname Network get services record given its name
  149. getservbyport Network get services record given numeric port
  150. getservent Network get next services record
  151. getsockname Socket retrieve the sockaddr for a given socket
  152. getsockopt Socket get socket options on a given socket
  153. glob File expand filenames using wildcards
  154. gmtime Time convert UNIX time into record or string using Greenwich time
  155. goto Flow create spaghetti code
  156. grep LIST locate elements in a list test true against a given criterion
  157. hex Math,String convert a string to a hexadecimal number
  158. import Modules,Namespace patch a module's namespace into your own
  159. index String find a substring within a string
  160. int Math get the integer portion of a number
  161. ioctl File system-dependent device control system call
  162. join LIST join a list into a string using a separator
  163. keys HASH retrieve list of indices from a hash
  164. kill Process send a signal to a process or process group
  165. last Flow exit a block prematurely
  166. lc String return lower-case version of a string
  167. lcfirst String return a string with just the next letter in lower case
  168. length String return the number of bytes in a string
  169. link File create a hard link in the filesytem
  170. listen Socket register your socket as a server
  171. local Misc,Namespace create a temporary value for a global variable (dynamic scoping)
  172. localtime Time convert UNIX time into record or string using local time
  173. lock Threads get a thread lock on a variable, subroutine, or method
  174. log Math retrieve the natural logarithm for a number
  175. lstat File stat a symbolic link
  176. m// Regexp match a string with a regular expression pattern
  177. map LIST apply a change to a list to get back a new list with the changes
  178. mkdir File create a directory
  179. msgctl SysV SysV IPC message control operations
  180. msgget SysV get SysV IPC message queue
  181. msgrcv SysV receive a SysV IPC message from a message queue
  182. msgsnd SysV send a SysV IPC message to a message queue
  183. my Misc,Namespace declare and assign a local variable (lexical scoping)
  184. next Flow iterate a block prematurely
  185. no Modules unimport some module symbols or semantics at compile time
  186. package Modules,Objects,Namespace declare a separate global namespace
  187. prototype Flow,Misc get the prototype (if any) of a subroutine
  188. oct String,Math convert a string to an octal number
  189. open File open a file, pipe, or descriptor
  190. opendir File open a directory
  191. ord String find a character's numeric representation
  192. pack Binary,String convert a list into a binary representation
  193. pipe Process open a pair of connected filehandles
  194. pop ARRAY remove the last element from an array and return it
  195. pos Regexp find or set the offset for the last/next m//g search
  196. print I/O output a list to a filehandle
  197. printf I/O output a formatted list to a filehandle
  198. push ARRAY append one or more elements to an array
  199. q/STRING/ String singly quote a string
  200. qq/STRING/ String doubly quote a string
  201. quotemeta Regexp quote regular expression magic characters
  202. qw/STRING/ LIST quote a list of words
  203. qx/STRING/ Process backquote quote a string
  204. qr/PATTERN/ Regexp Compile pattern
  205. rand Math retrieve the next pseudorandom number
  206. read I/O,Binary fixed-length buffered input from a filehandle
  207. readdir I/O get a directory from a directory handle
  208. readline I/O fetch a record from a file
  209. readlink File determine where a symbolic link is pointing
  210. recv Socket receive a message over a Socket
  211. redo Flow start this loop iteration over again
  212. ref Objects find out the type of thing being referenced
  213. rename File change a filename
  214. require Modules load in external functions from a library at runtime
  215. reset Misc clear all variables of a given name
  216. return Flow get out of a function early
  217. reverse String,LIST flip a string or a list
  218. rewinddir I/O reset directory handle
  219. rindex String right-to-left substring search
  220. rmdir File remove a directory
  221. s/// Regexp replace a pattern with a string
  222. scalar Misc force a scalar context
  223. seek I/O reposition file pointer for random-access I/O
  224. seekdir I/O reposition directory pointer
  225. select I/O reset default output or do I/O multiplexing
  226. semctl SysV SysV semaphore control operations
  227. semget SysV get set of SysV semaphores
  228. semop SysV SysV semaphore operations
  229. send Socket send a message over a socket
  230. setgrent User prepare group file for use
  231. sethostent Network prepare hosts file for use
  232. setnetent Network prepare networks file for use
  233. setpgrp Process set the process group of a process
  234. setpriority Process set a process's nice value
  235. setprotoent Network prepare protocols file for use
  236. setpwent User prepare passwd file for use
  237. setservent Network prepare services file for use
  238. setsockopt Socket set some socket options
  239. shift ARRAY remove the first element of an array, and return it
  240. shmctl SysV SysV shared memory operations
  241. shmget SysV get SysV shared memory segment identifier
  242. shmread SysV read SysV shared memory
  243. shmwrite SysV write SysV shared memory
  244. shutdown Socket close down just half of a socket connection
  245. sin Math return the sine of a number
  246. sleep Process block for some number of seconds
  247. socket Socket create a socket
  248. socketpair Socket create a pair of sockets
  249. sort LIST sort a list of values
  250. splice ARRAY add or remove elements anywhere in an array
  251. split Regexp split up a string using a regexp delimiter
  252. sprintf String formatted print into a string
  253. sqrt Math square root function
  254. srand Math seed the random number generator
  255. stat File get a file's status information
  256. study Regexp optimize input data for repeated searches
  257. sub Flow declare a subroutine, possibly anonymously
  258. substr String get or alter a portion of a stirng
  259. symlink File create a symbolic link to a file
  260. syscall I/O,Binary execute an arbitrary system call
  261. sysread I/O,Binary fixed-length unbuffered input from a filehandle
  262. sysseek I/O,Binary position I/O pointer on handle used with sysread and syswrite
  263. system Process run a separate program
  264. syswrite I/O,Binary fixed-length unbuffered output to a filehandle
  265. tell I/O get current seekpointer on a filehandle
  266. telldir I/O get current seekpointer on a directory handle
  267. tie Objects bind a variable to an object class
  268. time Time return number of seconds since 1970
  269. times Process,Time return elapsed time for self and child processes
  270. tr/// String transliterate a string
  271. truncate I/O shorten a file
  272. uc String return upper-case version of a string
  273. ucfirst String return a string with just the next letter in upper case
  274. umask File set file creation mode mask
  275. undef Misc remove a variable or function definition
  276. unlink File remove one link to a file
  277. unpack Binary,LIST convert binary structure into normal perl variables
  278. unshift ARRAY prepend more elements to the beginning of a list
  279. untie Objects break a tie binding to a variable
  280. use Modules,Namespace load a module and import its namespace
  281. use Objects load in a module at compile time
  282. utime File set a file's last access and modify times
  283. values HASH return a list of the values in a hash
  284. vec Binary test or set particular bits in a string
  285. wait Process wait for any child process to die
  286. waitpid Process wait for a particular child process to die
  287. wantarray Misc,Flow get void vs scalar vs list context of current subroutine call
  288. warn I/O print debugging info
  289. write I/O print a picture record
  290. y/// String transliterate a string