diff --git a/.gitattributes b/.gitattributes index 0c9815343d162c88d42c18c83f625c957c4f4f6e..d4f8923f9f69efcf83b9f400961b3a273b414c64 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,7 +3,6 @@ *.db binary *.gif binary *.gz binary -*.ppm binary *.rs binary init_nt -text -crlf lib -text -crlf diff --git a/about_pike/.cvsignore b/about_pike/.cvsignore deleted file mode 100644 index ca049959d9fa5e87c28a9bb7d5c29e7097795037..0000000000000000000000000000000000000000 --- a/about_pike/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bar.gif diff --git a/about_pike/.gitignore b/about_pike/.gitignore deleted file mode 100644 index 997950e8656fa6c7937e6548c5b180ec23ceb585..0000000000000000000000000000000000000000 --- a/about_pike/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bar.gif diff --git a/about_pike/README b/about_pike/README deleted file mode 100644 index e8fee7ee00c2c25e5f1b97806be8e4854d1ea880..0000000000000000000000000000000000000000 --- a/about_pike/README +++ /dev/null @@ -1,17 +0,0 @@ -This directory contains some information about Pike and stuff to show -how great Pike is. - -why_pike_short is a short list of Pike-arguments -why_pike_long is a long list of Pike-arguments - -The foo.pike (where foo is something else) programs are examples of -Pike-code. Some of them can be used as programs (Maybe you have to -change the first line to the correct path) but some of them are just -code. - -foo.ppm is a picture used by the program draw_stuff.pike. - -perl_tcl_python_pike contains some code in Perl, Tcl, Python and Pike -to show the general syntax differences. - -matrix2.foo is some more examples of matrixes in Pike. diff --git a/about_pike/about_versions b/about_pike/about_versions deleted file mode 100644 index 894e1b4215d5cd0cd7acf2280b97cd2ebb012b5f..0000000000000000000000000000000000000000 --- a/about_pike/about_versions +++ /dev/null @@ -1,24 +0,0 @@ -Versions - -Pike X.Y[{a|b}Z][plW] - -X=Major number -Y=Minor number -Z=alpha/beta number -W=patch level - -Examples: -The first 0.5 beta: - Pike 0.5b1 - -A bug is found and corrected: - Pike 0.5b1pl1 - -Pike 0.5 is here! It's a very stable version without bugs... - Pike 0.5 - -An other bug is corrected (shit happens): - Pike 0.5pl1 - -The next version of Pike is released as an alpha: - Pike 0.6a1 diff --git a/about_pike/client-server.pike b/about_pike/client-server.pike deleted file mode 100644 index 59ceb7cc339e2852c28cd874a40ee6b3e0baac62..0000000000000000000000000000000000000000 --- a/about_pike/client-server.pike +++ /dev/null @@ -1,33 +0,0 @@ -RoxenRPC �r mycket imponerande och anv�nder n�tverket. H�r �r ett -exempel med en klient och en server: - -(RoxenRPC.pmod finns i roxen/server/etc/modules/) - -Server: - - #!/usr/local/bin/pike - - class bonka { - string bonk() - { - return "bank!\n"; - } - } - - int main() - { - object rpc = RoxenRPC.Server("localhost", 31414); - rpc->provide("dunk", bonka()); - return -17; - } - -Klient: - - #!/usr/local/bin/pike - - int main() - { - object rpc = RoxenRPC.Client("localhost", 31414, "dunk"); - write(rpc->bonk()); - return 0; - } diff --git a/about_pike/crypto_stuff.pike b/about_pike/crypto_stuff.pike deleted file mode 100644 index 9e47c04399e05029c694fb79bea1e23dff491863..0000000000000000000000000000000000000000 --- a/about_pike/crypto_stuff.pike +++ /dev/null @@ -1,66 +0,0 @@ -/* encrypt.pike - * - */ - -// The name of the receiver: -#define NAME "nisse" - -int main(int argc, array(string) argv) -{ - object rsa = keys.pub_to_rsa(Stdio.read_file(NAME + ".pub")); - //Reads a rsa-key from nisse.pub and converts it to a rsa-object. - - - function r = Crypto.randomness.reasonably_random()->read; - //Gets a function that kan be used for generation of random bits. - - - string iv = r(8); - //Creates a random 8-octet initvector (Just as big as a IDEA-block) - - string session_key = r(16); - //Creates a 16 octet (128-bit, key size for IDEA) seasion key. - - object cipher = Crypto.crypto(Crypto.idea_cbc() - ->set_encrypt_key(session_key) - ->set_iv(iv)); - //creates an object that crypts with IDEA in CBC-mode - - - string data = Stdio.stdin->read(0x7fffffff); - //Reads a file from Standard Input. - - if (!data) - { - werror("Read from stdin failed.\n"); - return 1; - } - - string gibberish = cipher->crypt(data) + cipher->pad(); - //Crypt the file with IDEA-CBC-crypto-object - - string encrypted_key = rsa->encrypt(session_key); - //Crypt season key with RSA. - - string data = sprintf("%s%s%s%s", iv, - iv ^ sprintf("%4c%4c", - strlen(encrypted_key), - strlen(gibberish)), - encrypted_key, - gibberish); - //Writes the crypted file with the format: - // IV (8 octets) - // IV XOR (Length of crypted saeason key and crypted data. 8 octets) - // season key, crypted with RSA - // data, crypted with season key. - - - - if (strlen(data) != Stdio.stdout->write(data)) - { - werror("Write to stdout failed.\n"); - return 1; - } - - return 0; -} diff --git a/about_pike/draw_stuff.pike b/about_pike/draw_stuff.pike deleted file mode 100755 index 615c6000a4908640f3993a841dad72fe0a427ed3..0000000000000000000000000000000000000000 --- a/about_pike/draw_stuff.pike +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/local/bin/pike - -// Information about Pike can be found at: http://pike.indonex.se - -// This program was made by hedda@idonex.se to demonstrate the Image-module -// in Pike. - -// Program cleaned up and made readable by Fredrik Hubinette - -// Some understanding of Pike or C is needed to understand this program. - -int main() -{ - // Create an empty file object for file operations - object(Stdio.File) file=Stdio.File(); - - //Check if foo.ppm exists - if(!file->open("foo.ppm", "r")) - { - // If there was an error while opening the file: - write("\nThe picture foo.ppm isn't here! Why?\n"); - return 0; - } - - //Read foo.ppm and place in an image-object - object(Image.image) image=Image.PNM.decode(file->read()); - - file->close(); // Close the file foo.ppm - - // Make another image called image2, this image has width=80 & hight=40 - // The image will be black. - object(Image.image) image2=Image.image(52, 65); - - // Set the current color to the Pike-green :) - //The color is coded (red, green, blue) - // 0 means nothing of that color-component and 255 is maximum - image2->setcolor(160, 240, 192); - - // This draws a polygone. It's of course anti-aliased! - image2->polygone( - ({ - 4.1, 50, // First x,y corner - 7, 33, // second x,y corner - 51, 2, // third... - 45, 28, - 53, 50, // The corners can also be floats.. - 9, 64 - }) - ); - - // Now we paste the image2 image onto the first image - // "image2->threshold(1,1,1)*128" creates the alpha-mask image and - // is created to be grey where the image image2 isn't black. - image->paste_mask(image2, image2->threshold(1,1,1)*128, 35, 16); - - // Open bar.gif for writing. - if(!file->open("bar.gif", "wcx")) - { - // Fail if the file already exists. - write("\nSome error while trying to write to the file bar.gif!\n" - "Maybe the file already exists.\n"); - return 0; - } - - // Save the image as a gif to the file (bar.gif) - file->write(image->togif()); - file->close(); // Close the file bar.gif - - write("\nI have greated the image foo.gif with help of bar.ppm.\n" - "This achieved by drawing a polygon and pasting" - " it over the image.\n"); - return 1; -} diff --git a/about_pike/foo.ppm b/about_pike/foo.ppm deleted file mode 100644 index c85e0932fb409d2ab08888ad09f0aa44518d3de5..0000000000000000000000000000000000000000 --- a/about_pike/foo.ppm +++ /dev/null @@ -1,5 +0,0 @@ -P5 -# CREATOR: XV Version 3.10a Rev: 12/29/94 (PNG patch 1.2 ZinO-2) -110 88 -255 -�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ӳ�����������������������������������������������������������������������������������������������������������ֲiK7?7i^s^/'/'7sK??7/i�^^}s?///7}is}_???s�������������������������������������������������������������iK??Ks_s^7/7/?}}}^KKK?s�s}}sK77?77}s?i}ssK?O}�������������������������������������������������������������}}s???Oiis^?'7'?}}KO^K?i�}si}?7??7OK_}}iK?O������������������������������������������������������������ֲ}siK?/^i_sO?'7K}}}OKK??i�}si}?77^_?is}_??K}�������������������������������������������������i����������i}iK/7^_isK7/7Ks}}^KKOKi�siss?7?'?_s}_???}�������������������������������������������������s_}Ki������}}iK77^^ssO???O}}^KOK?^�i}iO?s^'K_?K^s}_???s�������������������������������������������������s?^7/����֪s}i???^^is_77?^s}}OKKOKO�i}K/?iOKO/O}s_??K}�����������������������������������������������֪s77/�����}}_??7O_ss^7/7'K}}sO?K??O�is_'Kss?O}Os}_???}������������������������������������������������s}77'����֪ss_??7Oi}s^?77'K}i}}OKKKKO�__//^ss/OiOsi^7??i�����������������������������������������������֣s}?7/'����֪ssi??K^_ssO???/Kiss}K????^�_^'OOis'_O?ii_?7?s�����������������������������������������������֟s}7/'/}�����ss_???^_ssO77?7?iis}KKK??^�sO'}Ois'?_'?_i_?7?s�����������������������������������������������֟iK//s����֪ss_??7O_isO7//7?ssi}O????^�ss'O_iiK?^OK_i_77?}�����������������������������������������������֟s}??/�����ss_???OissK/7//Ksi_i^???7_�s7_^??__iKK__^7??}�����������������������������������������������ӟs}?'77_s�KOKis_??7Kiss?7//?Kiiii????_KK^/i_K^^K^??_sO?7?}�����������������������������������������������ӟs}////sOO__isi?7?Kiii??77??si_s???^K?//^ii^OK_KK__^7?7s����������������������������������������������ӟs}7'??}//?7^is_?7/Ksis777/7?s^OsKK}��/7_sOK^?iO?iiO7/7}��������������������������������������ӏ^iiO}��֟si?/7O}'?//iis_?7/Ois_?7//?s__i_����7^_'KOK_O^_iO777���������������������������������������}_??7K��֟}^??/O//7'O_si?7?Kii_K/'/?sii}�����'^_?K^?^7^__^?77���������������������������������������i_?7/?��֟ss?7'^//''_O}i?77Kii_K?///?sis������'/O_^?^?i/?7^__O7?/����������������������������������������_^?7/7��֟ss77/_?77^^__??7?iiiK/''_^s�������?O_?Oii_?'^__O777����������������������������������������__?7'7��ӟs}?/7_}}77?7^Oi_7?7K_si?/?����������}?isis?_?'/KKiO77/���������������������������������������_i77/��ӟ}_7//_}}/?/'^Os^???KiOiK'������������O'is__?iK?/K'_O/7/����������������������������������������i_7/'/��֣si/?'_}s7/'OOK^??/?^K_O_������������'O^__?_O//?7iK777�������������������������������Ͻ�������_i?/7s����si7/7_ss7/''??O_??7K_Oi�����s�������K____????K_?777��������������������������������iss?K���__7/O^???i}s7/'^}s7'/'KK_i777?^_}}�����^�����}^?OO^^iK??^i?//7�������������������������������^^K?'���^_7/ii?7'Oi}'7/^i_?'77KK__///K_������'?�����KiK?^?O_K?O__K'/7�����Ͻ�����������������������Ͻ_O7'���^_?/si7/'Ois'/'^i_/'?KK^/7K}������/O�^�����/^_?O?Oi?7O__K'//���ֽ���������������������������_K'���^^7'i_7'/^_s''7Kii''??K^7i�������_?s�}�����/7i^OO^i_7'^__?/7/��������������������������������^K'/���^O?/ii?'^_i'//^ii'''7^?_s�����_��?}�}����77i_i^7^?7^_i?/7/������������������������������ϽOO7/���^^?/ii?/'^ii///Ksi?s^i�����7�/}�}����_''7i_?Oss_?^^_K//7�������������������������ӽ�����^^'���O_?'^_?/'^ss/'/Ki_''?_}����7?�O�O�'�}����?'//__}O7O7^__?/7/��������������������������}}s}��^^//���__?/_i?''O^i7/?Ks_'_�������?'_�s�O�'��s����/'?_/7^_sO?___K///��������������������������s?7?s�_O'^i_^O^?'_i?'O^s/'/K_^�������O/O�^�}�_��������'/KKs}}s??__^K77/��������������������������_?77i�^^'/__?KOO?'_i?'?iO///Oii�����'_�^�}�^�������_''?'}}}K/'___O/77��������������������������i?7/i�^O'?_^/'Oi?ii7?is'K_^7���_'�?i�^��^�������/7777s??i_iK/7/��������������������������s?7?i�^O'?_^//^i?/iiK/?is7K/?K��O�O��Os�^�}��'�����??7?K___K'//�������������������ӽ�����s?//}�^K'?^O/ii?'_i?'Kis'/^?s^����K���^s�O�����'�����''7/___iO//7����Ͻ������������Ӳ^}}���s?7/}�_O'?_^/s^?is?'O^sO�}���i���O���_s��K����������^?7^7'___iK///������������������ӏ_7/_��}7'^��_O?_^/s_?'_s?'KOiK���i^���O���^s�O����������/7???77__i_K777�������������������^/'_��s?Kisi^?_O7ii7/_s??'_7���������^���i��K���������7??O??i___K77/������������������ӏ^7/^��}?OiOKiKK^K''_K7'_iOi?/_�����'����_������K�����}���}7'?^O7____K///���Ͻ�������������֏^/?_��s?Oi7?iO'?^?/i?7_i��?Oi�����'����^�������?�����}����7'?/^^_?i^__K'//���ӽ���������ӟ^_��K77_ӽi7^i??sK'?^O/_^/i?�7��/���'����^������K�����'s����_?K?7O?^'/_i^_iO//'���������������}?7?�?77^ӽ_?Os/KiKK^O''^^7O?_��?��/���/����O�������?�����/s�����KK'??K^OKis_iiO/7/���Ͻ����������}'/7�?7?��i?^i7?i^?OO'/_^/K��������'��'����O�����?�����'}�����^K_???O^Kii^_iO/77���ӽ����������}77?�O?Os}ss?^i??_?'??^/'__/��s�?s���s��7����^�_����}7�����/i�����O?OO/7?^^?ii^_iK777����������Ϗ���s?/?�^?^i7Ks?^i7K_O??O'/K^/�i^�/s7���_��/����K�_����i/�����/i������ii^777__'?ii^__O///���Ͻ������^i?�i77?�^7_i7?s?^s??iKK?O7KO�'i�'���KO��/����^�?����7�����7^������7�s7??^_/?ii^__O///��」������^7'�i77K�^7^i?Ks7^s/?iOKOO'/_K�?�}K��O���_?��/����OK�����/�����?^������O^K?^K7^^'?ii___O77/�����������O?'�_?O�s_?^i7Oi?^s7?i^?_O''ii�^��K�����/��/����^�����'�����KO�������Oi?K7^O'?ii_i_O77/����O����}�O7/�_7^KOO?^_?Oi/^s7KiO'?K^i}�}}��_���i�����'����_?/����������KO�������sO?7?O'?i_i__O?7/���?��_OOi_?7�^/^K^^?__?^O7_s??i??O^'/_����}���^����/����^�����������OK�������}s_7/7O7ii___O777����/K_?7^^77�i/_KO^7__7O_/_s7?iO?^K?^��������K�}�7��'����_�����������iK��������}i?'?/^/ii___O777���i_^O??^^?i?_?^O7_i?^_/_i??i??^??O���}������?�i�O������_����������iK��������}s^?//^/isi_O^//'����i^K_??^_K_^K?iK^O7i^?^^7^_??_?7_O'?}���}�����?�_�_��/����_���_��������s7���������^K?K7is___^/7/����/7_?7_^K_K^?i?^_7iO7^^/^_/?OK?_K/����}�}����?�^�i}�����s���?��������}'���������K}s/?/ii___^/7/���/?/^?K_^K_K_7_?^O/sO7_^/^i/?_K?KK7����}�s����?�^�^�����s��O}�������'���������i_^7O/ii___O??/����7?'^?�OO_KO?_?O_7ii7_^7_i7?sOKiKK����}�i����K�^��K�'���_����}������������������i}_K/iii__^?77���7?'_O^iO^_K_?_K^_?i_7^_/_i7KiKKKKi����}�s����?�_��?�'���_}���������O���������_iOK/s_i_i^7?/����?K'__O_^^_?s7_K^_7i_7O^7_s/?_KK_?������s����O�_��'�/���i�}���}�������'���������isO'7i^_i_^777����?i�__O_O^^Ki/_?__?i_7iO/i_/?s?7_K����������^�^s'�'���^�}�}��'�����?����������/s_i_i_7?/���?^}_^OiO^^O_/_K^_7i_/i^/_^'K}??_??�����������_�^�/���O���_}��s���_����������?'/ssi_i_??7����K^_^_OsK_OO_7i?_i/i_7iOii?KKO_?�����������}sO��/�/���?�i�}i�'7}�����s����������/O'/ssi__i??7����K^^^_OiKOOO_7_?_i's_/s^ii?i??s?��������i������K�7���'�i���������}��������?'/sii^__??/����?_O__OsK^^^i?_7i^/s_/iKii/Oi??s?��������O��_�����_�/���i?����������}^������?'''sis^_^?7/����?OO^_^s?_^^__?i_7s^'}Oi_?i?Ks7?������?��?�����s�?O/s^�������������i���i^/7'ssiO__7?7���?i^O_OsO_^?s/^?i_/s^'}K_^'?i??i??������K��'�s���s?K7������������������7_//iii^i_??/���?i^O_OsK^Kis/_?i_'}^sOsOKsKOi?Ks�����is^^�i���'��_���������������O}7K7'ssi_ii??7����?i^OsOi?^Kii7i7i^'O}Kii^i7?}??O����}����?s������/����������}_?//KK/7ssiiiiK?7���?i^KsOsKsKsi7^7_^O'}Ksi?}7O^?KK����}��'/��K�������s�������/??^O//sis_ii??/���Ks_OsOsKs?i_7i7_^^_K}i/?s?K_KK_s���i��������������}����_7/'/'�7K__77ssiii_77'���?siKiO}?}?_i7i/_^O'}?siOs?Oi?KiK��s'���������������s�i7????/�KOi_K7isiii_77/���Oi_?sOs??i_?i/i^'}K/}?_Os?Ks?OiO��?s��������������sO^O^?�O^i^O/iisii_^K/���O__KsKs7?_^/i'i^O'?iKs?^i7O_O?�����}�������_O____7^_sO?/ss___i7?7���}_^iKs?i/�/i^/s'_O'O/?_'^s?Oi?OiO�����s����s'///_ii_?s_isO?'ssi^^^7?'���}O_iOiKs'�/i^7i's^�??}?i^_?O_7^^O}������i7?77iii_??iiiK?/sis_^_?7'���sO__?s?s�'sO?s}O'O7?i'^i??i?_K?���i/''???7_ss_K?ii_O?''ssii_i??'���i_^^?_?}/�}O?s}O/O?}7�_'^s7^s?OsOi??/'''?OO?ssi_?Ki_sK?/sssiis^K7���i_Ki?_?s�'sK?s}O'�O?}7�_'_i/__?OsO_????K/7'OO_?sss_??i_ii?/sssiss_O7���i_O_?s?s/��K?iO�K?}7_/_i7_i7Os?iO77OOK???//OO_Kss}_KOsi_i?/sssiss^O?���iiKi?s7s/�}K?i^�OK}/'_'^_7__7^OK'_K?/K'_O^O7??/OKiO}s}KOKssii7/s}sissOK/���ii?s?s?}7�}??iO'�OK}7i'_i?i_7^^^_i?/K'i?OO??7/^?i^sss??Kssii7''ss}iisO?/���i}K_?iK}/�??s^�KK/'�_/_^?^_''^_?'_iK??/i?i??K?_^_^}ss^K?�isi//}_}is}O?���_s?^?i?^/7?^}???}'}^'__'?^/K^?^_?7^/_O^O?77__i^sssO?K�ssi/'}_}i_}O?7��������������������������������������������������������������������������������������������������������������� \ No newline at end of file diff --git a/about_pike/mail_stuff.pike b/about_pike/mail_stuff.pike deleted file mode 100644 index db57ff82fda00c7feefd069a5a23057468080a5c..0000000000000000000000000000000000000000 --- a/about_pike/mail_stuff.pike +++ /dev/null @@ -1,35 +0,0 @@ -//And here is some stuff about mailing... -//Maybe take a look in the manual :-) - - -void mailit(string file, string subject, array (string) list) -{ - foreach(list, string email) - Process.popen("mail -n -s '"+subject+"' "+email+" < "+file); -} - -//or... - -void mailit(string file, string subject, array (string) list) -{ - foreach(list, string victim) - { - string command = "mail -n -s '"+subject+"' "+email+" < "+file; - write(command+"\n"); - Process.popen(command); - } -} - - -//or... - -import Process; -void mailit(string file, string subject, array (string) list) -{ - string command; - foreach(list, string victim) - { - write((command = "mail -n -s '"+subject+"' "+email+" < "+file)+"\n"); - write(popen(command)); // show the output of the command - } -} diff --git a/about_pike/matrix2.foo b/about_pike/matrix2.foo deleted file mode 100644 index 7586868152cf0f3fee1eacc97c19e4bfae5f14d2..0000000000000000000000000000000000000000 --- a/about_pike/matrix2.foo +++ /dev/null @@ -1,43 +0,0 @@ -import Array; -#define matrix array(array(int|float|object)) - -matrix mmult(matrix m1, matrix m2) -{ - int m2rows=sizeof(m2), m2cols=sizeof(m2[0]); - int m1rows=sizeof(m1), m1cols=sizeof(m1[0]); - - if((m1cols!=m2rows)||(m2cols!=m1rows)) return 0; - - matrix res=map(allocate(m1rows), - lambda(int c, int r) { return allocate(r); }, m2cols); - - for(int i; i<m1rows; i++) - for(int j; j<m2cols; j++) - res[i][j]=`+(@ Array.sum_arrays(`*, m1[i], column(m2, j))); - return res; -} - -// Using map cols indices etc. more extensively - -matrix mmult(matrix m1, matrix m2) -{ - int m2rows=sizeof(m2), m2cols=sizeof(m2[0]); - int m1rows=sizeof(m1), m1cols=sizeof(m1[0]); - - if((m1cols!=m2rows)||(m2cols!=m1rows)) return 0; - - return map(indices(allocate(m1rows)), - lambda(int r, int c, array m1, array m2) { - return map(indices(allocate(c)), - lambda(int i, int j, array m1, array m2) { - return `+(@Array.sum_arrays(`*,m1[i],column(m2,j))); - }, r, m1, m2); - },m2cols,m1,m2); -} - - -// With matrix objects - -#define matrix object(Matrix)|array(array(int|float|object)) - -matrix mmult(matrix m1, matrix m2) { return m1 * m2; } diff --git a/about_pike/perl_tcl_python_pike b/about_pike/perl_tcl_python_pike deleted file mode 100644 index 20514d37f24cf3787f16787ce21b6a61cde53bf4..0000000000000000000000000000000000000000 --- a/about_pike/perl_tcl_python_pike +++ /dev/null @@ -1,36 +0,0 @@ -This file is just here to give an example of how Pike-code look. It's -not a try to show how great Pike is or an example of how Pike should -be coded. - -If you want to compare with Perl, Tcl och Python have a look at: -http://www.unixworld.com/unixworld/archives/95/tutorial/005.html#Others - -Here is a Pike-function that multiplies two matrixes: - -(Note: This is best done in Pike using matrix objects with a -`*-method. This is just made for comparison with the examples in the -URL.) - -#define matrix array(array(int|float|object)) -matrix mmult(matrix m1, matrix m2) -{ - int m2rows=sizeof(m2), m2cols=sizeof(m2[0]); - int m1rows=sizeof(m1), m1cols=sizeof(m1[0]); - if ((m1cols!=m2rows)||(m2cols!=m1rows)) - return 0; - matrix res=allocate(m1rows); - for(int i; i<m1rows; i++) - res[i]=allocate(m2cols); - - for(int i; i<m1rows; i++) - for(int j; j<m2cols; j++) - res[i][j]=`+(@ Array.sum_arrays(`*, m1[i], column(m2, j))); - return res; -} - - - - -// -och the Pike-part is written by Henrik "Hedda" Wallin, Idonex. - \ No newline at end of file diff --git a/about_pike/why_pike_long b/about_pike/why_pike_long deleted file mode 100644 index 44d07a5b2834de9bc3e20e0812b7d50d79bb6264..0000000000000000000000000000000000000000 --- a/about_pike/why_pike_long +++ /dev/null @@ -1,139 +0,0 @@ -PIKE 0.5 - a longer lists of arguments - -/* -Learn about Pike, the language that lies among the reeds, just waiting -to use its big jaws to swallow both problems and problem solvers, and -thus staying at the top of the food chain. -*/ - -o Pike is an easy programming language to learn. Just as easily Pike lets you - develop powerful applications. Pike is designed to be used. - -o Although Pike is a scripting language it is designed to generate - very fast code. - -o Pike is readable *and* looks like C. - -o If you write large applications, you can write your own Pike-modules - in C, and this makes the code both more transparent and faster. - -Arguments for the Pike language: - + General Purpose Programming Language - + Free! It's not just free to use it. You may also modify the - code and use it. See more details at http://pike.idonex.se/GPL.html - + A nice up-to-date manual on the web - + Makes it possible to write multithreaded programs. - + Easy to write programs that listen to ports and other networking - Functions. - + Source Code Available - To promote use and sharing of useful code - + Portable- Platform independent available on most flavors of Unix - + C-like Syntax - Easy to learn - + Powerful - High-level language, short code - + Object Oriented - easy to use and allows multiple - developer cooperation - + Modular - Extendible with modules e.g. written in C - + Interpreted, which mean no long compiling and linking time. - Just program and run! And there will be no core dumbs... - + Iterative language - + Incremental - allows on-the-fly modifications and recompilations - + Powerful Data Types that are well-scaling - + Automatic Memory Management - + Scalable - as useful for small scripts as for powerful - and complex applications. - + Text Processing - e.g. for filters - + Exception Handling - + The lovely green color of its home page. - + Optimized, Faster than Perl, Python (and Java) - + Faster development than C, C++ - - - No Pike compiler or debugger - - Limited image format import options - - Not optimal for heavy numeric processing jobs - - Not for GUI based applications - - Few special effect image filters - - Not tried for embedded product applications. Why don't you be - the first one! - -Applications that have been made with Pike - + Network Applications - Client/Server applications, - e.g. the Roxen Challenger Web-server and the Jukebox - + System Administration Tools & Utilities - even as quick one-shots - + Possible to use for CGI programming - + Real-time client-server status monitor - + Custom mail gateways - + adduser or adddomain scripts that setup users/domains - + implementations of client-server protocols - + (complex) string / parsing operations. - + MUDs - - -Arguments for some of the Pike modules: - -IMAGE - Image Processing Tool - -Image processing, for filters, cut & paste and text rendering. -Input formats: ppm -Output formats: ppm, gif - -This package is fast, easy to use and have anti-aliasing on many -functions. It also makes it possible to write text with various fonts -in your images. - - -DB API - Database Application Programming Interface - -Makes it possible to use SQL-databases in your Pike-application. - - -MIME - Multimedia Internet Mail Extension - -To pack and unpack mails bundled and easy to use. - - -CRYPTO - Cryptographic toolkit - -Enables easy development of secure applications. - - -Regexp - A module for Regular Expression - -A regular expression is a standardized way to make pattern that match -certain strings. In Pike you can often use the sscanf, range and index -operators to match strings, but sometimes a regexp is both faster and -easier. - - -Gz - compressing files - -Note: This module is not compatible with gzip, but it will be in the -future. - - -Getopt - find command line options - -Makes it easier to parse command line options. - - -Gmp - very large numbers - -This makes it possible to use as big integers as you have memory. - - -Yp - an interface to the Yellow Pages functions. - -YP is most commonly used to distribute passwords and similar -information within a network - - -Foo - The module that you are about to write - -It will be able to show a 45 inch window on a 14 inch screen, It will -work as a combined communications satellite and Wunderbaum. It has to -be able to cure deadly diseases and make your teeth whiter while you -sleep. And it shall travel through time! And it will have a telepathic -user interface! -*Tock* *Spoff* -Or it might just as well be made to show some fishes on your screen. - - - diff --git a/about_pike/why_pike_short b/about_pike/why_pike_short deleted file mode 100644 index 34db43dc0aa82ccd1701c0c1ef7b034ce79334b6..0000000000000000000000000000000000000000 --- a/about_pike/why_pike_short +++ /dev/null @@ -1,59 +0,0 @@ -Pike - why it's here and why it's gonna save the world - -The philosophy behind Pike is to create an environment for programming -that makes it easy and fast to create powerful applications. To -accomplish this the language is made to be easy extendible with -modules. This has resulted in many powerful modules included in this -package and many more that are made but not yet have reached the -stability that is necessary. - -This is the main arguments for Pike: - -1) It's free! (GPL-license) - -You and the ones that use your software never have to bother with -paying for using Pike. The greatest think about this is that many -hackers around the world will have access to Pike and therefore the -language will never stop to evolve. - -2) C-like syntax. - -If you already know C, it will not take long to learn Pike. The only -thing that you have to learn is that everything is easier in Pike :-) - -3) Powerful data-types and object oriented - -When creating database or parsing applications powerful data-types like -mappings, objects and even run-able Pike-programs will make you -addicted to Pike. These data types are embedded in an environment with -functions often found in various C-libs, but in Pike there are no -pointers to obscure structs or 10 Mbyte core-dumps on your disc. - -4) Extendible - -It's fairly easy to extend Pike and write your own module. These -modules are can be written i C to make them as fast as possible. This -often has the effect that when a Pike-programmer has a wonderful -module she/he shares it with the rest of the Pike-programmers and -therefore the next-coming Pike applications will be smaller and more -powerful. - -5) Gives you short and readable code - -Thanks to the magic functions, the data-types and all the modules a -Pike program becomes shorter and therefore quicker to write, easier to -debug and maintain. - - -The drawbacks of Pike - --1) No official GUI-module so far. - --2) Not very fast for programs that can't take advantage of powerful -Pike functions. However, most Pike-programs spend most of their time -in these very optimized functions and are therefore often faster or -just as fast as pure C-programs. - --3) No Pike debugger. - -In this directory there are also some example Pike-programs. \ No newline at end of file diff --git a/doc/README b/doc/README deleted file mode 100644 index f953325137a3789d412e34f61427ef9fe3964285..0000000000000000000000000000000000000000 --- a/doc/README +++ /dev/null @@ -1,4 +0,0 @@ -The documentation is not finished. -Read the source for more information. -If everything else fails, mail hubbe@lysator.liu.se. - /Hubbe diff --git a/doc/builtin/_memory_usage b/doc/builtin/_memory_usage deleted file mode 100644 index d40eb95e5ca743477f173c6e76dbdc95001948b7..0000000000000000000000000000000000000000 --- a/doc/builtin/_memory_usage +++ /dev/null @@ -1,14 +0,0 @@ -NAME - _memory_usage - check memory usage - -SYNTAX - mapping(string:int) _memory_usage(); - -DESCRIPTION - This function is mostly intended for debugging. It delivers a mapping - with information about how many arrays/mappings/strings etc. there - are currently allocated and how much memory they use. Try evaluating - the function in hilfe to see precisly what it returns. - -SEE ALSO - _verify_internals diff --git a/doc/builtin/_next b/doc/builtin/_next deleted file mode 100644 index 3f9465795d29b63d70c28a870458a8d760bc3dad..0000000000000000000000000000000000000000 --- a/doc/builtin/_next +++ /dev/null @@ -1,14 +0,0 @@ -NAME - _next - find the next object/array/whatever - -SYNTAX - mixed _next(mixed p); - -DESCRIPTION - This function returns the 'next' object/array/mapping/string/etc - in the linked list. It is mainly meant for debugging Pike but - can also be used to control memory usage. - -SEE ALSO - next_object, _prev - \ No newline at end of file diff --git a/doc/builtin/_prev b/doc/builtin/_prev deleted file mode 100644 index f39d649dd17b576535325fe6071c73766caa605e..0000000000000000000000000000000000000000 --- a/doc/builtin/_prev +++ /dev/null @@ -1,14 +0,0 @@ -NAME - _prev - find the previous object/array/whatever - -SYNTAX - mixed _next(mixed p); - -DESCRIPTION - This function returns the 'previous' object/array/mapping/etc - in the linked list. It is mainly meant for debugging Pike but - can also be used to control memory usage. Note that this function - does not work on strings. - -SEE ALSO - _next diff --git a/doc/builtin/_verify_internals b/doc/builtin/_verify_internals deleted file mode 100644 index 0ace05f0d7621fb8e54eba1e2c0e331f6a565f68..0000000000000000000000000000000000000000 --- a/doc/builtin/_verify_internals +++ /dev/null @@ -1,13 +0,0 @@ -NAME - _verify_internals - check Pike internals - -SYNTAX - void _verify_internals(); - -DESCRIPTION - This function goes through most of the internal Pike structures and - generates a fatal error if one of them is found to be out of order. - It is only used for debugging. - -KEYWORDS - debugging diff --git a/doc/builtin/add_constant b/doc/builtin/add_constant deleted file mode 100644 index a899245e570757b5bb0e23eefb376fc97daea9a6..0000000000000000000000000000000000000000 --- a/doc/builtin/add_constant +++ /dev/null @@ -1,28 +0,0 @@ -NAME - add_constant - add new predefined functions or constants - -SYNTAX - void add_constant(string name, mixed value); - or - void add_constant(string name); - -DESCRIPTION - This function adds a new constant to Pike, it is often used to - add builin functions (efuns). All programs compiled after add_constant - function is called can access 'value' by the name given by 'name'. - If there is a constant called 'name' already, it will be replaced by - by the new definition. This will not affect already compiled programs. - - Calling add_constant without a value will remove that name from the list - of of constant. As with replacing, this will not affect already compiled - programs. - -EXAMPLES - add_constant("true",1); - add_constant("false",0); - add_constant("PI",4.0); - add_constant("sqr",lambda(mixed x) { return x * x; }); - add_constant("add_constant"); - -SEE ALSO - all_constants \ No newline at end of file diff --git a/doc/builtin/aggregage_multiset b/doc/builtin/aggregage_multiset deleted file mode 100644 index b00f928bb32159b0957585741a6058ceee3f34f2..0000000000000000000000000000000000000000 --- a/doc/builtin/aggregage_multiset +++ /dev/null @@ -1,23 +0,0 @@ -NAME - aggregate_multiset - construct a multiset - -SYNTAX - multiset aggregate_multiset(mixed ... elems); - or - (< elem1, elem2, ... >) - -DESCRIPTION - Construct an multiset with the arguments as indexes. This function - could be written in Pike as: - - multiset aggregate(mixed ... elems) { return mkmultiset(elems); } - - The only problem is that mkmultiset is implemented using - aggregage_multiset... - -KEYWORDS - multiset - -SEE ALSO - sizeof, multisetp, mkmultiset - diff --git a/doc/builtin/aggregate b/doc/builtin/aggregate deleted file mode 100644 index 9177fdf2ea14f079588a16782a35ee95d249efec..0000000000000000000000000000000000000000 --- a/doc/builtin/aggregate +++ /dev/null @@ -1,24 +0,0 @@ -NAME - aggregate - construct an array - -SYNTAX - mixed *aggregate(mixed ... elems); - or - ({ elem1, elem2, ... }) - -DESCRIPTION - Construct an array with the arguments as indices. This function - could be written in Pike as: - - mixed *aggregate(mixed ... elems) { return elems; } - -NOTA BENE - Arrays are dynamically allocated there is no need to declare them - like int a[10]=allocate(10); (and it isn't possible either) like - in C, just int *a=allocate(10); will do. - -KEYWORDS - array - -SEE ALSO - sizeof, arrayp, allocate diff --git a/doc/builtin/aggregate_mapping b/doc/builtin/aggregate_mapping deleted file mode 100644 index d98dd260aad91c46c611af3e7554a9983faff091..0000000000000000000000000000000000000000 --- a/doc/builtin/aggregate_mapping +++ /dev/null @@ -1,18 +0,0 @@ -NAME - aggregate_mapping - construct a mapping - -SYNTAX - mapping aggregate_mapping(mixed ... elems); - or - ([ key1:val1, key2:val2, ... ]) - -DESCRIPTION - Groups the arguments together two and two to key-index pairs and - creates a mapping of those pairs. The second syntax is always - preferable. - -KEYWORDS - mapping - -SEE ALSO - sizeof, mappingp, mkmapping diff --git a/doc/builtin/alarm b/doc/builtin/alarm deleted file mode 100644 index 233098d62e2e88c026bc71d2edbe7940e9ea07eb..0000000000000000000000000000000000000000 --- a/doc/builtin/alarm +++ /dev/null @@ -1,21 +0,0 @@ -NAME - alarm - set an alarm clock for delivery of a signal - -SYNTAX - int alarm(int seconds); - -DESCRIPTION - alarm arranges for a SIGALRM signal to be delivered to the - process in seconds seconds. - - If seconds is zero, no new alarm is scheduled. - - In any event any previously set alarm is cancelled. - -RETURN VALUE - alarm returns the number of seconds remaining until any - previously scheduled alarm was due to be delivered, or - zero if there was no previously scheduled alarm. - -SEE ALSO - signal diff --git a/doc/builtin/all_constants b/doc/builtin/all_constants deleted file mode 100644 index 3b23672fa642bdbbea41572208f023df5224ec8a..0000000000000000000000000000000000000000 --- a/doc/builtin/all_constants +++ /dev/null @@ -1,12 +0,0 @@ -NAME - all_constants - return all predefined constants - -SYNTAX - mapping (string:mixed) all_constant(); - -DESCRIPTION - Return a mapping containing all constants, indexed on the names of the - constant, and with the value of the efun as argument. - -SEE ALSO - add_constant diff --git a/doc/builtin/allocate b/doc/builtin/allocate deleted file mode 100644 index 90ed148de5e920466efbab4cd726a3dbd9411468..0000000000000000000000000000000000000000 --- a/doc/builtin/allocate +++ /dev/null @@ -1,22 +0,0 @@ -NAME - allocate - allocate an array - -SYNTAX - mixed *allocate(int size); - -DESCRIPTION - Allocate an array of size elements and initialize them to zero. - -EXAMPLES - mixed *a=allocate(17); - -NOTA BENE - Arrays are dynamically allocated there is no need to declare them - like int a[10]=allocate(10); (and it isn't possible either) like - in C, just int *a=allocate(10); will do. - -KEYWORDS - array - -SEE ALSO - sizeof, aggregate, arrayp diff --git a/doc/builtin/arrayp b/doc/builtin/arrayp deleted file mode 100644 index 8f52f20bea98a9fe65b2f4e6b312e732c1d3d104..0000000000000000000000000000000000000000 --- a/doc/builtin/arrayp +++ /dev/null @@ -1,15 +0,0 @@ -NAME - arrayp - is the argument an array? - -SYNTAX - int arrayp(mixed arg); - -DESCRIPTION - Returns 1 if arg is an array, zero otherwise. - -KEYWORDS - array - -SEE ALSO - allocate, intp, programp, floatp, stringp, objectp, mappingp, - multisetp, functionp diff --git a/doc/builtin/backtrace b/doc/builtin/backtrace deleted file mode 100644 index b82191e833efeeb9d8e102b30d3b9f9e7a493403..0000000000000000000000000000000000000000 --- a/doc/builtin/backtrace +++ /dev/null @@ -1,22 +0,0 @@ -NAME - backtrace - get a description of the call stack - -SYNTAX - mixed *backtrace(); - -DESCRIPTION - This function returns a description of the call stack at this moment. - The description is returned in an array with one entry for each call - in the stack. Each entry has this format: - - ({ - file, /* a string with the filename if known, else zero */ - line, /* an integer containing the line if known, else zero */ - function, /* The function-pointer to the called function */ - }) - - The current call frame will be last in the array, and the one above - that the last but one and so on. - -SEE ALSO - catch, throw diff --git a/doc/builtin/call_function b/doc/builtin/call_function deleted file mode 100644 index 0af1d5b98a3321d77fe1c4660c451505bf354a96..0000000000000000000000000000000000000000 --- a/doc/builtin/call_function +++ /dev/null @@ -1,19 +0,0 @@ -NAME - call_function - call a function with arguments - -SYNTAX - mixed call_function(function fun,mixed ... args); - or - mixed fun ( mixed ... args ); - -DESCRIPTION - This function takes a a function pointer as first argument and calls - this function with the rest of the arguments as arguments. Normally, - you will never have to write call_function(), because you will use the - second syntax instead. - -KEYWORDS - function - -SEE ALSO - backtrace, get_function diff --git a/doc/builtin/clone b/doc/builtin/clone deleted file mode 100644 index a7753df11ea123bb35fef536022a3d6cbaea225b..0000000000000000000000000000000000000000 --- a/doc/builtin/clone +++ /dev/null @@ -1,17 +0,0 @@ -NAME - clone - clone an object from a program - -SYNTAX - object clone(program p,mixed ... args); - -DESCRIPTION - clone() creates an object from the program p. Or in C++ terms: - It creates an instance of the class p. This clone will first have - all global variables initalized, and then create() will be called - with args as arguments. - -KEYWORDS - object, program - -SEE ALSO - destruct, compile_string, compile_file diff --git a/doc/builtin/column b/doc/builtin/column deleted file mode 100644 index 5beb87cc9856705184400a03ea483a4ac8d36c11..0000000000000000000000000000000000000000 --- a/doc/builtin/column +++ /dev/null @@ -1,20 +0,0 @@ -NAME - column - extract a column - -SYNTAX - array column(mixed *data,mixed index) - -DESCRIPTION - This function is exactly equivialent to: - - map_array(index,lambda(mixed x,mixed y) { return x[y]; },data) - - Except of course it is a lot shorter and faster. - That is, it indexes every index in the array data on the value of - the argument index and returns an array with the results. - -KEYWORDS - array - -SEE ALSO - rows diff --git a/doc/builtin/combine_path b/doc/builtin/combine_path deleted file mode 100644 index 49043c3c7a45d64ad7bd119c3c3c074d4f70275c..0000000000000000000000000000000000000000 --- a/doc/builtin/combine_path +++ /dev/null @@ -1,24 +0,0 @@ -NAME - combine_path - concatenate paths - -SYNTAX - string combine_path(string absolute, string relative); - -DESCRIPTION - Concatenate a relative path to an absolute path and remove any - "//", "/.." or "/." to produce a straightforward absolute path - as a result. - -EXAMPLES - > combine_path("/foo/bar/",".."); - Result: /foo - > combine_path("/foo/bar/","../apa.c"); - Result: /foo/apa.c - > combine_path("/foo/bar","./sune.c"); - Result: /foo/bar/sune.c - -KEYWORDS - file - -SEE ALSO - getcwd diff --git a/doc/builtin/compile_file b/doc/builtin/compile_file deleted file mode 100644 index eac5814db1f3d5a373487d57d7237fc1f49e8e29..0000000000000000000000000000000000000000 --- a/doc/builtin/compile_file +++ /dev/null @@ -1,15 +0,0 @@ -NAME - compile_file - compile a file to a program - -SYNTAX - program compile_file(string filename); - -DESCRIPTION - This function will compile the filename to an Pike program that can - later be used for cloning. - -KEYWORDS - program - -SEE ALSO - clone, compile_string diff --git a/doc/builtin/compile_string b/doc/builtin/compile_string deleted file mode 100644 index e868132378eb873be0685dde37b8025773223d6d..0000000000000000000000000000000000000000 --- a/doc/builtin/compile_string +++ /dev/null @@ -1,17 +0,0 @@ -NAME - compile_string - compile a string to a program - -SYNTAX - program compile_string(string prog, string name); - -DESCRIPTION - Compile_string takes a complete Pike program as an argument in a the - string prog and compiles it to clonable program. The second argument - will be used as the file name of the program and will be used for - error messages and such. - -KEYWORDS - program - -SEE ALSO - compile_string, clone diff --git a/doc/builtin/copy_value b/doc/builtin/copy_value deleted file mode 100644 index 9add80c8075fe832d6615afb46416f2588904f4d..0000000000000000000000000000000000000000 --- a/doc/builtin/copy_value +++ /dev/null @@ -1,15 +0,0 @@ -NAME - copy_value - copy a value recursively - -SYNTAX - mixed copy_value(mixed value); - -DESCRIPTION - Copy value will copy the value given to it recursively. If the result - value is changed destructively (only possible for multisets, arrays and - mappings) the copied value will not be changed. The resulting value - will always be equal to the copied (tested with the efun equal), but - they may not the the same value. (tested with ==) - -SEE ALSO - equal diff --git a/doc/builtin/crypt b/doc/builtin/crypt deleted file mode 100644 index 8add8594933781dec429aae95c9fa91fca4632e6..0000000000000000000000000000000000000000 --- a/doc/builtin/crypt +++ /dev/null @@ -1,25 +0,0 @@ -NAME - crypt - crypt a password - -SYNTAX - string crypt(string password); - or - int crypt(string typed_password, string crypted_password); - -DESCRIPTION - This function crypts and verifies a short string. (normally only - the first 8 characters are significant) The first syntax crypts - the string password into something that is hopefully hard to decrypt, - and the second function crypts the first string and verifies that the - crypted result matches the second argument and returns 1 if they - matched, 0 otherwise. - -EXAMPLES - To crypt a password use: - crypted_password = crypt(typed_password); - To see if the same password was used again use: - matched = crypt(typed_password, crypted_password); - - -KEYWORDS - string diff --git a/doc/builtin/ctime b/doc/builtin/ctime deleted file mode 100644 index 03f551ccf20dc902d0f340cb3fa0fe0a3ff16114..0000000000000000000000000000000000000000 --- a/doc/builtin/ctime +++ /dev/null @@ -1,16 +0,0 @@ -NAME - ctime - convert time int to readable date string - -SYNTAX - string ctime(int current_time); - -DESCRIPTION - Convert the output from a previous call to time() into a readable - string containing the currnent year, month, day and time. - -EXAMPLE - > ctime(time()); - Result: Wed Jan 14 03:36:08 1970 - -SEE ALSO - time diff --git a/doc/builtin/destruct b/doc/builtin/destruct deleted file mode 100644 index 22b2bfefc41cd3346501b205932206272d58912b..0000000000000000000000000000000000000000 --- a/doc/builtin/destruct +++ /dev/null @@ -1,17 +0,0 @@ -NAME - destruct - destruct an object - -SYNTAX - void destruct(object o); - -DESCRIPTION - Destruct marks an object as destructed, all pointers and function - pointers to this object will become zero. The destructed object will - be freed from memory as soon as possible. This will also call - o->destroy. - -KEYWORDS - object - -SEE ALSO - clone diff --git a/doc/builtin/equal b/doc/builtin/equal deleted file mode 100644 index 4b24bab3b09e6f6cea52a590ddd20d1677097f0f..0000000000000000000000000000000000000000 --- a/doc/builtin/equal +++ /dev/null @@ -1,22 +0,0 @@ -NAME - equal - check if two values are equal or not - -SYNTAX - int equal(mixed a, mixed b); - -DESCRIPTION - This function checks if the values a and b are equal. For all types but - arrays, multisets and mappings, this operation is the same as doing a == b. - For arrays, mappings and multisets however, their contents are checked - recursively, and if all their contents are the same and in the same - place, they are considered equal. - -EXAMPLES - > ({ 1 }) == ({ 1 }); - Result: 0 - > equal( ({ 1 }), ({ 1 }) ); - Result: 1 - > - -SEE ALSO - copy_value diff --git a/doc/builtin/exit b/doc/builtin/exit deleted file mode 100644 index aa65252461f421e30021b03bc51d41561aaa2805..0000000000000000000000000000000000000000 --- a/doc/builtin/exit +++ /dev/null @@ -1,11 +0,0 @@ -NAME - exit - exit Pike interpreter - -SYNTAX - void exit(int returncode); - -DESCRIPTION - This function exits the whole 'pike' program with the return code - given. Using exit() with any other value than 0 indicates that - something went wrong during execution. See your system manuals for - more information about return codes. diff --git a/doc/builtin/floatp b/doc/builtin/floatp deleted file mode 100644 index a7f68dcf7beb606386c41af718eb2daf1eb76400..0000000000000000000000000000000000000000 --- a/doc/builtin/floatp +++ /dev/null @@ -1,15 +0,0 @@ -NAME - floatp - is the argument an float? - -SYNTAX - int floatp(mixed arg); - -DESCRIPTION - Returns 1 if arg is a float, zero otherwise. - -KEYWORDS - float - -SEE ALSO - intp, programp, arrayp, stringp, objectp, - mappingp, multisetp, functionp diff --git a/doc/builtin/function_name b/doc/builtin/function_name deleted file mode 100644 index e83c7a1ce825b7601186d7a16a4ce33c41a875b8..0000000000000000000000000000000000000000 --- a/doc/builtin/function_name +++ /dev/null @@ -1,15 +0,0 @@ -NAME - function_name - return the name of a function, if known - -SYNTAX - string function_name(function f); - -DESCRIPTION - This function returns the name of the function f. If the function is - a pre-defined function in the driver, zero will be returned. - -KEYWORDS - function - -SEE ALSO - function_object, get_function diff --git a/doc/builtin/function_object b/doc/builtin/function_object deleted file mode 100644 index 30e9a84735198a615ea7d7b954bbe58fd77e4992..0000000000000000000000000000000000000000 --- a/doc/builtin/function_object +++ /dev/null @@ -1,16 +0,0 @@ -NAME - function_object - return what object a function is in - -SYNTAX - object function_object(function f); - -DESCRIPTION - Function_object will return the object the function f is in. If the - function is a predefined function from the driver, zero will be - returned. - -KEYWORDS - function - -SEE ALSO - function_name, get_function diff --git a/doc/builtin/functionp b/doc/builtin/functionp deleted file mode 100644 index 8bd816f7e6a6275b6f88aa51844b5c06152bbd34..0000000000000000000000000000000000000000 --- a/doc/builtin/functionp +++ /dev/null @@ -1,15 +0,0 @@ -NAME - functionp - is the argument an function? - -SYNTAX - int functionp(mixed arg); - -DESCRIPTION - Returns 1 if arg is a function, zero otherwise. - -KEYWORDS - function - -SEE ALSO - intp, programp, arrayp, stringp, objectp, - mappingp, multisetp, floatp diff --git a/doc/builtin/gc b/doc/builtin/gc deleted file mode 100644 index fba644107b93ab614dbfdf60a79dee2b013bba29..0000000000000000000000000000000000000000 --- a/doc/builtin/gc +++ /dev/null @@ -1,17 +0,0 @@ -NAME - gc - do garbage collection - -SYNTAX - int gc(); - -DESCRIPTION - This function checks all the memory for cyclic structures such - as arrays containing themselves and frees them if approperiate. - It also frees up destructed objects. It then returns how many - arrays/objects/programs/etc. it managed to free by doing this. - - Normally there is no need to call this function since Pike will - call it by itself every now and then. (Pike will try to predict - when 20% of all arrays/object/programs in memory is 'garbage' - and call this routine then.) - diff --git a/doc/builtin/getpid b/doc/builtin/getpid deleted file mode 100644 index 6510e175c8efc8f7ed1a88e44eedf682ccda61dd..0000000000000000000000000000000000000000 --- a/doc/builtin/getpid +++ /dev/null @@ -1,12 +0,0 @@ -NAME - getpid - get the process id of this process - -SYNTAX - int getpid(); - -DESCRIPTION - This returns the pid of this process. Useful for sending - signals to yourself. - -SEE ALSO - kill, fork, signal diff --git a/doc/builtin/glob b/doc/builtin/glob deleted file mode 100644 index a820278ff3ee4e737be4b0934a8af67f2563c89f..0000000000000000000000000000000000000000 --- a/doc/builtin/glob +++ /dev/null @@ -1,17 +0,0 @@ -NAME - glob - match strings against globs - -SYNTAX - int glob(string glob, string str); - or - string *glob(string glob, string *arr); - -DESCRIPTION - This function matches "globs". A in the glob string a question sign - matches any character and an asterisk matches any string. When - given two strings as argument a true/false value is returned - which reflects if the 'str' matches 'glob'. When given an array as - second argument, an array containing all matching strings is returned. - -SEE ALSO - sscanf, regexp diff --git a/doc/builtin/hash b/doc/builtin/hash deleted file mode 100644 index 679342027ccae46365e221d2fbd9a5483e7a5907..0000000000000000000000000000000000000000 --- a/doc/builtin/hash +++ /dev/null @@ -1,15 +0,0 @@ -NAME - hash - hash a string - -SYNTAX - int hash(string s); - or - int hash(string s, int max); - -DESCRIPTION - This function will return an int derived from the string s. The same - string will always hash to the same value. If a second argument - is given, the result will be >= 0 and lesser than that argument. - -KEYWORDS - string diff --git a/doc/builtin/indices b/doc/builtin/indices deleted file mode 100644 index 408d5058a7095a605232e24e63310d9b614869a5..0000000000000000000000000000000000000000 --- a/doc/builtin/indices +++ /dev/null @@ -1,17 +0,0 @@ -NAME - indices - return an array of all index possible for a value - -SYNTAX - mixed *indices(string|array|mapping|multiset|object foo); - -DESCRIPTION - Indices returns an array of all values you can use as index when - indexing foo. For strings and arrays this is simply an array of the - ascending numbers. For mappings and multisets, the array may contain any - kind of value. For objects, the result is an array of strings. - -KEYWORDS - mapping, multiset - -SEE ALSO - values diff --git a/doc/builtin/intp b/doc/builtin/intp deleted file mode 100644 index f8e1bd9ef542f12f6dfed6b9f5a24f9ac70d1007..0000000000000000000000000000000000000000 --- a/doc/builtin/intp +++ /dev/null @@ -1,15 +0,0 @@ -NAME - intp - is the argument an int? - -SYNTAX - array intp(mixed arg); - -DESCRIPTION - Returns 1 if arg is an int, zero otherwise. - -KEYWORDS - int - -SEE ALSO - arrayp, programp, floatp, stringp, objectp, - mappingp, multisetp, functionp diff --git a/doc/builtin/kill b/doc/builtin/kill deleted file mode 100644 index f0b207d61449f28d588cab5d11d4d271ce8c75d9..0000000000000000000000000000000000000000 --- a/doc/builtin/kill +++ /dev/null @@ -1,47 +0,0 @@ -NAME - kill - send signal to other process - -SYNTAX - int kill(int pid, int signal) - -DESCRIPTION - Kill sends a signal to another process. If something goes wrong - -1 is returned, 0 otherwise. - - Some signals and their supposed purpose: - - SIGHUP Hangup, sent to process when user logs out - SIGINT Interrupt, normally sent by ctrl-c - SIGQUIT Quit, sent by ctrl-\ - SIGILL Illegal instruction - SIGTRAP Trap, mostly used by debuggers - SIGABRT Aborts process, can be caught, used by Pike whenever something - goes seriously wrong. - SIGBUS Bus error - SIGFPE Floating point error (such as division by zero) - SIGKILL Really kill a process, cannot be caught - SIGUSR1 Signal reserved for whatever you want to use it for. - SIGSEGV Segmentation fault, caused by accessing memory where you - shouldn't. Should never happen to Pike. - SIGUSR2 Signal reserved for whatever you want to use it for. - SIGALRM Signal used for timer interrupts. - SIGTERM Termination signal - SIGSTKFLT Stack fault - SIGCHLD Child process died - SIGCONT Continue suspended - SIGSTOP Stop process - SIGSTP Suspend process - SIGTTIN tty input for background process - SIGTTOU tty output for background process - SIGXCPU Out of cpu - SIGXFSZ File size limit exceeded - SIGPROF Profile trap - SIGWINCH Window change signal - - Note that you have to use signame to translate the name of a signal - to it's number. - -SEE ALSO - signal, signum, signame, files/fork - - diff --git a/doc/builtin/load_module b/doc/builtin/load_module deleted file mode 100644 index ed7230cae522f5c0fc06d36ac9ebb477206de22e..0000000000000000000000000000000000000000 --- a/doc/builtin/load_module +++ /dev/null @@ -1,23 +0,0 @@ -NAME - load_module - load a binary module - -SYNTAX - int load_module(string module_name); - -DESCRIPTION - This function loads a module written in C or some other language - into Pike. The module is initialized and any programs or constants - defined will immediately be available. - - When a module is loaded the functions init_module_efuns and - init_module_programs are called to initialize it. When Pike exits - exit_module is called in all dynamically loaded modules. These - functions _must_ be available in the module. - - Please see the source and any examples available at - ftp://www.infovav.se/pub/pike for more information on how to - write modules for Pike in C. - -BUGS - Please use "./name.so" instead of just "foo.so" for the module - name. If you use just "foo.se" the module will not be found. diff --git a/doc/builtin/localtime b/doc/builtin/localtime deleted file mode 100644 index 99f5c20b01003dc808ea37cd273c9e22fffce26a..0000000000000000000000000000000000000000 --- a/doc/builtin/localtime +++ /dev/null @@ -1,29 +0,0 @@ -NAME - localtime - break down time() into intelligible components - -SYNTAX - mapping(string:int) localtime(int time); - -DESCRIPTION - Given a time represented as second since 1970, as returned by the - function time(), this function returns a mapping with the following - components: - - sec seconds over the minute 0 - 59 - min minutes over the hour 0 - 59 - hour what hour in the day 0 - 23 - mday day of the month 1 - 31 - mon what month 0 - 11 - year years since 1900 0 - - wday day of week (0=sunday) 0 - 6 - yday day of year 0 - 365 - isdst is daylight saving time 0/1 - timezone differance between - local time and UTC - - -NOTA BENE - The 'timezone' might not be available on all platforms. - -SEE ALSO - time \ No newline at end of file diff --git a/doc/builtin/lower_case b/doc/builtin/lower_case deleted file mode 100644 index b100d2a702f2b486623d99f7058ce2e1f92e4a36..0000000000000000000000000000000000000000 --- a/doc/builtin/lower_case +++ /dev/null @@ -1,14 +0,0 @@ -NAME - lower_case - convert a string to lower case - -SYNTAX - string lower_case(string s); - -DESCRIPTION - Return a string with all capital letters converted to lower case. - -KEYWORDS - string - -SEE ALSO - upper_case diff --git a/doc/builtin/m_delete b/doc/builtin/m_delete deleted file mode 100644 index f316dd12518997762d72659e5c8da03c2b97a366..0000000000000000000000000000000000000000 --- a/doc/builtin/m_delete +++ /dev/null @@ -1,18 +0,0 @@ -NAME - m_delete - remove an index from a mapping - -SYNTAX - mapping m_delete(mapping map, mixed index); - -DESCRIPTION - Remove the entry with index 'index' from mapping 'map' destructively. - Return the changed mapping. If the mapping does not have an - entry with index 'index', nothing is done. - Note that m_delete changes map destructively and only returns - the mapping for compatibility reasons. - -KEYWORDS - mapping - -SEE ALSO - mappingp diff --git a/doc/builtin/mappingp b/doc/builtin/mappingp deleted file mode 100644 index 3df96de1b2991739a7af145c5cb768b608797886..0000000000000000000000000000000000000000 --- a/doc/builtin/mappingp +++ /dev/null @@ -1,15 +0,0 @@ -NAME - mappingp - is the argument an mapping? - -SYNTAX - int mappingp(mixed arg); - -DESCRIPTION - Returns 1 if arg is a mapping, zero otherwise. - -KEYWORDS - mapping - -SEE ALSO - intp, programp, arrayp, stringp, objectp, - multisetp, floatp, functionp diff --git a/doc/builtin/mkmapping b/doc/builtin/mkmapping deleted file mode 100644 index 62a69ac41cb6cc25be829d1c60fce9a465da60be..0000000000000000000000000000000000000000 --- a/doc/builtin/mkmapping +++ /dev/null @@ -1,16 +0,0 @@ -NAME - mkmapping - make a mapping from two arrays - -SYNTAX - mapping mkmapping(mixed *ind, mixed *val); - -DESCRIPTION - Makes a mapping ind[x]:val[x], 0<=x<sizeof(ind). - Ind and val must have the same size. - This is the inverse operation of indices and values. - -KEYWORDS - mapping - -SEE ALSO - indices, values diff --git a/doc/builtin/multisetp b/doc/builtin/multisetp deleted file mode 100644 index c55ff966974aa097121d327b851f410e2ec69fc5..0000000000000000000000000000000000000000 --- a/doc/builtin/multisetp +++ /dev/null @@ -1,15 +0,0 @@ -NAME - multisetp - is the argument a multiset? - -SYNTAX - int multisetp(mixed arg); - -DESCRIPTION - Returns 1 if arg is a multiset, zero otherwise. - -KEYWORDS - multiset - -SEE ALSO - intp, programp, arrayp, stringp, objectp, - mappingp, floatp, functionp diff --git a/doc/builtin/next_object b/doc/builtin/next_object deleted file mode 100644 index 1713a9b8392a4cb1b3701fb7f82fa657e5512401..0000000000000000000000000000000000000000 --- a/doc/builtin/next_object +++ /dev/null @@ -1,24 +0,0 @@ -NAME - next_object - get next object - -SYNTAX - object next_object(object o); - or - object next_object(); - -DESCRIPTION - All objects are stored in a linked list, next_object() returns the - first object in this list, and next_object(o) the next object in the - list after o. - -EXAMPLES - /* This example calls shutting_down() in all cloned objects */ - object o; - for(o=next_object();o;o=next_object(o)) - o->shutting_down(); - -KEYWORDS - object - -SEE ALSO - clone, destruct diff --git a/doc/builtin/object_program b/doc/builtin/object_program deleted file mode 100644 index f6a15bf3538590b361f593477cd1961a9067c69e..0000000000000000000000000000000000000000 --- a/doc/builtin/object_program +++ /dev/null @@ -1,15 +0,0 @@ -NAME - object_program - get the program asociated with the object - -SYNTAX - program object_program(object o); - -DESCRIPTION - This function returns the program from which o was cloned. - If o is not an object, or o was destructed zero is returned. - -KEYWORDS - object - -SEE ALSO - clone diff --git a/doc/builtin/objectp b/doc/builtin/objectp deleted file mode 100644 index 53dc755f75c5b2e4144a50720ef8c693dceb6dc5..0000000000000000000000000000000000000000 --- a/doc/builtin/objectp +++ /dev/null @@ -1,15 +0,0 @@ -NAME - objectp - is the argument an object? - -SYNTAX - int objectp(mixed arg); - -DESCRIPTION - Returns 1 if arg is an object, zero otherwise. - -KEYWORDS - object - -SEE ALSO - intp, programp, floatp, stringp, arrayp, - mappingp, multisetp, functionp diff --git a/doc/builtin/programp b/doc/builtin/programp deleted file mode 100644 index 775349e56ecff549bfbc6f4ff4ce14d68434491b..0000000000000000000000000000000000000000 --- a/doc/builtin/programp +++ /dev/null @@ -1,15 +0,0 @@ -NAME - programp - is the argument an program? - -SYNTAX - int programp(mixed arg); - -DESCRIPTION - Returns 1 if arg is a program, zero otherwise. - -KEYWORDS - program - -SEE ALSO - intp, multisetp, arrayp, stringp, objectp, - mappingp, floatp, functionp diff --git a/doc/builtin/query_host_name b/doc/builtin/query_host_name deleted file mode 100644 index d470ee0bbe6365b8d02aa9dfaa9a1e3631ca0720..0000000000000000000000000000000000000000 --- a/doc/builtin/query_host_name +++ /dev/null @@ -1,10 +0,0 @@ -NAME - query_host_name - return the name of the host we are running on - -SYNTAX - string query_host_name(); - -DESCRIPTION - This function returns the name of the machine the interpreter is - running on. This is the same thing that the command 'hostname' - prints. diff --git a/doc/builtin/query_num_arg b/doc/builtin/query_num_arg deleted file mode 100644 index 5a4631fb45b57c0eebda45db244a7ebb077e2b2e..0000000000000000000000000000000000000000 --- a/doc/builtin/query_num_arg +++ /dev/null @@ -1,12 +0,0 @@ -NAME - query_num_arg - find out how many arguments were given - -SYNTAX - int query_num_arg(); - -DESCRIPTION - Query_num_arg returns the number of arguments given when this - function was called. This is only useful for varargs functions. - -SEE ALSO - call_function diff --git a/doc/builtin/random b/doc/builtin/random deleted file mode 100644 index 8fc12ee293f111db8e5696d90f9b2352a434f636..0000000000000000000000000000000000000000 --- a/doc/builtin/random +++ /dev/null @@ -1,14 +0,0 @@ -NAME - random - return a random number - -SYNTAX - int random(int max); - -DESCRIPTION - This function returns a random number in the range 0 - max-1. - -KEYWORDS - int - -SEE ALSO - random_seed diff --git a/doc/builtin/random_seed b/doc/builtin/random_seed deleted file mode 100644 index af23b2da3563992660db4dd60d6f8d92a122467f..0000000000000000000000000000000000000000 --- a/doc/builtin/random_seed +++ /dev/null @@ -1,34 +0,0 @@ -NAME - random_seed - seed random generator - -SYNTAX - void random_seed(int seed); - -DESCRIPTION - This function sets the initial value for the random generator. - -EXAMPLE - Pike v1.0E-13 Running Hilfe v1.2 (Hubbe's Incremental Pike FrontEnd) - > random_seed(17); - Result: 0 - > random(1000); - Result: 732 - > random(1000); - Result: 178 - > random(1000); - Result: 94 - > random_seed(17); - Result: 0 - > random(1000); - Result: 732 - > random(1000); - Result: 178 - > random(1000); - Result: 94 - > - -KEYWORDS - int - -SEE ALSO - random \ No newline at end of file diff --git a/doc/builtin/replace b/doc/builtin/replace deleted file mode 100644 index 14165f779e5aceff9c598b288d36f0406e68facf..0000000000000000000000000000000000000000 --- a/doc/builtin/replace +++ /dev/null @@ -1,36 +0,0 @@ -NAME - replace - generic replace function - -SYNTAX - string replace(string s, string from, string to); - or - string replace(string s, string *from, string *to); - or - array replace(array a, mixed from, mixed to); - or - mapping replace(mapping a, mixed from, mixed to); - -DESCRIPTION - This function can do several kinds replacement operations, the - different syntaxes do different things as follow: - - string replace(string s, string from, string to); - - When given strings as second and third argument, a copy of - s with every occurance of 'from' return 'to' is returned. - - string replace(string s, string *from, string *to); - - When given arrays of strings as second and third argument, - every occurance of from[0] in s is replaced by to[0], - from[1] is replaced by to[1] and so on... - - array replace(array a, mixed from, mixed to); - mapping replace(mapping a, mixed from, mixed to); - - When the first argument is an array or mapping, the values in - a are searched for values equal to from, which are replaced by - to destructively. - -KEYWORDS - string, array, mapping diff --git a/doc/builtin/reverse b/doc/builtin/reverse deleted file mode 100644 index 10a0bcf569f425dafaa888f8e5a0e9859c8da726..0000000000000000000000000000000000000000 --- a/doc/builtin/reverse +++ /dev/null @@ -1,21 +0,0 @@ -NAME - reverse - reverse a string, array or int - -SYNTAX - string reverse(string s); - or - array reverse(arary a); - or - int reverse(int i); - -DESCRIPTION - This function reverseses a string, char by char, an array, value - by value or an int, bit by bit and returns the result. Reversing - strings can be particularly useful for parsing difficult syntaxes - which require scanning backwards. - -KEYWORDS - string, array, int - -SEE ALSO - sscanf diff --git a/doc/builtin/rows b/doc/builtin/rows deleted file mode 100644 index 4e6dfb6aeacf19aab793275aada90b60cebf6ff6..0000000000000000000000000000000000000000 --- a/doc/builtin/rows +++ /dev/null @@ -1,20 +0,0 @@ -NAME - rows - select a set of rows from an array - -SYNTAX - array rows(mixed data, mixed *index) - -DESCRIPTION - This function is exactly equivialent to: - - map_array(index,lambda(mixed x,mixed y) { return y[x]; },data) - - Except of course it is a lot shorter and faster. - That is, it indexes data on every index in the array index and - returns an array with the results. - -KEYWORDS - array - -SEE ALSO - column diff --git a/doc/builtin/rusage b/doc/builtin/rusage deleted file mode 100644 index a52c98194ed8ee0fa67f4b5a8e7b761a370b10af..0000000000000000000000000000000000000000 --- a/doc/builtin/rusage +++ /dev/null @@ -1,47 +0,0 @@ -NAME - rusage - return resource usage - -SYNTAX - int *rusage(); - -DESCRIPTION - This function returns an array of ints describing how much resources - the intepreter process has used so far. This array will have at least - 29 elements, of which those values not available on this system will - be zero. The elements are as follows: - - 0: user time - 1: system time - 2: maxrss - 3: idrss - 4: isrss - 5: minflt - 6: minor pagefaults - 7: major pagefaults - 8: swaps - 9: block input op. - 10: block output op. - 11: messages sent - 12: messages received - 13: signals received - 14: voluntary context switches - 15: involuntary context switches - 16: sysc - 17: ioch - 18: rtime - 19: ttime - 20: tftime - 21: dftime - 22: kftime - 23: ltime - 24: slptime - 25: wtime - 26: stoptime - 27: brksize - 28: stksize - - Don't ask me to explain these values, read your system manuals for - more information. (Note that all values may not be present though) - -SEE ALSO - time diff --git a/doc/builtin/search b/doc/builtin/search deleted file mode 100644 index a73d65b0901cc36398048ee5e239a47f1b4ca45f..0000000000000000000000000000000000000000 --- a/doc/builtin/search +++ /dev/null @@ -1,31 +0,0 @@ -NAME - search - search for a value in a string or array - -SYNTAX - int search(string haystack, string needle, [ int start ]); - or - int search(mixed *haystack, mixed needle, [ int start ]); - or - mixed search(mapping haystack, mixed needle, [ mixed start ]); - -DESCRIPTION - Search for needle in haystack. Return the position of needle in - haystack or -1 if not found. If the optional argument start is present - search is started at this position. Note that when haystack is a string - needle must be a string, and the first occurance of this string is - returned. However, when haystack is an array, needle is compared only - to one value at a time in haystack. - - When the haystack is a mapping, search tries to find the index - connected to the data needle. That is, it tries to lookup the mapping - backwards. If needle isn't present in the mapping, zero is returned, - and zero_type() will return 1 for this zero. - -NOTA BENE - This function replaces strstr and member_array from Pike4. - -KEYWORDS - string, array, mapping - -SEE ALSO - indices, values, zero_type diff --git a/doc/builtin/signal b/doc/builtin/signal deleted file mode 100644 index ef69cc0879bccf8979a2224c21f77edc082ead9b..0000000000000000000000000000000000000000 --- a/doc/builtin/signal +++ /dev/null @@ -1,25 +0,0 @@ -NAME - signal - trap signals - -SYNTAX - void signal(int sig, function(int:void) callback); - or - void signal(int sig); - -DESCRIPTION - This function allows you to trap a signal and have a function called - when the process receives a signal. Although it IS possible to trap - SIGBUS, SIGSEGV etc. I advice you not to. Pike should not receive any - such signals and if it does it is because of bugs in the Pike - interperter. And all bugs should be reported, no matter how trifle. - - The callback will receive the signal number as the only argument. - See the document for the function 'kill' for a list of signals. - - If no second argument is given, the signal handler for that signal - is restored to the default handler. - - If the second argument is zero, the signal will be completely ignored. - -SEE ALSO - kill, signame, signum diff --git a/doc/builtin/signame b/doc/builtin/signame deleted file mode 100644 index 8d6d4c7092b3b853e11818dd8f6114cc90bc0d74..0000000000000000000000000000000000000000 --- a/doc/builtin/signame +++ /dev/null @@ -1,15 +0,0 @@ -NAME - signame - get the name of a signal - -SYNTAX - string signame(int sig); - -DESCRIPTION - Return a string describing the signal. - -EXAMPLE - > signame(9); - Result: SIGKILL - -SEE ALSO - kill, signum, signal diff --git a/doc/builtin/signum b/doc/builtin/signum deleted file mode 100644 index f0ab4b2bdd893b3adedcec9528ee2ff8562fdf70..0000000000000000000000000000000000000000 --- a/doc/builtin/signum +++ /dev/null @@ -1,15 +0,0 @@ -NAME - signum - get a signal number given a desctiptive string - -SYNTAX - int signum(string sig); - -DESCRIPTION - This function is the opposite of signame. - -EXAMPLE - > signum("SIGKILL"); - Result: 9 - -SEE ALSO - signame, kill, signal \ No newline at end of file diff --git a/doc/builtin/sizeof b/doc/builtin/sizeof deleted file mode 100644 index 945eaddabc233ffde94977283f43a550299fa559..0000000000000000000000000000000000000000 --- a/doc/builtin/sizeof +++ /dev/null @@ -1,13 +0,0 @@ -NAME - sizeof - return the size of an array, string, multiset or mapping - -SYNTAX - int sizeof(string|multiset|mapping|array|object a); - -DESCRIPTION - This function returns the number of indexes available in the argument - given to it. It replaces older functions like strlen, m_sizeof and - size. - -KEYWORDS - string, multiset, mapping, array diff --git a/doc/builtin/sleep b/doc/builtin/sleep deleted file mode 100644 index 4a7a03a6ce80038716cd81e98b266945be451cc5..0000000000000000000000000000000000000000 --- a/doc/builtin/sleep +++ /dev/null @@ -1,13 +0,0 @@ -NAME - sleep - let interpreter doze of for a while - -SYNTAX - void sleep(int s); - -DESCRIPTION - This function makes the program stop for s seconds. Only signal - handlers can interrupt the sleep. Other callbacks are not called - during sleep. - -SEE ALSO - signal diff --git a/doc/builtin/sort b/doc/builtin/sort deleted file mode 100644 index c13208ada7c14bf8f3fa50d6724b3eb943fd16a1..0000000000000000000000000000000000000000 --- a/doc/builtin/sort +++ /dev/null @@ -1,24 +0,0 @@ -NAME - sort - sort an array destructively - -SYNTAX - mixed *sort(array(mixed) index, array(mixed) ... data); - -DESCRIPTION - This function sorts the array 'index' destructively. That means - that the array itself is changed and returned, no copy is created. - If extra arguments are given, they are supposed to be arrays of the - same size. Each of these arrays will be modified in the same way as - 'index'. Ie. if index 3 is moved to position 0 in 'index' index 3 - will be moved to position 0 in all the other arrays as well. - - Sort can sort strings, integers and floats in ascending order. - Arrays will be sorted first on the first element of each array. - - Sort returns it's first argument. - -KEYWORDS - array - -SEE ALSO - reverse diff --git a/doc/builtin/stringp b/doc/builtin/stringp deleted file mode 100644 index 4939517064fa8f119d0d6c7f50b71e0de0c3a50e..0000000000000000000000000000000000000000 --- a/doc/builtin/stringp +++ /dev/null @@ -1,15 +0,0 @@ -NAME - stringp - is the argument an string? - -SYNTAX - int stringp(mixed arg); - -DESCRIPTION - Returns 1 if arg is a string, zero otherwise. - -KEYWORDS - string - -SEE ALSO - intp, multisetp, arrayp, programp, objectp, - mappingp, floatp, functionp diff --git a/doc/builtin/this_object b/doc/builtin/this_object deleted file mode 100644 index 8c653b1499378ee3c2fffddda91c606c059eebd1..0000000000000000000000000000000000000000 --- a/doc/builtin/this_object +++ /dev/null @@ -1,11 +0,0 @@ -NAME - this_object - return the object we are evaluating in currently - -SYNTAX - object this_object(); - -DESCRIPTION - This function returns the object we are curently evaluating in. - -KEYWORDS - object diff --git a/doc/builtin/this_thread b/doc/builtin/this_thread deleted file mode 100644 index f898ec49eef31cab5a258da3ff992f85e2cc85f8..0000000000000000000000000000000000000000 --- a/doc/builtin/this_thread +++ /dev/null @@ -1,11 +0,0 @@ -NAME - this_thread - return thread id - -SYNTAX - object thread_id(); - -DESCRIPTION - This function returns the object that identifies this thread. - -SEE ALSO - thread_create diff --git a/doc/builtin/thread_create b/doc/builtin/thread_create deleted file mode 100644 index 5d384b262586aedef8af3a01b8d3eeb15a5acca5..0000000000000000000000000000000000000000 --- a/doc/builtin/thread_create +++ /dev/null @@ -1,20 +0,0 @@ -NAME - thread_create - create a thread - -SYNTAX - object thread_create(function f, mixed ... args); - -DESCRIPTION - This function creates a new thread which will run simultaneously - to the rest of the program. The new thread will call the function - f with the arguments args. When f returns the thread will cease - to exist. All Pike functions are 'thread safe' meanting that running - a function at the same time from different threads will not corrupt - any internal data in the Pike process. The returned value will be - the same as the return value of this_thread() for the new thread. - -NOTA BENE - This function is only available on systems with POSIX threads support. - -SEE ALSO - /precompiled/mutex, /precompiled/condition, this_thread \ No newline at end of file diff --git a/doc/builtin/throw b/doc/builtin/throw deleted file mode 100644 index 54f034fbf26367885e9805d31644dd708db6371e..0000000000000000000000000000000000000000 --- a/doc/builtin/throw +++ /dev/null @@ -1,16 +0,0 @@ -NAME - throw - throw a value to catch or global error handling - -SYNTAX - void throw(mixed value); - -DESCRIPTION - This function throws a value to a waiting catch. If no catch is - waiting global error handling will send the value to handle_error - in the master object. If you throw an array with where the first - index contains an error message and the second index is a backtrace, - (the output from backtrace() that is) then it will be treated exactly - like a real error by overlying functions. - -SEE ALSO - catch diff --git a/doc/builtin/time b/doc/builtin/time deleted file mode 100644 index 57708ca8c7452e57e3c6733b072d1c6f7fb69e9a..0000000000000000000000000000000000000000 --- a/doc/builtin/time +++ /dev/null @@ -1,17 +0,0 @@ -NAME - time - return the current time - -SYNTAX - int time(); - or - int time(1); - -DESCRIPTION - This function returns the number of secons since 1 Jan 1970. - The function ctime() converts this integer to a readable string. - - The second syntax does not call the system call time() as often, - but is only updated in the backed. (when pike code isn't running) - -SEE ALSO - time diff --git a/doc/builtin/trace b/doc/builtin/trace deleted file mode 100644 index d15fa53c5c34b54e3d3831af0a759acba4bdcbdd..0000000000000000000000000000000000000000 --- a/doc/builtin/trace +++ /dev/null @@ -1,14 +0,0 @@ -NAME - trace - change debug trace level - -SYNTAX - int trace(int t); - -DESCRIPTION - This function affects the debug trace level. (also set by the -t - command line option) The old level is returned. Trace level 1 or - higher means that calls to pike functions are printed to stderr, - level 2 or higer means calls to builtin functions are printed, 3 - means every opcode interpreted is printed, 4 means arguments to - these opcodes are printed as well. See the command lines options - for more information diff --git a/doc/builtin/ualarm b/doc/builtin/ualarm deleted file mode 100644 index 8992a400f7baf35f79cd8a9174d06a4c569d3a31..0000000000000000000000000000000000000000 --- a/doc/builtin/ualarm +++ /dev/null @@ -1,21 +0,0 @@ -NAME - ualarm - set an alarm clock for delivery of a signal - -SYNTAX - int ualarm(int useconds); - -DESCRIPTION - ualarm arranges for a SIGALRM signal to be delivered to the - process in useconds micro seconds. - - If useconds is zero, no new alarm is scheduled. - - In any event any previously set alarm is cancelled. - -RETURN VALUE - ualarm returns the number of microseconds seconds remaining - until any previously scheduled alarm was due to be delivered, or - zero if there was no previously scheduled alarm. - -SEE ALSO - signal diff --git a/doc/builtin/upper_case b/doc/builtin/upper_case deleted file mode 100644 index 46fd08420240bd36427efb8a0cfbd29975eceacf..0000000000000000000000000000000000000000 --- a/doc/builtin/upper_case +++ /dev/null @@ -1,15 +0,0 @@ -NAME - upper_case - convert a string to upper case - -SYNTAX - string upper_case(string s); - -DESCRIPTION - Return a copy of the string s with all lower case character converted - to upper case character. - -KEYWORDS - string - -SEE ALSO - lower_case diff --git a/doc/builtin/values b/doc/builtin/values deleted file mode 100644 index ba9447c782e74f3c73a8872930accd8b4092833d..0000000000000000000000000000000000000000 --- a/doc/builtin/values +++ /dev/null @@ -1,19 +0,0 @@ -NAME - values - return an array of all possible values from indexing - -SYNTAX - mixed *values(string|multiset|mapping|array|object foo); - -DESCRIPTION - Values return an array of all values you can get when indexing the - value foo. For strings, an array of int with the ascii values of the - characters in the string is returned. For a multiset, an array filled with - ones is return. For mappings, objects and arrays, the returned array - may contain any kind of value. - -KEYWORDS - mapping - -SEE ALSO - indices - diff --git a/doc/builtin/zero_type b/doc/builtin/zero_type deleted file mode 100644 index 5f55f8a0e0944d91a7924de7e2b4ed1127504479..0000000000000000000000000000000000000000 --- a/doc/builtin/zero_type +++ /dev/null @@ -1,24 +0,0 @@ -NAME - zero_type - return the type of zero - -SYNTAX - int zero_type(mixed a); - -DESCRIPTION - There are many types of zeros out there, or at least there are two. - One is returned by normal functions, and one returned by mapping - lookups and find_call_out() when what you looked for wasn't there. - The only way to separate these two kinds of zeros is zero_type. - When doing a find_call_out or mapping lookup, zero_type on this value - will return 1 if there was no such thing present in the mappping, or - no such call_out could be found. If the argument to zero type is a - destructed object or a function in a destructed object, 2 will be - returned. Otherwize zero_type will return zero. - - If the argument is not an int, zero will be returned. - -KEYWORDS - int, mapping - -SEE ALSO - find_call_out diff --git a/doc/index.bmml b/doc/index.bmml deleted file mode 100644 index 00e42cb0e92554b9f5d5b004507b65c831025a78..0000000000000000000000000000000000000000 --- a/doc/index.bmml +++ /dev/null @@ -1,84 +0,0 @@ -$version manual - - This manual is far from complete, it still needs a lot of work to cover - all the aspects required of a good manual. However, I hope that it is - still useful in it's present state. - - Getting started - - For now this section is made up of example code with line by line - explanations. If there is a word you don't understand I suggest you - look it up in the index first time you encouter it because it might - be essential to understanding that piece of code. - - KEYWORD_LIST examples - - TAG control - - Control structures - - Control structures groups code into blocks and they control the order in - which statements are executed. Control structures in Pike are basically - the same as those in C, with a few exceptions. - - KEYWORD_LIST control - - TAG types - - Types - - Data is stored in different ways, integers (eg. 1, 2, 3, 4 etc.) are - are stored in one way, real numbers (1.0, 1.1, etc.) in another. Each - different way get its own name. Pike types are part of what makes Pike - a powerful language. They make it easy to handle data without worrying - about memory management and other programming obstacles. - - KEYWORD_LIST types - - TAG pike - - Pike and object orientation - - This section is about the more fundamental workings of Pike, such as - how Pike compiles code and object orientation. - - KEYWORD_LIST pike - - Builtin functions - - Pike has a wide range of builtin functions. Most of these are implemented - in C, but some are implemented in Pike using the add_constant function. - - LINK pike/efuns Here's a list of all built-in functions. - - TAG operators - - LINK operators/operators Operators - - Pike operators behave much like the onces in C, but have many many additional - features. Most of this added functionality is related to the new data types. - - Keyword index - - The rest of the written documentation is gathered here, without much - thought about order. Hopefully you should be able to use this section - anyway once you've looked at the sections above. - - TAG file - - KEYWORD_INDEX file - - KEYWORD_INDEX programs - - KEYWORD_INDEX other - - LINK pike/all Here's a list of all pages. - - Pike internals - - This section of the manual tries to explain how the inside of Pike works. - It is intended for people who wants to write extentions to Pike, but - could also be useful for debugging and/or optimization. - - KEYWORD_LIST internal__internals - diff --git a/doc/internal/.bmmlrc b/doc/internal/.bmmlrc deleted file mode 100644 index ffd062627df1dd934e7c9151b0c18264f22674ab..0000000000000000000000000000000000000000 --- a/doc/internal/.bmmlrc +++ /dev/null @@ -1 +0,0 @@ -prefix internal diff --git a/doc/internal/array/aggregate_array b/doc/internal/array/aggregate_array deleted file mode 100644 index 8a09a223e1cf98c64d626b3005982f17ded058f4..0000000000000000000000000000000000000000 --- a/doc/internal/array/aggregate_array +++ /dev/null @@ -1,17 +0,0 @@ -NAME - aggregate_array - build an array from the stack - -SYNTAX - #include "array.h" - - struct array *aggregate_array(INT32 num) - -DESCRIPTION - This pops 'num' args off the stack an puts them in an array. - The 'top' of the stack will be the last element in the array. - -KEYWORDS - array - -SEE ALSO - check_stack, push_array_items \ No newline at end of file diff --git a/doc/internal/array/allocate_array b/doc/internal/array/allocate_array deleted file mode 100644 index 55f0dfca43321a08f562a90d0e7c48a9ca3a589e..0000000000000000000000000000000000000000 --- a/doc/internal/array/allocate_array +++ /dev/null @@ -1,21 +0,0 @@ -NAME - allocate_array - allocate an array - -SYNTAX - #include "array.h" - - struct array *allocate_array(INT32 size); - -DESCRIPTION - This function allocates an array of size 'size'. The returned - array will have 'size' struct svalues in the member 'item'. - The array can contain any svalue, and the type field will be - initalized to -1. - -NOTA BENE - When building arrays, it is recommended that you push the values - on the stack and call aggregate_array or f_aggregate instead of - allocating and filling in the values 'by hand'. - -KEYWORDS - array \ No newline at end of file diff --git a/doc/internal/array/array b/doc/internal/array/array deleted file mode 100644 index d016aea9c8af791f27e458d684a758abdb557585..0000000000000000000000000000000000000000 --- a/doc/internal/array/array +++ /dev/null @@ -1,19 +0,0 @@ -NAME - array - the internal representation of an array - -DESCRIPTION - A Pike array is represented as a 'struct array' with all the - needed svalues malloced in the same block. The relevant members - are: - - refs reference count - size the number of svalues in the array - malloced_size the number of svalues that can fit in this block - type_field a bitfield indicating what types the array contains - item the array of svalues - -SEE ALSO - type_field - -KEYWORDS - internals diff --git a/doc/internal/array/array_index b/doc/internal/array/array_index deleted file mode 100644 index 7793f329acad9e7c0c61f25967e2697fd077cf6b..0000000000000000000000000000000000000000 --- a/doc/internal/array/array_index +++ /dev/null @@ -1,28 +0,0 @@ -NAME - array_index - get an index from an array - -SYNTAX - #include "array.h" - - void array_index(struct svalue *to, struct array *a, INT32 n); - -DESCRIPTION - This function frees the contents of the svalue 'to' and replaces - it with a copy of the contents from index 'n' in the array 'a'. - Basically, what it does is: - - assign_svalue(to, a->item + n); - - The only differance is that it adds some debug and safety - measures. Usually you don't really need to use this function. - -NOTA BENE - If n is out of bounds (n < 0 or n >= a->size) Pike will dump - core. If Pike was compiled with DEBUG, a message will be written - first stating what the problem was. - -KEYWORDS - array - -SEE ALSO - assign_svalue diff --git a/doc/internal/array/array_remove b/doc/internal/array/array_remove deleted file mode 100644 index ffb605c52fb1db5f4a94452a970b720e8959169d..0000000000000000000000000000000000000000 --- a/doc/internal/array/array_remove +++ /dev/null @@ -1,20 +0,0 @@ -NAME - array_remove - remove an index from an array - -SYNTAX - #include "array.h" - - struct array *array_remove(struct array *a, INT32 ind); - -DESCRIPTION - This function removes the index 'ind' from the array 'a' destructively. - The returned array should be used instead of 'a' and can be the same - as 'a'. Because this function is destructive and might free the - memory region for 'a' it may only be used on arrays which has not been - sent to any lpc functions yet. - -KEYWORDS - array - -SEE ALSO - array_insert diff --git a/doc/internal/array/array_search b/doc/internal/array/array_search deleted file mode 100644 index 1f825dc7b4a5c8d65384e70c17cc128ba4def5ac..0000000000000000000000000000000000000000 --- a/doc/internal/array/array_search +++ /dev/null @@ -1,26 +0,0 @@ -NAME - array_search - search an array - -SYNTAX - #include "array.h" - - INT32 array_search(struct array *a, - struct svalue *val, - INT32 start); - -DESCRIPTION - This function loops over the array 'a' starting at 'start' until - it finds an index that is_eq to 'val'. When it finds such a value - the number for that index will be returned. If no such value is - found -1 is returned. - -NOTA BENE - This function checks the type_field in the array, and also re-builds - the type-field if the value is not found. - -KEYWORDS - array - -SEE ALSO - is_eq - \ No newline at end of file diff --git a/doc/internal/array/array_set_index b/doc/internal/array/array_set_index deleted file mode 100644 index 8c138aca4372ff6fb04659bd7b76094e0552879d..0000000000000000000000000000000000000000 --- a/doc/internal/array/array_set_index +++ /dev/null @@ -1,30 +0,0 @@ -NAME - array_set_index - get an index from an array - -SYNTAX - #include "array.h" - - void array_set_index(struct array *a, - INT32 ind, - struct svalue *from); - -DESCRIPTION - This function frees the contents of the index 'ind' in the array - 'a' and replaces it with a copy of the contents from 'from'. - Basically, what it does is: - - assign_svalue(a->item + n, from); - - The only differance is that it adds some debug and safety - measures. Usually you don't really need to use this function. - -NOTA BENE - If n is out of bounds (n < 0 or n >= a->size) Pike will dump - core. If Pike was compiled with DEBUG, a message will be written - first stating what the problem was. - -KEYWORDS - array - -SEE ALSO - assign_svalue diff --git a/doc/internal/array/copy_array b/doc/internal/array/copy_array deleted file mode 100644 index dca42ea65f654111d0665d3109643dc86222eb1c..0000000000000000000000000000000000000000 --- a/doc/internal/array/copy_array +++ /dev/null @@ -1,14 +0,0 @@ -NAME - copy_array - copy an array - -SYNTAX - #include "array.h" - - struct array *copy_array(struct svalue *a); - -DESCRIPTION - This function returns a copy of the array 'a'. It is not recursive, - arrays within 'a' will only get extra references. - -KEYWORDS - array diff --git a/doc/internal/array/free_array b/doc/internal/array/free_array deleted file mode 100644 index 3240263494be27fad291c25d4512bf25d1e573b0..0000000000000000000000000000000000000000 --- a/doc/internal/array/free_array +++ /dev/null @@ -1,18 +0,0 @@ -NAME - free_array - free one reference to a array - -SYNTAX - #include "array.h" - - void free_array(struct array *a) - -DESCRIPTION - This function frees one reference to the array a. If the reference - is the last reference to the array, it will free the memory used - by the array a. - -NOTA BENE - free_array is a macro - -KEYWORDS - array diff --git a/doc/internal/array/push_array_items b/doc/internal/array/push_array_items deleted file mode 100644 index 6cc0910c54b19a3d70b094049abaf828ca2ae0a3..0000000000000000000000000000000000000000 --- a/doc/internal/array/push_array_items +++ /dev/null @@ -1,19 +0,0 @@ -NAME - push_array_items - push array contents on stack - -SYNTAX - #include "array.h" - - void push_array_items(struct array *a) - -DESCRIPTION - This function is mainly used by the @ operator. It pushes all elements - in the array 'a' on the stack. It also frees one ref count on 'a', so - be sure to do a->refs++ first if you want to use the array after - calling this function. This function also calls check_stack properly. - -KEYWORDS - array - -SEE ALSO - aggregate_array, check_stack diff --git a/doc/internal/array/resize_array b/doc/internal/array/resize_array deleted file mode 100644 index a2d20770ac5ff830cd80747370d0c2711dec8f0b..0000000000000000000000000000000000000000 --- a/doc/internal/array/resize_array +++ /dev/null @@ -1,22 +0,0 @@ -NAME - resize_array - change the size of an array destructively - -SYNTAX - #include "array.h" - - struct array *resize_array(struct array *a, INT32 new_size); - -DESCRIPTION - This function makes an array from 'a' with the size 'new_size'. - Note that the returned might or might not be the same as 'a'. - If 'a' is too small or too big for 'new_size', a copy of 'a' will - be made with enough room and then 'a' will be freed. This means - that you can only use this function on arrays which has not been - passed to any lpc functions yet. - -KEYWORDS - array - -SEE ALSO - array_insert, array_remove - diff --git a/doc/internal/array/slice_array b/doc/internal/array/slice_array deleted file mode 100644 index 9d914fb0e42d39d2ee40b80603b962b9f158652d..0000000000000000000000000000000000000000 --- a/doc/internal/array/slice_array +++ /dev/null @@ -1,14 +0,0 @@ -NAME - slice_array - slice a pice of an array - -SYNTAX - #include "array.h" - - struct array *slice_array(struct array *a, INT32 start, INT32 end); - -DESCRIPTION - This is the equivialent of the pike operation a[start..end]. A new - array will be returned with one reference. - -KEYWORDS - array diff --git a/doc/internal/low_level/hashmem b/doc/internal/low_level/hashmem deleted file mode 100644 index f3818b0286fdf5ff921ba2f24f0c12f111fc99dd..0000000000000000000000000000000000000000 --- a/doc/internal/low_level/hashmem +++ /dev/null @@ -1,16 +0,0 @@ -NAME - hashmem - hash a memory region - -SYNTAX - #include "memory.h" - - unsigned INT32 hashmem(const unsigned char *a,INT32 len,INT32 mlen); - -DESCRIPTION - This function looks at the memory region beginning at 'a' and is 'len' - bytes long and returns a hash value depending on the bytes in that - region. The argument 'mlen' is how many bytes it should actually look - at, larger mlen gives better values but slower hashing. - -KEYWORDS - low_level diff --git a/doc/internal/low_level/init_memsearch b/doc/internal/low_level/init_memsearch deleted file mode 100644 index d85edd37ed3cc279b4f8cdd7d6c64299174c042b..0000000000000000000000000000000000000000 --- a/doc/internal/low_level/init_memsearch +++ /dev/null @@ -1,28 +0,0 @@ -NAME - init_memsearch - initialize a memory search struct - -SYNTAX - #include "memory.h" - - void init_memsearch(struct mem_searcher *s, - char *needle, - SIZE_T needlelen, - SIZE_T max_haystacklen); - -DESCRIPTION - This function initializes a struct mem_searcher to be used with - the function memory_search. 'needle' is the byte sequence to - search for, and needlelen is how many bytes long the 'needle' is. - The argument 'max_haystacklen' is an approximation of how much - this memory searcher will be used. More time will be spent optimizing - the memory searcher struct if max_haystacklen is large. - -NOTA BENE - The needle is not copied by this function. It must still be available - when memory_search is called. - -KEYWORDS - low_level - -SEE ALSO - memory_search \ No newline at end of file diff --git a/doc/internal/low_level/low_level b/doc/internal/low_level/low_level deleted file mode 100644 index 0dcf146cb77c4fc77010f7bbc393644f762788cb..0000000000000000000000000000000000000000 --- a/doc/internal/low_level/low_level +++ /dev/null @@ -1,9 +0,0 @@ -NAME - low_level - low level routines supplied by pike - -DESCRIPTION - These functions are here to help you write fast and portable modules. - Pike itself also uses them for the same purpose. - -KEYWORDS - internals diff --git a/doc/internal/low_level/memory_search b/doc/internal/low_level/memory_search deleted file mode 100644 index 94fa2d9ce7eeaa2ff940e8e545de40a24935292c..0000000000000000000000000000000000000000 --- a/doc/internal/low_level/memory_search +++ /dev/null @@ -1,23 +0,0 @@ -NAME - memory_search - search memory for a sequence of bytes - -SYNTAX - #include "memory.h" - - char *memory_search(struct mem_searcher *s, - char *haystack, - SIZE_T haystacklen); - -DESCRIPTION - This function searches through a memory region (called 'haystack') - for a sequence of bytes (called 'needle'). If found, a pointer to - the first occurance of 'needle' in 'haystack' is returned. The needle - is given by calling init_memsearch to initialize a struct mem_searcher - that can then be used with this function. - -KEYWORDS - low_level - -SEE ALSO - init_memsearch - diff --git a/doc/internal/low_level/reorder b/doc/internal/low_level/reorder deleted file mode 100644 index d208424b6261a9e826bd006431ec9368330c3e2a..0000000000000000000000000000000000000000 --- a/doc/internal/low_level/reorder +++ /dev/null @@ -1,22 +0,0 @@ -NAME - reorder - re-order an array of memory blocks - -SYNTAX - #include "memory.h" - - void reorder(char *memory, INT32 nitems, INT32 size,INT32 *order); - -DESCRIPTION - This function takes an array of memory blocks and re-organizes them - according to the argument 'order'. 'nitems' tells how many memory - blocks there are, and 'size' tells how big they are in bytes. - 'order' is simply an array of INT32 of size 'nitems' in which each - int tells which memory block from 'memory' should be placed in that - position. In pseudo code, this could be written as: - - mem_copy=copy_memory(memory); - for(int e=0;e<nitems;e++) - memory[e]=mem_copy[order[e]]; - -KEYWORDS - low_level diff --git a/doc/internal/low_level/set_close_on_exec b/doc/internal/low_level/set_close_on_exec deleted file mode 100644 index bc08afe11521948212db8350eb1e2c103b9cb583..0000000000000000000000000000000000000000 --- a/doc/internal/low_level/set_close_on_exec +++ /dev/null @@ -1,18 +0,0 @@ -NAME - set_close_on_exec - set the close-on-exec flag on a filedescriptor - -SYNTAX - #include "fd_control.h" - - void set_close_on_exec(int fd, int onoff) - -DESCRIPTION - This function sets the close-on-exec flag on a filedescriptor. If - onoff is true, the filedescriptor will be closed whenever an exec() - is executed. If it is false, the fildescriptor will remain open. - -KEYWORDS - low_level - -SEE ALSO - set_nonblocking diff --git a/doc/internal/low_level/set_nonblocking b/doc/internal/low_level/set_nonblocking deleted file mode 100644 index 86767100a34bd7ef44e9c9f428a3fc102fe4d6ec..0000000000000000000000000000000000000000 --- a/doc/internal/low_level/set_nonblocking +++ /dev/null @@ -1,20 +0,0 @@ -NAME - set_nonblocking - set a filedescriptor nonblocking - -SYNTAX - #include "fd_control.h" - - void set_nonblocking(int fd, int onoff) - -DESCRIPTION - This function sets a filedescriptor in nonblocking mode. Nonblocking - mode means that any read() or write() exits insteads of waits when - no more data can be read/written immediately. If 'onoff' is true, - the fd will be set to nonblocking, otherwise it will be set to - blocking mode. - -KEYWORDS - low_level - -SEE ALSO - set_close_on_exec diff --git a/doc/internal/low_level/set_read_callback b/doc/internal/low_level/set_read_callback deleted file mode 100644 index 3eaee90ab5c12ea19549f0beb44e0e279b00b6a8..0000000000000000000000000000000000000000 --- a/doc/internal/low_level/set_read_callback +++ /dev/null @@ -1,24 +0,0 @@ -NAME - set_read_callback - set 'data available' callback - -SYNTAX - #include "backend.h" - - void set_read_callback(int fd,file_callback cb,void *data); - -DESCRIPTION - This function sets what function should be called when there is - more data to be read from 'fd'. The 'file_callback' should be a - function like this: - - void file_callback(int fd, void *data); - - The arguments are the same as sent to set_read_callback(). - To disable the read callback, call set_read_callback again with - cb and data equal to zero. - -KEYWORDS - low_level - -SEE ALSO - set_write_callback, set_nonblocking diff --git a/doc/internal/low_level/set_write_callback b/doc/internal/low_level/set_write_callback deleted file mode 100644 index 21fbca0766270d17a12cfbd18c5e0c36797952f7..0000000000000000000000000000000000000000 --- a/doc/internal/low_level/set_write_callback +++ /dev/null @@ -1,24 +0,0 @@ -NAME - set_read_callback - set 'buffer available' callback - -SYNTAX - #include "backend.h" - - void set_write_callback(int fd,file_callback cb,void *data); - -DESCRIPTION - This function sets what function should be called when there is - time to write more data to 'fd'. The 'file_callback' should be a - function like this: - - void file_callback(int fd, void *data); - - The arguments are the same as sent to set_write_callback(). - To disable the write callback, call set_write_callback again with - cb and data equal to zero. - -KEYWORDS - low_level - -SEE ALSO - set_read_callback, set_nonblocking diff --git a/doc/internal/low_level/xalloc b/doc/internal/low_level/xalloc deleted file mode 100644 index 7fe8cf299cac5a160db8800bc90e39573f5b61e5..0000000000000000000000000000000000000000 --- a/doc/internal/low_level/xalloc +++ /dev/null @@ -1,18 +0,0 @@ -NAME - xalloc - fail-safe memory allocation - -SYNTAX - #include "memory.h" - - char *xalloc(long size); - -DESCRIPTION - This function works exactly like the malloc() function, it will - never return NULL. Instead it will try to free up any pike resources - that are not needed any longer and try again. If that doesn't work - either it will call fatal("out of memory\n"); and Pike will dump core. - This type of error handling makes it easier to code, but is not - always what you want. - -KEYWORDS - low_level diff --git a/doc/internal/mappings/copy_mapping b/doc/internal/mappings/copy_mapping deleted file mode 100644 index e9ca05b7a9488ded7fb4689181f7d7ec91c338b2..0000000000000000000000000000000000000000 --- a/doc/internal/mappings/copy_mapping +++ /dev/null @@ -1,15 +0,0 @@ -NAME - copy_mapping - copy a mapping - -SYNTAX - #include "mapping.h" - - struct mapping *copy_mapping(struct mapping *m) - -DESCRIPTION - This function returns a copy of the mapping m. If you change the - contents of the new mapping the contents of the mapping m will not - change. Note that this function is not recursive. - -KEYWORDS - mapping diff --git a/doc/internal/mappings/free_mapping b/doc/internal/mappings/free_mapping deleted file mode 100644 index ead0598146f3cc3a8fb290f6003e353a576bd004..0000000000000000000000000000000000000000 --- a/doc/internal/mappings/free_mapping +++ /dev/null @@ -1,18 +0,0 @@ -NAME - free_mapping - free one reference to a mapping - -SYNTAX - #include "mapping.h" - - void free_mapping(struct mapping *m) - -DESCRIPTION - This function frees one reference to the mapping m. If the reference - is the last reference to the mapping, it will free the memory used - by the mapping m. - -NOTA BENE - free_mapping is a macro - -KEYWORDS - mapping diff --git a/doc/internal/mappings/low_mapping_lookup b/doc/internal/mappings/low_mapping_lookup deleted file mode 100644 index 07128a3a64929796488dc4dbc1a84bb84cdde6da..0000000000000000000000000000000000000000 --- a/doc/internal/mappings/low_mapping_lookup +++ /dev/null @@ -1,28 +0,0 @@ -NAME - low_mapping_lookup - lookup a key in a mapping - -SYNTAX - #include "mapping.h" - - struct svalue *low_mapping_lookup(struct mapping *m, - struct svalue *key); - -DESCRIPTION - This function looks up the key-index pair that has the key 'key' in - the mapping 'm' and returns a pointer to the 'value'. If no such - key-index pair is found, zero is returned. - -NOTA BENE - Any call to an internal Pike function may re-allocate the mapping - 'm', which means that the pointer returned from this call is only - valid until your next function call. - -NOTA BENE - This function is intended for _reading_ mappings, it is forbidden - to change the contents of the returned svalue. - -KEYWORDS - mapping - -SEE ALSO - map_insert \ No newline at end of file diff --git a/doc/internal/mappings/m_sizeof b/doc/internal/mappings/m_sizeof deleted file mode 100644 index 7721c949d5405f454213ea886d7a2ce7e7ec515a..0000000000000000000000000000000000000000 --- a/doc/internal/mappings/m_sizeof +++ /dev/null @@ -1,17 +0,0 @@ -NAME - m_sizeof - return the number of key-value pairs in a mapping - -SYNTAX - #include "mapping.h" - - int m_sizeof(struct mapping *m) - -DESCRIPTION - This function returns the number of key-index pairs in the mapping, - just like the function sizeof() in Pike. - -NOTA BENE - m_sizeof is a macro - -KEYWORDS - mapping diff --git a/doc/internal/mappings/map_delete b/doc/internal/mappings/map_delete deleted file mode 100644 index c735593147ad7c01a3e0e3653e3a6f272505e8d4..0000000000000000000000000000000000000000 --- a/doc/internal/mappings/map_delete +++ /dev/null @@ -1,18 +0,0 @@ -NAME - map_delete - delete an item from a mapping - -SYNTAX - #include "mapping.h" - - void map_delete(struct mapping *m, struct svalue *key); - -DESCRIPTION - This function removes the key-index pair that has they key 'key' - from the mapping. If there is no such key-index pair in the mapping - nothing will be done. - -KEYWORDS - mapping - -SEE ALSO - mapping_insert diff --git a/doc/internal/mappings/mapping b/doc/internal/mappings/mapping deleted file mode 100644 index 0e46d5cf647742c8a30547bfacd0139c1b1bd09d..0000000000000000000000000000000000000000 --- a/doc/internal/mappings/mapping +++ /dev/null @@ -1,22 +0,0 @@ -NAME - mapping - internal pike mappings - -DESCRIPTION - 'struct mapping' is the C representation of a Pike mapping. The struct - itself contains no user servicable parts except for the member 'refs' - which has to be increased when putting a 'struct mapping *' into a - svalue. Never _ever_ decrease the ref counter manually, use - free_mapping instead. Also note that you should never ever allocate - a mapping statically, you should always use the functions provided by - pike to allocate mappings. - - A mapping is basically a hash table with a linked list of key-value - pairs in each hash bin. The hash table and the key-index pairs are - allocated together in one large block to minimize memory fragmentation. - Also note that whenever you search for a specific key-value pair in - the mapping that key-value pair is propagated to the top of the linked - list in that hash bin, which makes the search time very very small for - most cases. - -KEYWORDS - internals diff --git a/doc/internal/mappings/mapping_indices b/doc/internal/mappings/mapping_indices deleted file mode 100644 index dad43ab5fb3fdd177014d2936fd3386a6223e6a4..0000000000000000000000000000000000000000 --- a/doc/internal/mappings/mapping_indices +++ /dev/null @@ -1,19 +0,0 @@ -NAME - mapping_indices - return all the keys from a mapping - -SYNTAX - #include "mapping.h" - - struct array *mapping_indices(struct mapping *m) - -DESCRIPTION - This function returns an array with all the keys from the mapping m. - The keys in the array are ordered in the same order as the values - when using mapping_values. But only if no other mapping operations - are done in between. - -KEYWORDS - mapping - -SEE ALSO - mapping_values, mkmapping diff --git a/doc/internal/mappings/mapping_insert b/doc/internal/mappings/mapping_insert deleted file mode 100644 index 14f0c6c1044cec408d998b3cec9ba987ca6e9da6..0000000000000000000000000000000000000000 --- a/doc/internal/mappings/mapping_insert +++ /dev/null @@ -1,23 +0,0 @@ -NAME - mapping_insert - insert a key-value pair into a mapping - -SYNTAX - #include "mapping.h" - - void mapping_insert(struct mapping *m, - struct svalue *key, - struct svalue *value) - -DESCRIPTION - This function inserts a new key-value pair into the mapping m. - If there is a already key-value pair with the same key in the mapping - it will be replaced with the new key-value pair. If there isn't - such a key-value pair in the mapping the mapping will grow in size - to accomodate the new key-value pair. This is identical to the - Pike operation: m[key]=value - -KEYWORDS - mapping - -SEE ALSO - map_delete, low_mapping_lookup diff --git a/doc/internal/mappings/mapping_replace b/doc/internal/mappings/mapping_replace deleted file mode 100644 index f14ad3da492d4f036f5e6708aa08d4dbacfb3904..0000000000000000000000000000000000000000 --- a/doc/internal/mappings/mapping_replace +++ /dev/null @@ -1,16 +0,0 @@ -NAME - mapping_replace - replace values in a mapping - -SYNTAX - #include "mapping.h" - - void mapping_replace(struct mapping *m, - struct svalue *from, - struct svalue *to) - -DESCRIPTION - This function replaces all values of the value 'from' in the mapping - 'm' with 'to'. It is a part of the Pike function replace(). - -KEYWORDS - mapping diff --git a/doc/internal/mappings/mapping_values b/doc/internal/mappings/mapping_values deleted file mode 100644 index b0d491139dd0fcd783ef6a70be35301676f5b08b..0000000000000000000000000000000000000000 --- a/doc/internal/mappings/mapping_values +++ /dev/null @@ -1,31 +0,0 @@ -NAME - mapping_values - return all the values from a mapping - -SYNTAX - #include "mapping.h" - - struct array *mapping_values(struct mapping *m) - -DESCRIPTION - This function returns an array with all the values from the mapping m. - The values in the array are ordered in the same order as the keys - when using mapping_indices, but only if no other mapping operations - are done between the mapping_values and the mapping_indices. - -EXAMPLE - struct mapping *slow_copy_mapping(struct mapping *m) - { - struct array *indices, *values; - indices=mapping_indices(m); - values=mapping_indices(m); - m=mkmapping(indices,values); - free_array(indices); - free_array(values); - return m; - } - -KEYWORDS - mapping - -SEE ALSO - mapping_indices, copy_mapping, mkmapping diff --git a/doc/internal/mappings/mkmapping b/doc/internal/mappings/mkmapping deleted file mode 100644 index de8ce63c2d7943e8443e6567f70892d5fef1b42f..0000000000000000000000000000000000000000 --- a/doc/internal/mappings/mkmapping +++ /dev/null @@ -1,18 +0,0 @@ -NAME - mkmapping - make a mapping - -SYNTAX - #include <mapping.h> - - struct mapping *mkmapping(struct array *keys, struct array *values) - -DESCRIPTION - This function is the same as the Pike function mkmapping. It - makes a mapping out of an array of keys and an array of values. - Note that the returned mapping will have one extra reference. - -KEYWORDS - mapping - -SEE ALSO - mapping_indices, mapping_values \ No newline at end of file diff --git a/doc/internal/object/object b/doc/internal/object/object deleted file mode 100644 index 863de30448fcf32982b9fcba14a0058e2e4953d1..0000000000000000000000000000000000000000 --- a/doc/internal/object/object +++ /dev/null @@ -1,13 +0,0 @@ -NAME - object - internal representation of an object - -DESCRIPTION - Pike uses a 'struct object' with all the global variables - allocated in the same block to represent the Pike type 'object'. - An object without any global variables is only the size of 4 C - pointers. (usually 16 bytes) The only important members of the - 'struct object' are the ref counts and the pointer to the - program from which the object was cloned. - -KEYWORDS - internals diff --git a/doc/internal/pike/SETJMP b/doc/internal/pike/SETJMP deleted file mode 100644 index fc99dba109ebf6742b0332e3de09d2735f00e0ed..0000000000000000000000000000000000000000 --- a/doc/internal/pike/SETJMP +++ /dev/null @@ -1,47 +0,0 @@ -NAME - SETJMP - catch errors - -SYNTAX - #include "error.h" - - int SETJMP(JMP_BUF buf); - -DESCRIPTION - These macros are wrappers to the setjmp/longjmp routines with some - added support for cleaning up the Pike stack and other things that - might need freeing. What SETJUMP does is that it lets you catch - Pike errors much like the Pike function catch(). When called, - SETJMP returns zero, so the 'failsafe' code is executed. If an error - occurs in that code the processor will jump directly to the SETJMP - again and it will return 'true'. Then the 'error' code will be - executed. - -NOTA BENE - SETJMP is a macro - - 'buf' has to be a local variable - - There are some limitations to how you can use local variables in the - same function as setjump/longjump. See setjup(3) for more details. - -EXAMPLE - #include "error.h" - - void do_catch() - { - JMP_BUF buf; - - if(SETJMP(buf)) { - /* An error / longjump occured */ - } else { - /* Execute failsafe code here */ - } - - UNSETJMP(foo) - } - -KEYWORDS - error_handling - -SEE ALSO - throw, error, UNSETJMP, SET_ONERROR, UNSET_ONERROR diff --git a/doc/internal/pike/SET_ONERROR b/doc/internal/pike/SET_ONERROR deleted file mode 100644 index 911f7cd7c70a5c47b6196a82ddfe64dc876b9f1a..0000000000000000000000000000000000000000 --- a/doc/internal/pike/SET_ONERROR +++ /dev/null @@ -1,41 +0,0 @@ -NAME - SET_ONERROR - call this function if an error occurs - -SYNTAX - #include "error.h" - - void SET_ONERROR(ONERROR tmp, void (*func)(void *), void *arg); - -DESCRIPTION - This function sets an error handler to be called when an error - occurs. When an error occurs the function 'func' is called with - the argument 'arg'. The advantage of this method over using SETJMP - for cleanup handling is that this should be slightly faster and it - does not have problems with undefined local variables. - -NOTA BENE - SET_ONERROR is a macro - - 'tmp' has to be a local variable. - -EXAMPLE - #include "error.h" - #include "memory.h" - - void do_something() - { - ONERROR tmp; - char *mem=xalloc(4711); - - SET_ONERROR(tmp, (void (*)(void *)) free, mem); - - /* Do some code that might cause an Pike error */ - - UNSET_ONERROR(tmp); - } - -KEYWORDS - error_handling - -SEE ALSO - UNSET_ONERROR, error diff --git a/doc/internal/pike/UNSETJMP b/doc/internal/pike/UNSETJMP deleted file mode 100644 index 41a50bfb30e2c22b5a9e8c8bba34f50fd4f9612e..0000000000000000000000000000000000000000 --- a/doc/internal/pike/UNSETJMP +++ /dev/null @@ -1,12 +0,0 @@ -NAME - UNSETJMP - stop catching error - -DESCRIPTION - This macro cleans up after calling SETJMP. See the page for SETJMP - for more details. - -KEYWORDS - error_handling - -SEE ALSO - SETJMP diff --git a/doc/internal/pike/UNSET_ONERROR b/doc/internal/pike/UNSET_ONERROR deleted file mode 100644 index 9f01e649950c870f9ac70389d26144413344cf4e..0000000000000000000000000000000000000000 --- a/doc/internal/pike/UNSET_ONERROR +++ /dev/null @@ -1,12 +0,0 @@ -NAME - UNSET_ONERROR - cleanup after an SET_ONERROR - -DESCRIPTION - This function cleans up after a SET_ONERROR call. - See SET_ONERROR for more details. - -KEYWORDS - error_handling - -SEE ALSO - SET_ONERROR, SETJMP diff --git a/doc/internal/pike/data_types b/doc/internal/pike/data_types deleted file mode 100644 index 2b9f4bb4dd029240972978898bf21d39a1cad64c..0000000000000000000000000000000000000000 --- a/doc/internal/pike/data_types +++ /dev/null @@ -1,10 +0,0 @@ -NAME - data_types - Pike internal data types - -DESCRIPTION - Of course the Pike source uses a lot of data types except for those - that represents mappings, arrays, strings etc. Callbacks, stack frames - and type fields are just the beginning. - -KEYWORDS - internals diff --git a/doc/internal/pike/error b/doc/internal/pike/error deleted file mode 100644 index 8ad505563db41f35652ea2b6eac447886a0e613c..0000000000000000000000000000000000000000 --- a/doc/internal/pike/error +++ /dev/null @@ -1,21 +0,0 @@ -NAME - error - throw an error - -SYNTAX - #include "error.h" - - void error(char *format_string, ...); - -DESCRIPTION - This function takes the same kind of arguments as printf, puts it - all together to a string and throws this as an error message - togehter with a backtrace that tells the catcher where the error - was. Note that this function does _not_ return. Instead it calls - the C function lonjump and continues executing from the most - resent active catch() call. - -KEYWORDS - error_handling - -SEE ALSO - SET_ONERROR, fatal, throw diff --git a/doc/internal/pike/error_handling b/doc/internal/pike/error_handling deleted file mode 100644 index 2b70fadd4ec46bb2549640f8ae2bd05289afc832..0000000000000000000000000000000000000000 --- a/doc/internal/pike/error_handling +++ /dev/null @@ -1,21 +0,0 @@ -NAME - error_handling - how to error handling works inside Pike - -DESCRIPTION - Error handling in Pike is implemented with the setjmp/longjmp - functionality. This means that functions that can cause errors - will NOT return if an error occurs. Special care has to be taken - so that no memory is left unfreed if an error occurs. Almost all - functions that can cause Pike code to be executed can cause an - error. Also functions that implements Pike operators / functions - can cause errors. If you are paranoid you should assume that all - functions can cause errors. You may also read the code for the - function to see if there are any calls to error() in it. If the - function is documented in this manual, it will say if the function - can cause errors. - -KEYWORDS - internals - - - diff --git a/doc/internal/pike/fatal b/doc/internal/pike/fatal deleted file mode 100644 index f36e49b6d6236264aabe4839c9c32cd7d35f1629..0000000000000000000000000000000000000000 --- a/doc/internal/pike/fatal +++ /dev/null @@ -1,21 +0,0 @@ -NAME - fatal - print a message and dump core - -SYNTAX - #include "error.h" - - void fatal(char *format_string, ...); - -DESCRIPTION - This function takes the same type of argument as 'printf', and - prints these with any available debug information. (A trace of - the 512 last executed instructions if you compiled with DEBUG.) - Then it forces the driver to dump core so you can examine the - bug with a debugger. Use with extreme caution, an error() might - sometimes be a lot better... - -KEYWORDS - error_handling - -SEE ALSO - error diff --git a/doc/internal/pike/frame b/doc/internal/pike/frame deleted file mode 100644 index 3cc2e22ab40528a57d064823e42b65f6cfaa8d22..0000000000000000000000000000000000000000 --- a/doc/internal/pike/frame +++ /dev/null @@ -1,19 +0,0 @@ -NAME - frame - the current frame of exectution - -DESCRIPTION - The frame pointer is called 'fp' and is of type 'struct frame'. - The frame pointer contains information about what function we - are executing in, what is the current object, the current program, - where the local variables are etc. It also contains a pointer to - the previous frame in the call stack. The most important members - of 'fp' are: - - current_object same as the Pike function this_object() - context.program the program in which this function resides - current_storage a 'char *' pointer into the data area for this - object. This is the pointer to the area reserved - for you if you have done add_storage() earlier. - -KEYWORDS - data_types diff --git a/doc/internal/pike/throw b/doc/internal/pike/throw deleted file mode 100644 index c0163214d6780599115d598a52fdb2be4e9428f5..0000000000000000000000000000000000000000 --- a/doc/internal/pike/throw +++ /dev/null @@ -1,20 +0,0 @@ -NAME - throw - throw an exception - -SYNTAX - #include "error.h" - - int throw(void); - -DESCRIPTION - This function calls longjmp and does all the cleanup and popping - the Pike stack etc. etc. This function does not setup any error - message or backtrace like error() does. error() calls this function - after doing all that. Since this function calls longjmp, it does - not return. See SETJMP for more details. - -KEYWORDS - error_handling - -SEE ALSO - SETJMP, error diff --git a/doc/internal/pike/type_field b/doc/internal/pike/type_field deleted file mode 100644 index 05e1fec0294fd1e33a74bf50dc496f1630c29427..0000000000000000000000000000000000000000 --- a/doc/internal/pike/type_field +++ /dev/null @@ -1,20 +0,0 @@ -NAME - type_field - bit field used for optimizations - -DESCRIPTION - Type fields are used by arrays, mappings and some svalue operations - for optimization. The type field consists of OR:ed bits, one for - each type. The bit for an array is 1<<T_ARRAY (same as BIT_ARRAY) - The bit for a string is 1<<T_STRING (or BIT_STRING) etc. - - A bit field never has to be exact, it needs to have at least those - bits that are present in the operation. It is never harmful to have - too many bits though. It seldom pays off to calculate the bit field - explicitly, so if you don't know what types are involved you should - use -1 for the type field. - -KEYWORDS - data_types - -SEE ALSO - mapping, array, svalue diff --git a/doc/internal/pike/types b/doc/internal/pike/types deleted file mode 100644 index ba9074561d321ccdc75229b13e802bce4a0e82e2..0000000000000000000000000000000000000000 --- a/doc/internal/pike/types +++ /dev/null @@ -1,33 +0,0 @@ -NAME - types - how to describe types internally - -DESCRIPTION - When describing types to add_function or add_efun you always write - it in a string. You write the type just as you would in Pike. The - internal types have a few extra features though. Here is a brief - explanation of the syntax: - - type you write: - int "int" - float "float" - string "string" - mapping "mapping(mixed:mixed)" or "mapping" - array of int "array(int)" or "int *" - function(int:int) "function(int:int)" - varargs function "function(int ...:int)" - int or string "int|string" - - Then there are a few tricks you can use, say you have a function which - returns an int except if you call it with a string in which case it - return a string: - - "!function(string:mixed)&function(mixed:int)|function(string:string)" - - The & and ! operators work as you might expect but are only useful - together. - -KEYWORDS - data_types - -SEE ALSO - add_function, add_efun \ No newline at end of file diff --git a/doc/internal/program/add_function b/doc/internal/program/add_function deleted file mode 100644 index a7024554d6635ff416b240397e1618460d218a43..0000000000000000000000000000000000000000 --- a/doc/internal/program/add_function +++ /dev/null @@ -1,26 +0,0 @@ -NAME - add_function - add a function to the program - -SYNTAX - #include "program.h" - - void add_function(char *name, - void (*fun)(INT32), - char *type, - INT16 flags) - -DESCRIPTION - This function adds a function to the program you are building. - The function will have the name 'name' and the type 'type'. - The function 'fun' will be called with an integer telling it how - many arguments are on the stack and is expected to remove those - elements from the stack and replace them with a return value. - The flags are zero or more of the following or:ed together: - ID_STATIC, ID_PRIVATE, ID_NOMASK, ID_PUBLIC, ID_PROTECTED and - ID_INLINE. - -KEYWORDS - program - -SEE ALSO - start_new_program, types \ No newline at end of file diff --git a/doc/internal/program/add_storage b/doc/internal/program/add_storage deleted file mode 100644 index e9beb3cf9c317792546409ce1aef8e18add4ab29..0000000000000000000000000000000000000000 --- a/doc/internal/program/add_storage +++ /dev/null @@ -1,19 +0,0 @@ -NAME - add_storage - allocate space for object-local data - -SYNTAX - #include "program.h" - - void add_storage(INT32 size); - -DESCRIPTION - This function allocates 'size' bytes in every object cloned from the - program you are in the process of building. (Be sure to call - start_new_program first...) Whenever one of your methods are called - fp->current_storage will point to this area. - -KEYWORDS - program - -SEE ALSO - start_new_program, frame diff --git a/doc/internal/program/end_c_program b/doc/internal/program/end_c_program deleted file mode 100644 index ca7616776f79baab2898f218fda30dec9be04882..0000000000000000000000000000000000000000 --- a/doc/internal/program/end_c_program +++ /dev/null @@ -1,22 +0,0 @@ -NAME - end_c_program - finish building a 'struct program' - -SYNTAX - #include "program.h" - - struct program *end_c_program(char *name); - -DESCRIPTION - This function finishes up the process of building a 'struct program'. - It initializes the struct program and calls - master()->add_precompiled_program with the program and the suggested - name. (As sent to end_c_program). It then returns the newly built - program. Note that the new program does NOT have an extra reference, - if you want to keep it around and use it you have to add that reference - yourself. - -KEYWORDS - program - -SEE ALSO - start_new_program, add_function diff --git a/doc/internal/program/program b/doc/internal/program/program deleted file mode 100644 index f065a9bada16f531cc0628e07b52e6e1735900d1..0000000000000000000000000000000000000000 --- a/doc/internal/program/program +++ /dev/null @@ -1,16 +0,0 @@ -NAME - program - internal representation of a program - -DESCRIPTION - A 'struct program' is basically what C++ hackers call a 'class'. - It contains the byte code, information about line numbers, - global variables etc. etc. Mostly you won't have to bother with - any of the contents of a 'struct program'. Usually you only need - to create them with start_new_program()/end_c_program() or - clone them with clone(). - -SEE ALSO - frame - -KEYWORDS - internals diff --git a/doc/internal/program/set_exit_callback b/doc/internal/program/set_exit_callback deleted file mode 100644 index a548ee9b567e53537ad7c3f83023286d6607fab0..0000000000000000000000000000000000000000 --- a/doc/internal/program/set_exit_callback +++ /dev/null @@ -1,20 +0,0 @@ -NAME - set_exit_callback - set function to call att destruct() - -SYNTAX - #include "program.h" - - void set_exit_callback(void (*exit)(struct object *) fun); - -DESCRIPTION - This function sets what function will be called when an object - cloned from your program is destructed. This function is - mainly for de-initializing the fp->current_storage region. - The function will be called with the object about to be destructed - as argument. - -KEYWORDS - program - -SEE ALSO - start_new_program, set_init_callback diff --git a/doc/internal/program/set_init_callback b/doc/internal/program/set_init_callback deleted file mode 100644 index 1a0aaaef44ab3577faed9c207798f279e165e99f..0000000000000000000000000000000000000000 --- a/doc/internal/program/set_init_callback +++ /dev/null @@ -1,20 +0,0 @@ -NAME - set_init_callback - set function to call att clone() - -SYNTAX - #include "program.h" - - void set_init_callback(void (*init)(struct object *) fun); - -DESCRIPTION - This function sets what function will be called when someone - clones the struct program your are building. This function is - mainly for initializing the fp->current_storage region. - The initalizer function will be called with the newly cloned - object as argument. - -KEYWORDS - program - -SEE ALSO - start_new_program, set_exit_callback diff --git a/doc/internal/program/start_new_program b/doc/internal/program/start_new_program deleted file mode 100644 index 5750928bb6a2134d5aa9ca5c4272ed32d86e8daf..0000000000000000000000000000000000000000 --- a/doc/internal/program/start_new_program +++ /dev/null @@ -1,17 +0,0 @@ -NAME - start_new_program - start building a new 'struct program' - -SYNTAX - #include "program.h" - - void start_new_program(void); - -DESCRIPTION - This function initalizes a new 'struct program' to be be fitted - with functions, variables, inherits etc. etc. - -KEYWORDS - program - -SEE ALSO - end_c_program, add_function, add_storage diff --git a/doc/internal/strings/add_shared_strings b/doc/internal/strings/add_shared_strings deleted file mode 100644 index 7a08a2c3a3a8f57e27210972d735cd8e93126ffa..0000000000000000000000000000000000000000 --- a/doc/internal/strings/add_shared_strings +++ /dev/null @@ -1,19 +0,0 @@ -NAME - add_shared_strings - add two pike strings - -SYNTAX - #include "stralloc.h" - - struct pike_string *add_shared_strings(struct pike_string *a, - struct pike_string *b); - -DESCRIPTION - This function builds the string a+b, that is the string a with the - string b appended to it. Note that the string returned will have - an extra reference. - -KEYWORDS - pike_string - -SEE ALSO - begin_shared_string, make_shared_string \ No newline at end of file diff --git a/doc/internal/strings/begin_shared_string b/doc/internal/strings/begin_shared_string deleted file mode 100644 index 52148da8d9543bb13431b647ae7692617f3a3365..0000000000000000000000000000000000000000 --- a/doc/internal/strings/begin_shared_string +++ /dev/null @@ -1,18 +0,0 @@ -NAME - begin_shared_string - allocate space for a shared string - -SYNTAX - #include "stralloc.h" - - struct pike_string *begin_shared_string(INT32 len); - -DESCRIPTION - This function allocates space for a shared string of length 'len'. - You should then MEMCPY 'len' bytes into the s->str. (s being the - returned value) And then call end_shared_string. - -KEYWORDS - pike_string - -SEE ALSO - end_shared_string, make_shared_string diff --git a/doc/internal/strings/binary_findstring b/doc/internal/strings/binary_findstring deleted file mode 100644 index 0f34b209250c60371bd9b209f2c78d546635544d..0000000000000000000000000000000000000000 --- a/doc/internal/strings/binary_findstring +++ /dev/null @@ -1,18 +0,0 @@ -NAME - binary_findstring - find a string - -SYNTAX - #include "stralloc.h" - - struct pike_string *binary_findstring(char *str, INT32 length); - -DESCRIPTION - This function looks for the 'str' with length 'len' in the - global hash table. It returns the shared string if found, otherwise - zero. It does not increase/decrease the references to the string. - -KEYWORDS - pike_string - -SEE ALSO - findstring diff --git a/doc/internal/strings/end_shared_string b/doc/internal/strings/end_shared_string deleted file mode 100644 index 100ac2cc2c272890834d33ff9afa6b10ec4b0b5d..0000000000000000000000000000000000000000 --- a/doc/internal/strings/end_shared_string +++ /dev/null @@ -1,32 +0,0 @@ -NAME - end_shared_string - link a shared string into the hashtable - -SYNTAX - #include "stralloc.h" - - struct pike_string *end_shared_string(struct pike_string *p); - -DESCRIPTION - This function the prepared output from a begin_shared_string and - links the string into the hash table. If an identical string is - already present in the hash table, p is freed and that string is - returned instead. The returned string will have one extra reference - added. - -EXAMPLE - #include "global.h" - #include "stralloc.h" - - struct pike_string *mkcharstring(int ch) - { - struct pike_string *ret; - ret=begin_shared_string(1); - ret->str[0]=ch; - return end_shared_string(ret); - } - -KEYWORDS - pike_string - -SEE ALSO - begin_shared_string diff --git a/doc/internal/strings/findstring b/doc/internal/strings/findstring deleted file mode 100644 index dbd299a6d7de7876cc2ae3c33fe809f03240bab1..0000000000000000000000000000000000000000 --- a/doc/internal/strings/findstring +++ /dev/null @@ -1,18 +0,0 @@ -NAME - findstring - find a string - -SYNTAX - #include "stralloc.h" - - struct pike_string *findstring(char *str); - -DESCRIPTION - This function looks for the null terminated C string 'str' in the - global hash table. It returns the shared string if found, otherwise - zero. It does not increase/decrease the references to the string. - -KEYWORDS - pike_string - -SEE ALSO - make_shared_string, binary_findstring diff --git a/doc/internal/strings/free_string b/doc/internal/strings/free_string deleted file mode 100644 index 91375ea1cc689dddcf4491f5c19d7777a9916f8a..0000000000000000000000000000000000000000 --- a/doc/internal/strings/free_string +++ /dev/null @@ -1,18 +0,0 @@ -NAME - free_string - free a pike string - -SYNTAX - #include "stralloc.h" - - void free_string(struct pike_string *p) - -DESCRIPTION - This function frees the string 'p'. What it actually does is that it - decreases the reference count of 'p' and frees the memory reserved - for it if the refereneces reach zero. - -NOTA BENE - free_string is actually a macro - -KEYWORDS - pike_string diff --git a/doc/internal/strings/make_shared_binary_string b/doc/internal/strings/make_shared_binary_string deleted file mode 100644 index a455237f9a93bd9d90cc356b392290d5d21b0271..0000000000000000000000000000000000000000 --- a/doc/internal/strings/make_shared_binary_string +++ /dev/null @@ -1,19 +0,0 @@ -NAME - make_shared_binary_string - make a shared string - -SYNTAX - #include "stralloc.h" - - struct pike_string *make_shared_binary_string(const char *str, int len); - -DESCRIPTION - This function makes a shared string from the memory area beginning - at 'str' and ends at str+len. The returned string will have one - extra reference. - -KEYWORDS - pike_string - -SEE ALSO - make_shared_string, begin_shared_string, push_string, - free_string diff --git a/doc/internal/strings/make_shared_string b/doc/internal/strings/make_shared_string deleted file mode 100644 index 4560313ab450c2ca6734156060f02843736f0cbd..0000000000000000000000000000000000000000 --- a/doc/internal/strings/make_shared_string +++ /dev/null @@ -1,17 +0,0 @@ -NAME - make_shared_string - make a shared string - -SYNTAX - #include "stralloc.h" - - struct pike_string *make_shared_string(const char *str); - -DESCRIPTION - This function does the same thing as make_shared_binary_string, but - expects a zero terminated string instead. - -KEYWORDS - pike_string - -SEE ALSO - make_shared_binary_string diff --git a/doc/internal/strings/my_strcmp b/doc/internal/strings/my_strcmp deleted file mode 100644 index d38b724f667d67034318dafa811f84ab417c1907..0000000000000000000000000000000000000000 --- a/doc/internal/strings/my_strcmp +++ /dev/null @@ -1,19 +0,0 @@ -NAME - my_strcmp - my own strcmp function - -SYNTAX - #include "stralloc.h" - - int my_strcmp(struct pike_string *a, struct pike_string *b) - -DESCRIPTION - This function compares two pike strings and takes locales into - account if the system supports locales. It returns zero if the - strings are the same, a number greater than zero zero if 'a' - is greater than 'b', and a number below zero otherwise. - -KEYWORDS - pike_string - -SEE ALSO - make_shared_string \ No newline at end of file diff --git a/doc/internal/strings/pike_string b/doc/internal/strings/pike_string deleted file mode 100644 index 638334dbca7a4270c731085217621675e01f7ad8..0000000000000000000000000000000000000000 --- a/doc/internal/strings/pike_string +++ /dev/null @@ -1,18 +0,0 @@ -NAME - pike_string - internal pike shared strings - -DESCRIPTION - This is the internal type for representing pike strings. They have - ref counts and they are shared though a global hash table. The C - type is a struct pike_string that has two public members: str and - len. str is an array of char which contain the actual string. It - is guaranteed that the string is null terminated, but the string - can also contain zeroes before the end. len is of course the - length of the string. Since strings are shared you may _never_ - modify the contents of a string, except for adding/subtracting - references when approperiate. The only exception to this is when - creating a new shared string with begin_shared_string which has - not yet been linked to the hash table with end_shared_string. - -KEYWORDS - internals diff --git a/doc/internal/strings/push_string b/doc/internal/strings/push_string deleted file mode 100644 index 0b0773c04d0d46572f8f6b3e77043c4931c5f03b..0000000000000000000000000000000000000000 --- a/doc/internal/strings/push_string +++ /dev/null @@ -1,20 +0,0 @@ -NAME - push_string - push a string on the pike stack - -SYNTAX - #include "interpret.h" - - void push_string(struct pike_string *p) - -DESCRIPTION - This function pushes the string p on the pike stack. Note that this - function does _not_ add any extra references to 'p'. Most functions - that create shared strings give one extra reference to them though. - If you get your string from a function that does not add extra - references you will have to add a reference manually. - -NOTA BENE - push_string is actually a macro - -KEYWORDS - pike_string diff --git a/doc/internal/strings/string_replace b/doc/internal/strings/string_replace deleted file mode 100644 index 6532498aa226ad7247595ca3a6db2cbf8d208433..0000000000000000000000000000000000000000 --- a/doc/internal/strings/string_replace +++ /dev/null @@ -1,17 +0,0 @@ -NAME - string_replace - do string replacements - -SYNTAX - #include "stralloc.h" - - struct pike_string *string_replace(struct pike_string *str, - struct pike_string *from, - struct pike_string *to); - -DESCRIPTION - This function builds a new string from 'str' with all occurances - of 'from' replaced by 'to'. Note that the new string will have one - extra reference. - -KEYWORDS - pike_string diff --git a/doc/internal/svalue/IS_ZERO b/doc/internal/svalue/IS_ZERO deleted file mode 100644 index 52fcfe95d625533fb84165f525f961f709e7c2f5..0000000000000000000000000000000000000000 --- a/doc/internal/svalue/IS_ZERO +++ /dev/null @@ -1,20 +0,0 @@ -NAME - IS_ZERO - is this svalue considered 'false' - -SYNTAX - #include <simulate.h> - - int IS_ZERO(struct svalue *s); - -DESCRIPTION - IS_ZERO returns true if the svalue 's' is a zero. (or an object with - `! operator that returned true..) - -NOTA BENE - IS_ZERO is actually a macro - -KEYWORDS - svalue - -SEE ALSO - is_eq, is_equal, is_lt \ No newline at end of file diff --git a/doc/internal/svalue/assign_svalue b/doc/internal/svalue/assign_svalue deleted file mode 100644 index 48853e89e91004826b7f866c18cfbb49ca11e606..0000000000000000000000000000000000000000 --- a/doc/internal/svalue/assign_svalue +++ /dev/null @@ -1,18 +0,0 @@ -NAME - assign_svalue - copy svalues from one place to another - -SYNTAX - #include <svalue.h> - - void assign_svalue(struct svale *to, struct svalue *from); - -DESCRIPTION - This function copies an svalue from one struct svalue to another. - It frees the contents of 'to' first and updates the involved - refcounts. - -KEYWORDS - svalue - -SEE ALSO - free_svalue \ No newline at end of file diff --git a/doc/internal/svalue/free_svalue b/doc/internal/svalue/free_svalue deleted file mode 100644 index eaa38804b15dd682af8eac55715ab0c0bc2a88e8..0000000000000000000000000000000000000000 --- a/doc/internal/svalue/free_svalue +++ /dev/null @@ -1,18 +0,0 @@ -NAME - free_svalue - free the contents of an svalue - -SYNTAX - #include <svalue.h> - - void free_svalue(struct svalue *s); - -DESCRIPTION - This function frees the contents of an svalue with respect to - ref counts. It does not however free the storage for svalue itself. - That is up to the caller to do. - -KEYWORDS - svalue - -SEE ALSO - assign_svalue \ No newline at end of file diff --git a/doc/internal/svalue/is_eq b/doc/internal/svalue/is_eq deleted file mode 100644 index 31f7d11125ce6a88ca1dc7a5afe6dc3b1a41e9e5..0000000000000000000000000000000000000000 --- a/doc/internal/svalue/is_eq +++ /dev/null @@ -1,17 +0,0 @@ -NAME - is_eq - compare two svalues - -SYNTAX - #include <svalue.h> - - int is_eq(struct svalue *a, struct svalue *b); - -DESCRIPTION - This is the equivialent of the Pike operator `==. It compares two - svalues and returns one if they are the same. Otherwise zero. - -KEYWORDS - svalue - -SEE ALSO - is_equal, is_lt, IS_ZERO diff --git a/doc/internal/svalue/is_equal b/doc/internal/svalue/is_equal deleted file mode 100644 index e838fa2e613d30d29f970514a688e483848f9e6e..0000000000000000000000000000000000000000 --- a/doc/internal/svalue/is_equal +++ /dev/null @@ -1,18 +0,0 @@ -NAME - is_equal - compare two svalues recursively - -SYNTAX - #include <svalue.h> - - int is_equal(struct svalue *a, struct svalue *b); - -DESCRIPTION - This is the equivialent of the Pike function equal(), it compares - two svalues recursively and returns 1 if their contents are equal, - zero otherwise. - -KEYWORDS - svalue - -SEE ALSO - is_eq, is_lt, IS_ZERO diff --git a/doc/internal/svalue/is_lt b/doc/internal/svalue/is_lt deleted file mode 100644 index 64bba53876d5e765f92b6230ccb507956a91b1c5..0000000000000000000000000000000000000000 --- a/doc/internal/svalue/is_lt +++ /dev/null @@ -1,22 +0,0 @@ -NAME - is_lt - compare two svalues - -SYNTAX - #include <svalue.h> - - int is_lt(struct svalue *a, struct svalue *b); - -DESCRIPTION - This is the equivialent of the Pike operator `<. It compares the - contents of two svalues and returns true if the 'a' is lesser than - 'b'. It will give an error if the types are not comparable. - -NOTA BENE - is_gt, is_ge and is_le are also available. They are all macros that - call this function. - -KEYWORDS - svalue - -SEE ALSO - is_eq, is_equal \ No newline at end of file diff --git a/doc/internal/svalue/svalue b/doc/internal/svalue/svalue deleted file mode 100644 index 3d1f88f1b39ef7ea0126aa6163278a456b0d4f49..0000000000000000000000000000000000000000 --- a/doc/internal/svalue/svalue +++ /dev/null @@ -1,34 +0,0 @@ -NAME - svalue - internal type for storing Pike values - -DESCRIPTION - The 'struct svalue' contains one Pike 'value', variables, arrays - and the evaluator are all svalues. An svalue consists of three - elements: type, subtype and a union containing the actual value. - The type is a short which tells you what type the svalue is. The - value is one of the following: - - T_ARRAY When type is T_ARRAY, the array is stored in - the 'array' member of the union. So if sval is - the pointer to the svalue, you would use sval->u.array - to access the actual array. - T_MAPPING In this case, you use sval->u.mapping. - T_MULTISET sval->u.multiset - T_OBJECT sval->u.object - T_FUNCTION Functions are a bit more difficult, sval->u.object - is the object the function is in, and sval->subtype - is the number of the function in that object. - T_PROGRAM sval->u.program is the struct program you want. - T_STRING sval->u.string - T_FLOAT sval->u.float_number - T_INT sval->u.integer, a special case is that sval->subtype - is used in some cases to represent the value - 'undefined'. This is what zero_type detects. - - There are lots of functions operating on svalues, so you shouldn't - have to do all that much stuff with them yourself. However, for now - you do need to check the type and extract the proper member of the - union yourself when writing your own C functions for Pike. - -KEYWORDS - internals diff --git a/doc/manual/example1 b/doc/manual/example1 deleted file mode 100644 index 93f79c3a5ab63b6bfd2b372e44ad6cde050bbda6..0000000000000000000000000000000000000000 --- a/doc/manual/example1 +++ /dev/null @@ -1,141 +0,0 @@ -1. Let's write a small Pike program: - - int main() - { - write("hello world\n"); - return 0; - } - - Let's call this file hello_world.pike, and then we try to run it: - - $ pike hello_world.pike - hello world - $ - -1.1 Pretty simple, Let's see what everything means: - - int main() - - This begins the function main. Before the function name the type of value - it returns is declared, in this case 'int'. The empty space between the - parethesis indicates that this function takes no arguments. The function - main is special in the sense that it is the first function called when - your program starts. Everything your program does should start in main. - - { - write("hello world\n"); - return 0; - } - - This is the body of the function. The brackets group together a series of - statements into a block which will be executed when this function is called. - The statements aer separated by semi-colons. - - write("hello world\n"); - - The first statement is a call to the builtin function write. This will - execute the code in the function write with the arguments as input data. - In this case, the constant string "hello world\n" is sent. write() then of - course writes this string to stdout when executed. - - return 0; - - This statement aborts the function and returns the value zero. Any statements - following the return statements (not that there are any in this example) - will not be executed. - -1.2 Improving hello_world.pike - Typing 'pike hello_world.pike' to run our program may seem a bit unpractical, - fortunately, UNIX provides us with a way of automating this somewhat. - If we modify hello_world.pike to look like this: - - #!/usr/local/bin/pike - - int main() - { - write("hello world\n"); - } - - And then we tell UNIX that hello_world.pike is executable: - - $ chmod +x hello_world.pike - - Now we can run hello_world.pike without having to bother with running pike: - - $ ./hello_wold.pike - hello world - $ - - NB. The hash bang (#!) must be absolutely first in the file, no empty - lines or whitespaces can precede it for this to work. The file after - the hash bang must also be the complete filename to the pike binary, - and it may not exceed 30 characters. - -1.3 A better hello_world.pike - Now, wouldn't it be nice if it said "Hello world!" instead of "hello world" ? - But of course we don't want to make our program incompatible with the old - version. Someone might NEED the program to work the same as before. - Therefore we'll add a command line option that will make it type the old - "hello world". This is what it could look like: - - #!/usr/local/bin/pike - - int main(int argc, string *argv) - { - if(argc > 1 && argv[1]=="--traditional") - { - write("hello world\n"); // old stype - }else{ - write("Hello world!\n"); // new style - } - return 0; - } - - Let's run it: - - $ chmod +x hello_world.pike - $ ./hello_world.pike - Hello world! - $ ./hello_world.pike --traditional - hello world - $ - - What's been added? - - int main(int argc, string *argv) - - Here the space between the parentesis has been filled. What it means - is that main now takes two arguments. One is called argc, and is of the - type 'int'. The other is called 'argv' and is a 'string *'. The star - means that the argument is an array, in this case an array of strings. - - The arguments to main are taken from the command line when the Pike program - is executed. The first argument, argc, is how many words were written on - the command line (including the command itself) and argv is an array formed - by these words. - - if(argc > 1 && argv[1] == "--traditional") - { - write("hello world\n"); // old stype - }else{ - write("Hello world!\n"); // new style - } - - This is an if-else statement, it will execute what's between the first set - of brackets if the expression between the parenthesis evaluate to something - other than zero. Otherwise what's between the second set of brackets will - be executed. Let's look at that expression: - - argc > 1 && argv[1] == "--traditional" - - Loosely translated, this means: argc is greater than one and the second - element in the array argv is equal to the string "--traditional". - - Also note the comments: - - write("hello world\n"); // old stype - - The // begins a comment which continues to the end of the line. - Comments lets you type in text in the program which will be ignored by the - computer. This is to inform whoever might read your code (like yourself) of - what the program does to make it easier to understand. diff --git a/doc/manual/example2 b/doc/manual/example2 deleted file mode 100644 index 322d32ff877dd1873ee9a53deb647eb59a5498d8..0000000000000000000000000000000000000000 --- a/doc/manual/example2 +++ /dev/null @@ -1,152 +0,0 @@ -2. Now we will look at a slightly more useful example: - - #!/usr/local/bin/pike - - #include <simulate.h> - - int main(int argc,string *argv) - { - int i; - string file_contents; - - if(argc<4) - { - perror("Usage: rsif <from> <to> <files>\n"); - return 1; - } - - for(i=3; i<argc; i++) - { - if(file_contents=read_bytes(argv[i])) - { - if(-1!=strstr(file_contents,argv[1])) - { - write("Processing "+argv[i]+".\n"); - file_contents=replace(file_contents,argv[1],argv[2]); - - if( mv(argv[i],argv[i]+"~") ) - { - write_file(argv[i],file_contents); - }else{ - write("Failed to create backup file.\n"); - } - } - } - } - - return 0; - } - - This program is called 'rsif' and comes with the Pike distribution. - What it does is that it takes two strings and a bunch of files and - replaces every occurance of the first string with the second one in - each of these files. As you might have guessed 'rsif' is short for - Replace String In File. Line by line, this is how the program works: - - #!/usr/local/bin/pike - - Make UNIX run pike to interpret this program. Interpret in this case - means to read the program, convert it to an internal representation and - then run the instructions in this internal representation. Note that Pike - does not use the same low-level representation as for example C does, - instead it uses a simple and compact representation which are parsed by - a C program which actually implements the instructions in that - representation. - - #include <simulate.h> - - This includes a lot of useful functions such as read_bytes. - - int main(int argc,string *argv) - { - - Start the function main, it will return an int, and take the command line - arguments into the parameters argc and argv. - - int i; - string file_contents; - - Declare two temporary variables to use later. The first one 'i' is an - integer, and the second one 'file_contents' is a string. - - if(argc<4) - { - perror("Usage: rsif <from> <to> <files>\n"); - return 1; - } - - If argc is lesser than four it means that the program received less than - three arguments. Since rsif needs at least three arguments we write how - to use rsif to stderr (Standard error channel) using the function perror - and then exit this function with the return value 1. Nothing after the - return will be executed if argc is lesser than 4. - - - for(i=3; i<argc; i++) - { - - This statement starts a loop. (Loop means code repetition) It will first - set i to three, then execute everything within the brackets for as long as - i is lesser than argc. After each time the block between the brackets the - final statement, i++, will be executed. ++ is the increment operator, it - will increase i by one. - - if(file_contents=read_bytes(argv[i])) - { - - Look closely, the experssion in this if-statement is not a comparison, it - is in fact an assignment. Thus file will be assigned the value returned by - read_bytes. When an assignment is used as an expression it has the same - value as the left hand side of the assignment. (in this case the return - value from read_bytes) So what this does is: it reads the contents of the - file with the filename taken from argv[i] and assigns the contents to the - variable file. If there is no file with that name, zero will be returned - and then the block within the brackets will not be executed. - - if(-1!=strstr(file_contents,argv[1])) - { - - The function strstr searches for a string in in a string and returns the - first position where it is found and -1 if not. This if statement simply - checks if argv[1] (the 'from' string) is present in the file. If it is - not we won't need to do anything more about this file. The != operator - means 'not equal to'. - - write("Processing "+argv[i]+".\n"); - - Write that we are processing this file to stdout. Stdout means - "Standard output channel" and is normally your screen unless you 'redirect' - it to somewhere else. - - file_contents=replace(file_contents,argv[1],argv[2]); - - Call the builtin function replace and replace all occurances of the 'from' - string with the 'to' string and assign the new result to the variable - 'file_contents'. - - if( mv(argv[i],argv[i]+"~") ) - { - Try moving the file argv[i] to a backup file by adding a tilde to the end - of the name. Then choose action depending on weather it worked or not. - - write_file(argv[i],file_contents); - - If it worked we re-create the file argv[i] by writing the string - 'file_contents' to it. - - }else{ - write("Failed to create backup file.\n"); - - If the mv didn't work we write a message stating so to stdout. - - } - } - } - } - - return 0; - } - - - Then we end all the blocks and return zero. A return value of zero from main - indicates success, 1 or more means failiure. diff --git a/doc/manual/example3 b/doc/manual/example3 deleted file mode 100644 index a0abf20f5ac1d7acb2d5d045b9a6177f525ac91a..0000000000000000000000000000000000000000 --- a/doc/manual/example3 +++ /dev/null @@ -1,311 +0,0 @@ -3. This example is a very simple www-server. - - For you who are not familiar with WWW (World Wide Web), it works by using - client program which will fetch files from remote servers when asked. - Usually by clicking a pitcure or text. This example is a program for the - server which will send files to any computer that requests them. The - protocol used to send the file is called HTTP. (HyperText Transfer Protocol) - - Usually WWW involves HTML. HTML (HyperText Markup Language) is a way to - write documents with embedded pictures and links to other pages. These - links are normally displayed underlined and if you click them your WWW- - browser will load whatever document that link leads to. - - #!/usr/local/bin/pike - - /* A very small httpd capable of fetching files only. - * Written by Fredrik H�binette as a demonstration of Pike. - */ - - A comment, /* begins the comment, and */ ends it. - - inherit "/precompiled/port"; - - Inherit copies all the functionality of /precompiled/port into this program. - /precompiled/port makes it possible to bind a TCP (Transmission Control - Protocol, the internet stanard for computer communication) socket to accept - incoming connections. A socket is simply a number to separate communications - to and from different programs on the same computer. - - Next are some constants that will affect how uHTTPD will operate. This uses - the preprocessor directive #define. The preprocessor is the first stage in - the compiling process and can make textual processing of the code before - it is compiled. As an example, after the first define below, all occurances - of 'BLOCK' will be replaced with 16060. - - /* Amount of data moved in one operation */ - #define BLOCK 16060 - - /* Where do we have the html files ? */ - #define BASE "/home/hubbe/pike/src/" - - /* File to return when we can't find the file requested */ - #define NOFILE "/home/hubbe/www/html/nofile.html" - - /* Port to open */ - #define PORT 1905 - - A port is a destination for a TCP connection. It is simply a number on the - local computer. 1905 is not the standard port for HTTP connections though, - which means that if you want to access this WWW server from a browser you - need to specify the port like this: http://my.host.my.domain:1905/ - - Next we declare a class called output_class. A class is simply a way to - write a clonable program into another program. - - class output_class - { - inherit File : socket; - inherit File : file; - - Our new class inherits File twice. To be able to separate them - they are then named 'socket' and 'file'. - - int offset=0; - - Then there is a global variable called offset which is initalized to zero. - (each instance of this class will have it's own instance of this variable, - so it is not truly global, but..) - Note that the initalization is done when the class is cloned. (or - instanciated if you prefer C++ terminology) - - - Next we define the function write_callback(). Later the program will go - into a 'waiting' state, until something is received to process, or until - there is buffer space available to write output to. When that happens a - callback will be called to do this. The write_callback() is called when - there is buffer space available. In the following lines 'void' means that - it does not return a value. Write callback will be used further down as a - callback and will be called whenever there is room in the socket output - buffer. - - void write_callback() - { - int written; - string data; - - The following line means: call seek in the inherited program 'file'. - - file::seek(offset); - - Move the file pointer to the where we want to the position we want to read - from. The file pointer is simply a location in the file, usually it is where - the last read() ended and the next will begin. seek() can move this pointer - to where we want it though. - - data=file::read(BLOCK); - - Read BLOCK (16060) bytes from the file. If there are less that that left to - read only that many bytes will be returned. - - if(strlen(data)) - { - - If we managed to read someting... - - written=socket::write(data); - - ... we try to write it to the socket. - - if(written >= 0) - { - offset+=written; - return; - } - - Update offset if we managed to write to the socket without errors. - - werror("Error: "+socket::errno()+".\n"); - } - - If something went wront during writing, or there was nothing left to read - we destruct this instance of this class. - - destruct(this_object()); - } - - That was the end of write_callback() - - - Next we need a variable to buffer the input received in. We initialize it - to an empty string. - - string input=""; - - And then we define the function that will be called when there is something - in the socket input buffer. The first argument 'id' is declared as mixed, - which means that it can contain any type of value. The second argument is - the contents of the input buffer. - - void read_callback(mixed id,string data) - { - string cmd; - - input+=data; - - Append data to the string input. Then we check if we have received a - a complete line yet. If so we parse this and start ouputting the file. - - if(sscanf(input,"%s %s%*[\012\015 \t]",cmd,input)) - { - - This sscanf is pretty complicated, but in essense it means: put the - first word in 'input' in 'cmd' and the second in 'input' and return 2 - if successfull, 0 otherwise. - - if(cmd!="GET") - { - werror("Only method GET is supported.\n"); - destruct(this_object()); - return; - } - - If the first word isn't GET print an error message and terminate - this instance of the program. (and thus the connection) - - sscanf(input,"%*[/]%s",input); - - Remove the leading slash. - - input=combine_path(BASE,input); - - Combine the requested file with the base of the HTML tree, this gives - us a full filename beginning with a slash. The HTML tree is the - directory on the server in which the HTML files are located. Normally - all files in this directory can be accessed by anybody by using a WWW - browser. So if a user requests 'index.html' then that file name is first - added to BASE (/home/hubbe/www/html/ in this case) and if that file exists - it will be returned to the browser. - - if(!file::open(input,"r")) - { - - Try opening the file in read-only mode. If this fails, try opening NOFILE - instead. Opening the file will enable us to read it later. - - if(!file::open(NOFILE,"r")) - { - - If this fails too. Write an error message and destruct this object. - - werror("Couldn't find default file.\n"); - destruct(this_object()); - return; - } - } - - Ok, now we set up the socket so we can write the data back. - - socket::set_buffer(65536,"w"); - - Set the buffer size to 64 kilobytes. - - socket::set_nonblocking(0,write_callback,0); - - Make it so that write_callback is called when it is time to write more - data to the socket. - - write_callback(); - - Jump-start the writing. - } - } - - That was the end of read_callback(). - - - This function is called if the connection is closed while we are reading - from the socket. - void selfdestruct() { destruct(this_object()); } - - - This function is called when the program is instanciated. It is used - to set up data the way we want it. Extra arguments to clone() will be - sent to this function. In this case it is the object representing the - new connection. - - void create(object f) - { - socket::assign(f); - - We insert the data from the file f into 'socket'. - - socket::set_nonblocking(read_callback,0,selfdestruct); - - Then we set up the callback functions and sets the file nonblocking. - Nonblocking mode means that read() and write() will rather return that - wait for I/O to finish. Then we sit back and wait for read_callback to - be called. - - } - - End of create() - - }; - - End of the new class. - - - Next we define the function called when someone connects. - - void accept_callback() - { - object tmp_output; - - This creates a local variable of type 'object'. An object variable can - contain a clone of any program. Pike does not consider clones of different - programs different types. This also means that function calls to objects - have to be resolved at run time. - - tmp_output=accept(); - - The function accept clones a /precompiled/file and makes this equal to the - newly connected socket. - - if(!tmp_output) return; - - If it failed we just return. - - output_class(tmp_output); - - Otherwise we clone an instanec of 'output_class' and let it take care of the - connection. Each clone of output_class will have it's own set of global - variables, which will enable many connections to be active at the same - time without data being mixed up. Note that the programs will not actually - run simulataneously though. - - destruct(tmp_output); - - Destruct the object returned by accept(), output_class has already copied - the contents of this object. - - } - - - Then there is main, the function that gets it all started. - - int main(int argc, string *argv) - { - werror("Starting minimal httpd\n"); - - Write an encouraging message to stderr. - - if(!bind(PORT, accept_callback)) - { - werror("Failed to open socket (already bound?)\n"); - return 17; - } - - - Bind PORT and set it up to call accept_callback as soon as someone connects - to it. If the bind() fails we write an error message and return the 17 to - indicate failiure. - - return - 17; /* Keep going */ - - If everything went ok, we return -17, any negative value returned by main() - means that the program WONT exit, it will hang around waiting for events - instead. (like someone connecting) - } - - End of uhttpd.pike diff --git a/doc/manual/tutorial b/doc/manual/tutorial deleted file mode 100644 index 11e863c818e1770b33a666a47b393e2e2433b931..0000000000000000000000000000000000000000 --- a/doc/manual/tutorial +++ /dev/null @@ -1,149 +0,0 @@ -Contents - -BEGIN(What is Pike) -{ - BEGIN(Introduction) - { - Pike (Micro L.P.C., sometimes written pike or Pike) is an interpreted, - object-oriented programming language for flexible and yet efficient - application development and prototyping. It features multiple - inheritance, data abstraction, advanced built-in datatypes, such as - associative arrays, dynamic arrays and multi-sets, and high-level - character string and array operations. - } - - BEGIN(Pike vs. C and C++) - { - Pike syntax is very similar to C. Some things has also been borrowed - from C++. The certainly biggest differance is that Pike is interpreted. - This gives Pike some advantages, but also some disadvantages compared - to C: - - LIST(Advantages:) - { - No compilation times - Powerful data types - } - } - - BEGIN(Data types) - BEGIN(Object orientation) -} - -BEGIN(Getting started) -{ - BEGIN(A short example) - { - Pike - { - #!/usr/local/bin/pike - - int main() - { - write("hello world\n"); - } - } - - - Assume this file is called 'hello_world.pike', then this might be seen - at your unix prompt: - - PRE - { - $ ./hello_world.pike - hello world - $ - } - } - - BEGIN(Line by line) - { - The first line is a unix-trick which causes /usr/local/bin/pike to run - the hello world program for you when you type it's name at the unix - prompt. - - - } - - BEGIN(variables) - BEGIN(loops) -} - -BEGIN(Program structure) -{ - BEGIN(functions) - BEGIN(Loops) - { - BEGIN(while) - BEGIN(for) - BEGIN(do-while) - BEGIN(foreach) - } - BEGIN(Skips and Jumps) - { - BEGIN(if) - BEGIN(switch) - BEGIN(continue) - BEGIN(break) - } -} - -BEGIN(objects and programs) -{ - BEGIN(variable spaces) - - BEGIN(inheritance) - { - BEGIN(multiple inheritance) - } -} - - -BEGIN(data types) -{ - BEGIN(int) - { - Ints, or <integers> are simple whole numbers 0, 1, 2 ... They are fast - and used for all arethmics where fractions of numbers aren't needed. - } - BEGIN(float) - { - Floats can be used to represent any number, not just whole numbers. - Floats are slower than integers and can not be used where a whole - number is expected. (When indexing an array for instance.) Floats - are commonly used for mathematical calulations such as averages and - trigonometrics. - } - BEGIN(string) - { - Strings hold text, or more precicely; sequences of 8-bit characters. - Strings can be manipulated in many ways, the simples of which is - <indexing>; picking out the ascii value of one of the characters in - the string. - } - BEGIN(array) - { - Arrays simply hold values. - } - BEGIN(mapping) - { - Mappings, or associative arrays, work similar to arrays, but can be - indexed on any type of value, not just integers. - } - BEGIN(multiset) - { - A multiset is essentially what mathematicians call a 'set'. It is a bunch - of values without any particular order. Arrays could replace multisets - in all respects but one: multisets are much faster. - } - BEGIN(object) - { - Objects hold data. - } - BEGIN(program) - { - Programs are the templates for objects. - } -} - - diff --git a/doc/operators/and b/doc/operators/and deleted file mode 100644 index 6ec0f9676f74782530d86ca6c587b02ff5bb099c..0000000000000000000000000000000000000000 --- a/doc/operators/and +++ /dev/null @@ -1,24 +0,0 @@ -NAME - `& - intersection - -SYNTAX - a & b - or - mixed `&(mixed ... args) - -DESCRIPTION - This operator does logical intersections. For ints this means - bitwise and. - - Arrays and multisets are treated as sets, so intersecting two arrays - will result in an array with containing all values present in all - arguments. - - For mappings, the intersection will be done on the indexes solely, - however, the values will be taken from the rightmost mapping. - -KEYWORDS - operators - -SEE ALSO - `|, `^, && diff --git a/doc/operators/complement b/doc/operators/complement deleted file mode 100644 index d3d04130464495000dbedb6b56888c979358b174..0000000000000000000000000000000000000000 --- a/doc/operators/complement +++ /dev/null @@ -1,17 +0,0 @@ -NAME - `~ - bitwise complement - -SYNTAX - ~ a - or - int `~(int a) - -DESCRIPTION - This operator inverses all bits in an integer and returns the - new integer. - -KEYWORDS - operators - -SEE ALSO - `&, `|, `^ \ No newline at end of file diff --git a/doc/operators/divide b/doc/operators/divide deleted file mode 100644 index b4e22ae6b3acebf55ef2b518481ce8002e4a67c1..0000000000000000000000000000000000000000 --- a/doc/operators/divide +++ /dev/null @@ -1,31 +0,0 @@ -NAME - `/ - division - -SYNTAX - a / b - or - int `/(int a, int b) - or - float `/(int|float a,int|float b) - or - string* `/(string a,string b) - -DESCRIPTION - For ints and floats, this operator simply divide its arguments. - If the arguments are strings, the first string will be divided - at every occurance of the second string. The resulting pieces - are then returned in the form of an array. - -EXAMPLES - 2/2 returns 1 - 3/2 returns 1 - 2.0/2.0 returns 1.0 - 2.0/2 returns 1.0 - "foo"/"o" returns ({"f","",""}) - `/(2,2) returns 1 - -KEYWORDS - operators - -SEE ALSO - `*, `% diff --git a/doc/operators/index b/doc/operators/index deleted file mode 100644 index 3e1a2479a2fde84cee484415ef0d078ace79fb14..0000000000000000000000000000000000000000 --- a/doc/operators/index +++ /dev/null @@ -1,53 +0,0 @@ -NAME - index - get/set an element in an array/string/mapping/object - -SYNTAX - a [ b ] - or - a [ b ] = c - or - a -> b - -DESCRIPTION - This operator does a lookup in 'a' to find the element named 'b' in - 'a'. The last syntax (a->b) is equal to a [ "b" ]. Different usage - applies to different types. - - Strings With strings, the index operator can only be used to get values - not change them. The index must be an integer, and the return - value will be the ascii value of the corresponding character - in the string. The first character is numbered 0. - Arrays As with strings, arrays can only be indexed on integers. - However, values can also be changed by using indexing on the - left side of an assignment. The values in the array can have - any type. As with strings, the first index is 0. - Mappings Mappings can be indexed on any type of value, quite - often they are indexed on strings. Values can be changed - as with arrays. Mappings do not have a fixed size, nor do they - have a specific order in which the values are stored. If you - attempt to set a value in a mapping that does not already - exists, the mapping will grow to include the new value. - There is no 'first' index for mappings. - Multisets Multisets can be also be indexed on any value, but the return - value only reflects a true/false status depending on weather - that index was present in the multiset. As with mappings, multisets - will grow when you try to set a value in it that is does not - already exists. However multisets will only grow if the inserted - 'c' is nonzero. - Object Objects can only be indexed on strings. It then gets/sets the - value of the variable with that name. If the 'variable' isn't - a variable at all, but a function it will return a pointer to - that function but you can't change it. - -EXAMPLES - "foobar"[2] returns 111 /* ascii for 'o' */ - "foobar"[0] returns 102 /* ascii for 'f' */ - ({1,2,3})[1] returns 2 - ([1:2})[1] returns 2 - (<1,2,3>)[2] returns 1 - -KEYWORDS - operators - -SEE ALSO - index diff --git a/doc/operators/is_equal b/doc/operators/is_equal deleted file mode 100644 index 27e2062c3e6889fba869cb2baa1f098c2447dd43..0000000000000000000000000000000000000000 --- a/doc/operators/is_equal +++ /dev/null @@ -1,19 +0,0 @@ -NAME - `== - compare values - -SYNTAX - a == b - or - int `==(mixed a, mixed b) - -DESCRIPTION - This operator compares two values and returns 1 if they are the same, - 0 otherwise. Note that pointer equivialenec is required for arrays, - objects, programs, mappings and multisets. (Thus it is not enough that - two arrays LOOK alike, it must be the same array.) - -KEYWORDS - operators - -SEE ALSO - `!=, `<, `>, `<=, `>=, efuns/equal diff --git a/doc/operators/is_greater_or_equal b/doc/operators/is_greater_or_equal deleted file mode 100644 index ad0f6ab81d9ffcb122a2263db3857fd9cd9e09b2..0000000000000000000000000000000000000000 --- a/doc/operators/is_greater_or_equal +++ /dev/null @@ -1,17 +0,0 @@ -NAME - `>= - is greater than or equal to? - -SYNTAX - a >= b - or - int `>=(int|float|string a,int|float|string b) - -DESCRIPTION - This operator compares two values and returns 1 if the first one - is greater than or equal to the second one. - -KEYWORDS - operators - -SEE ALSO - `!=, `==, `>, `<, `<= diff --git a/doc/operators/is_greater_than b/doc/operators/is_greater_than deleted file mode 100644 index 3dc0726f9d35936a3b3d0667caf9e061ed1dea3f..0000000000000000000000000000000000000000 --- a/doc/operators/is_greater_than +++ /dev/null @@ -1,17 +0,0 @@ -NAME - `> - is lesser than? - -SYNTAX - a > b - or - int `>(int|float|string a,int|float|string b) - -DESCRIPTION - This operator compares two values and returns 1 if the first one - is greater than the second one. - -KEYWORDS - operators - -SEE ALSO - `!=, `==, `<, `<=, `>= diff --git a/doc/operators/is_lesser_or_equal b/doc/operators/is_lesser_or_equal deleted file mode 100644 index a15902e21fbd9ea89a56705797d30b281519168e..0000000000000000000000000000000000000000 --- a/doc/operators/is_lesser_or_equal +++ /dev/null @@ -1,17 +0,0 @@ -NAME - `<= - is lesser or equal than? - -SYNTAX - a <= b - or - int `<=(int|float|string a,int|float|string b) - -DESCRIPTION - This operator compares two values and returns 1 if the first one - is lesser than or equal to the second one. - -KEYWORDS - operators - -SEE ALSO - `!=, `==, `>, `<, `>= diff --git a/doc/operators/is_lesser_than b/doc/operators/is_lesser_than deleted file mode 100644 index 0c40c489442fd6ff09ed7b932de83032454d8ea7..0000000000000000000000000000000000000000 --- a/doc/operators/is_lesser_than +++ /dev/null @@ -1,17 +0,0 @@ -NAME - `< - is lesser than? - -SYNTAX - a < b - or - int `<(int|float|string a,int|float|string b) - -DESCRIPTION - This operator compares two values and returns 1 if the first one - is lesser than the second one. - -KEYWORDS - operators - -SEE ALSO - `!=, `==, `>, `<=, `>= diff --git a/doc/operators/logical_and b/doc/operators/logical_and deleted file mode 100644 index fcd4f4d037b03bea0dfb5cea0b8a0b199c735ae2..0000000000000000000000000000000000000000 --- a/doc/operators/logical_and +++ /dev/null @@ -1,17 +0,0 @@ -NAME - && - logical and - -SYNTAX - a && b - - -DESCRIPTION - This operator does logical 'and' between expressions. It first - evaluates a and returns zero if a is zero. Otherwise it returns - b. Note that b is not evaluated at all if a returns zero. - -KEYWORDS - operators - -SEE ALSO - `&, || diff --git a/doc/operators/logical_or b/doc/operators/logical_or deleted file mode 100644 index b7ade5bb1c35cea01206a54c12de314a8576de30..0000000000000000000000000000000000000000 --- a/doc/operators/logical_or +++ /dev/null @@ -1,17 +0,0 @@ -NAME - || - logical or - -SYNTAX - a || b - - -DESCRIPTION - This operator does logical 'or' between expressions. It first - evaluates a and returns that if a is non-zero. Otherwise it - returns b. Note that b is not evaluated at all if a is non-zero. - -KEYWORDS - operators - -SEE ALSO - `|, && diff --git a/doc/operators/minus b/doc/operators/minus deleted file mode 100644 index 4e0463575c29ebf2d6107df90ade5987036af1f7..0000000000000000000000000000000000000000 --- a/doc/operators/minus +++ /dev/null @@ -1,36 +0,0 @@ -NAME - `- - subtract/negate - -SYNTAX - - a - or - `-(mixed a); - or - a - b - or - mixed `-(mixed a, mixed b) - -DESCRIPTION - This is the negation and subtraction operator, for ints and floats - the operation should be obvious. - - For arrays, an array containing all elements present in a and not in - b is returne. The order of the remaining values from a will be kept. - - For multisets, the same operation is done as for arrays, except order is - of course not considered. - - For mappings, a mapping is returned with every key-index pair from - a whos index is not present as an index in b. - -EXAMPLES - 5-10 returns -5 - 10-2.0 returns 8.0 - ({1,2})-({2}) returns ({1}) - ([1:2,2:1])-([1:0]) returns ([2:1]) - -KEYWORDS - operators - -SEE ALSO - `+ diff --git a/doc/operators/modulo b/doc/operators/modulo deleted file mode 100644 index b9d4eec9c73c06ba702b5cc5b11d72a752a2fdb8..0000000000000000000000000000000000000000 --- a/doc/operators/modulo +++ /dev/null @@ -1,26 +0,0 @@ -NAME - `% - modulo - -SYNTAX - a % b - or - int `%(int a, int b) - or - float `%(int|float a,int|float b) - -DESCRIPTION - This operator computes the rest of a division. For integers, this - is the same as same as computing a-(a/b)*a. For floats, modulo is - interpreted as a-floor(a/b)*a - - -EXAMPLES - 9%3 returns 0 - 10%3 returns 1 - 2%0.3 returns 0.2 - -KEYWORDS - operators - -SEE ALSO - `/, `* diff --git a/doc/operators/mult b/doc/operators/mult deleted file mode 100644 index 8a5c81631c0ec77cf06451673c53c5d43bba1172..0000000000000000000000000000000000000000 --- a/doc/operators/mult +++ /dev/null @@ -1,30 +0,0 @@ -NAME - `* - multiplication - -SYNTAX - a * b - or - int `*(int ... args) - or - float `*(int|float ... args) - or - string `*(string *strings, string delimeter) - -DESCRIPTION - For ints and floats, this operator simply multiplies its arguments. - If the first argument is an array, and the second a string, all - strings in the arrays will be concatenated, with the delimiter in - between each string and the result will be returned. - -EXAMPLES - 2*2 returns 4 - 2.0*2.0 returns 4.0 - 2.0*2 returns 4.0 - ({"f","",""})*"o") Returns "foo" - `*(2,2,2) returns 8 - -KEYWORDS - operators - -SEE ALSO - `/ diff --git a/doc/operators/not b/doc/operators/not deleted file mode 100644 index 9f51725779b7fe5812876695df16949ee29a1ba9..0000000000000000000000000000000000000000 --- a/doc/operators/not +++ /dev/null @@ -1,13 +0,0 @@ -NAME - `! - is not true - -SYNTAX - ! a - or - int `!(mixed a) - -DESCRIPTION - Returns 1 if a is zero, 0 otherwise. - -KEYWORDS - operators diff --git a/doc/operators/not_equal b/doc/operators/not_equal deleted file mode 100644 index 0422fba8237c961a33b2ba4dcefac425d9b4455b..0000000000000000000000000000000000000000 --- a/doc/operators/not_equal +++ /dev/null @@ -1,19 +0,0 @@ -NAME - `!= - check if not equal - -SYNTAX - a != b - or - int `!=(mixed a, mixed b) - -DESCRIPTION - This operator compares two values and returns 0 if they are the same, - 1 otherwise. Note that pointer equivialenec is required for arrays, - objects, programs, mappings and multisets. (Thus it is not enough that - two arrays LOOK alike, it must be the same array.) - -KEYWORDS - operators - -SEE ALSO - `==, `<, `>, `<=, `>=, efuns/equal diff --git a/doc/operators/operators b/doc/operators/operators deleted file mode 100644 index c96bbf1a85176a20c2fda19374def6836d8b1621..0000000000000000000000000000000000000000 --- a/doc/operators/operators +++ /dev/null @@ -1,105 +0,0 @@ -NAME - operators - arethmics and other stuff - -DESCRIPTION - Pike has the following operators: - - a(args) function call - a[b..c] range - a[b] index - --a pre decrement - a-- post decrement - ++a pre increment - a++ post increment - (type)a cast - ~a complement - !a not - -a negate - a/b divide - a%b modulo - a*b multiply - a-b subtract - a+b add - >> shift right - << shift left - a>b greater than? - a<b lesser than? - a>=b greater or equal than? - a<=b lesser or equal than? - a!=b not equal to? - a==b equal to? - a&b intersection - a^b xor (symmetric differance) - a|b union - a&&b logical and - a||b logical or - a?b:c condition - a=b assignment - - The ones at the top of the list are parsed before operators lower - down on the list. This means that a|b&c means a|(b&c) not (a|b)&c. - Look at the individual pages for fuller explanations of what they do. - - Then there is also the @ "splice" operator which can only be used in - argument lists. - - Arguments to operators are always computed from left to right. - - Many (but not all) of these operators can also be used as by prepending - with a ` sign. For instance `+(a,b) is the same as a+b. These functions - are called "operator functions" and the following are currently - available: - - `== `!= `! `< `<= `> `>= `+ `- `& `| `^ `<< `>> `* `/ `% `~ - - These operator functions are basically "efuns", but beware, if you - re-define the `+ function a+b will also be redefined. - - On top of all this, many operators can also be overloaded. Overloading - an operator lets you specify how operators works on your objects. - To overload an operator you simply put the corresponding operator - function as a method in your object. An example: - - > program nine=class { - int `+(int arg) { return arg+9; } - }; - Result: program - > clone(nine)+1; - Result: 10 - > - - This little example defines a program that works almost like the number - nine. As you can see, clone(nine)+1 is the same as clone(nine)->`+(1) - in this case, and that is the whole point of operator overloading. - Note however that it would not have worked to write 1+clone(nine) - because operator overloading only works if the first argument is the - object with the overloaded function. Well, almost anyway, the operators - <, >, <=, >= can check both sides. In fact, the methods `<= and `>= - will never be called since Pike will translate a<=b to !(a>b). - - These are the operators you can overload: - - `== also overloads `!= - `! This is also used by if-statements to find out if the object - in question is 'true' or not. - `< also overloads `>= - `> also overloads `<= - `+ - `- - `& - `| - `^ - `<< - `>> - `* - `/ - `% - `~ - - If you also define a function __hash to return an integer, which - must be equal for all objects where `== is true you can index mappings - on the contents of your objects rather than on the object itself. - More details about this will come later. - -SEE ALSO - /precompiled/mpz diff --git a/doc/operators/or b/doc/operators/or deleted file mode 100644 index 30bd76e0c73c9b17f5ad56608a0b6292df36d9a8..0000000000000000000000000000000000000000 --- a/doc/operators/or +++ /dev/null @@ -1,24 +0,0 @@ -NAME - `| - union - -SYNTAX - a | b - or - mixed `|(mixed ... args) - -DESCRIPTION - This operator does logical unions. For ints this means bitwise or. - - Arrays and multisets are treated as sets, so doing a union on two arrays - will result in an array with containing all values present in either - array. Although values present in both ararys will only be present - once in the result. - - For mappings, the intersection will be done on the indexes solely, - however, the values will be taken from the rightmost mapping. - -KEYWORDS - operators - -SEE ALSO - `&, `^, || diff --git a/doc/operators/plus b/doc/operators/plus deleted file mode 100644 index 9ad78ab9c6860d274dbc69af6c52e475c742bd5e..0000000000000000000000000000000000000000 --- a/doc/operators/plus +++ /dev/null @@ -1,28 +0,0 @@ -NAME - `+ - add things together - -SYNTAX - a + b - or - mixed `+(mixed ... args) - -DESCRIPTION - For ints and floats this operator simply adds the two operators - together. For strings and arrays, concatenation is done. For multisets - and mapping this creates a new multiset/mapping with all indices and data as - in a and b. Note that this can cause a multiset to contain - several equal indices. Also, when adding a string to an int or float - the number is converted to a printable string first. - -EXAMPLES - "a"+10 returns "a10" - 10+20 returns 30 - ({1})+({2}) returns ({1,2}) - (<1>)+(<1>) returns (<1,1>) - `+(2,2,2) returns 6 - -KEYWORDS - operators - -SEE ALSO - `-, `* diff --git a/doc/operators/range b/doc/operators/range deleted file mode 100644 index 9159afaefb72c7ac09b3f3795b6edd1e840ee6f6..0000000000000000000000000000000000000000 --- a/doc/operators/range +++ /dev/null @@ -1,30 +0,0 @@ -NAME - range - cut a slice of an array or string - -SYNTAX - a [ b .. c ] - or - a [ .. c ] - or - a [ b .. ] - -DESCRIPTION - This operator cuts out a piece of an array or string. If a is an array - a[b..c] will return an array containing a[b], a[b+1], a[b+2] to a[c]. - Given a string about the same thing will happen, except the the result - will be a string of course. If b is omitted, everything from the - beginning up to and including c will be included. If c is omitted - the result will include everything from (and including) b to the end. - -EXAMPLES - "foobar"[0..2] returns "foo" - "foobar"[3..5] returns "bar" - ({1,2,3})[..1] returns ({1,2}) - ({1,2,3})[1..] returns ({2,3}) - ({1,2,3})[..] returns ({1,2,3}) - -KEYWORDS - operators - -SEE ALSO - index diff --git a/doc/operators/shift_left b/doc/operators/shift_left deleted file mode 100644 index 7de5c8782a45860a812a012ddaff11cb2a75f9c2..0000000000000000000000000000000000000000 --- a/doc/operators/shift_left +++ /dev/null @@ -1,17 +0,0 @@ -NAME - `<< - shift left - -SYNTAX - a << b - or - int `<<(int a, int b) - -DESCRIPTION - This operator shift the integer a b steps left. This is equal to - multiplying a by 2 b times. - -KEYWORDS - operators - -SEE ALSO - `>> diff --git a/doc/operators/shift_right b/doc/operators/shift_right deleted file mode 100644 index 8de24822ce2c6d5046f92cd8814fc27774c11341..0000000000000000000000000000000000000000 --- a/doc/operators/shift_right +++ /dev/null @@ -1,17 +0,0 @@ -NAME - `>> - shift right - -SYNTAX - a >> b - or - int `>>(int a, int b) - -DESCRIPTION - This operator shift the integer a b steps right. This is equal to - dividing a by 2 b times. - -KEYWORDS - operators - -SEE ALSO - `<< diff --git a/doc/operators/xor b/doc/operators/xor deleted file mode 100644 index ef717833d2019b4025e03fa465dab6b55f76eda9..0000000000000000000000000000000000000000 --- a/doc/operators/xor +++ /dev/null @@ -1,24 +0,0 @@ -NAME - `^ - exclusive or - -SYNTAX - a ^ b - or - mixed `^(mixed ... args) - -DESCRIPTION - This operator does logical exclusive or operations For ints this means - bitwise xor. - - Arrays and multisets are treated as sets, so xoring two arrays will - result in an array with containing all values present in either but - not both arrays. - - For mappings, the intersection will be done on the indexes solely, - however, the values will be taken from the rightmost mapping. - -KEYWORDS - operators - -SEE ALSO - `|, `& diff --git a/doc/pike/all.bmml b/doc/pike/all.bmml deleted file mode 100644 index 7cc63c0a90648db778812c05c45be913e701aeee..0000000000000000000000000000000000000000 --- a/doc/pike/all.bmml +++ /dev/null @@ -1,3 +0,0 @@ -All Pike manual pages: - - KEYWORD_LIST pages diff --git a/doc/pike/cast b/doc/pike/cast deleted file mode 100644 index 7eef957713fb3d4bbcaca3472890e8a86217db11..0000000000000000000000000000000000000000 --- a/doc/pike/cast +++ /dev/null @@ -1,45 +0,0 @@ -NAME - cast - convert one type to another - -SYNTAX - ( <type> ) <expression> - -DESCRIPTION - Casts convert types, in most cases it just tells the compiler what - type the expression has, but it can also be used to actually convert - the value of the expression into something else. - - Casting from float or int to string will convert the given number - into a decimal ascii string representation. - - Casting from string to float or int will do the opposite. IE. - Read a decimal number from the string and return that. - - Casting from string to program will call cast_to_program in the - master object and request a program to return. The standard master - object will consider the string a file name and compile the program - given by that string. It will then put the program in a chache in - case you cast the same string to a program again later. - - Castring from string to object will call cast_to_object in the - master object and request an object to return. The standard master - object will consider the string a file name, cast it to a program - and return a clone of that file. If the same cast is attempted again - later, the _same_ object will be returned. - - When casting an object, the method o->cast will be called with a string - with the name of the type as argument. o->cast can then return any - value. - - In all other cases, casts are just compiler hints. - -EXAMPLES - (program)"/precompiled/file" // returns the file program - (object)"/precompiled/file" // returns a clone of the file program - (int)(object)"/precompiled/mpz" // returns 0 - -KEYWORDS - pike - -SEE ALSO - compile_file, sscanf diff --git a/doc/pike/class b/doc/pike/class deleted file mode 100644 index 0f170dd9353e1c22433fb63951d7d99cc69a335e..0000000000000000000000000000000000000000 --- a/doc/pike/class +++ /dev/null @@ -1,21 +0,0 @@ -NAME - class - define a inlined program - -SYNTAX - class { program definition } - -DESCRIPTION - Class is a way of writing serveral programs in one file. - The program written between the brackets will be returned by - class. - -EXAMPLE - complex=clone(class { float r, i; }); - complex->r=1.0; - complex->i=1.0; - -KEYWORDS - pike - -SEE ALSO - inherit, lambda diff --git a/doc/pike/command_line_options b/doc/pike/command_line_options deleted file mode 100644 index 4a6d16a814564081dc8cb6a8cdc5fd1e4877fd66..0000000000000000000000000000000000000000 --- a/doc/pike/command_line_options +++ /dev/null @@ -1,29 +0,0 @@ -These options can be specified on the command line to Pike: - --D<define> Predefine a precompiler macro - --D<define>=<value> Predefine a precompiler macro with a speciefied value - --m<master> Use this file as master object. - You can also use the environment variable Pike_MASTER - to specify this. - --d increase debug level by 1 --d<number> set debug level - Debug level controls how much debug output is written to stderr. - Only used to debug the internals of the interpreter. - --t increase trace level by 1 --t<number> set trace level - This controls the how much trace is written, see builtin/trace for - more info. - --l increase lasdebug by 1 --l<number> set lasdebug - This controls debug output for the optimizer. - --a increase asdebug by 1 --a<number> set asdebug - This controls debug output for the code generator. - --s<number> Set evaluator stack size. diff --git a/doc/pike/control_structures/break b/doc/pike/control_structures/break deleted file mode 100644 index 28d3743f1c3f97648a6431db49bff4d400f353bd..0000000000000000000000000000000000000000 --- a/doc/pike/control_structures/break +++ /dev/null @@ -1,15 +0,0 @@ -NAME - break - break a loop or switch - -SYNTAX - break - -DESCRIPTION - Break jumps directly out of any loop or switch statement, it is - a very vital part of every switch statement. - -KEYWORDS - control - -SEE ALSO - do-while, while, for, switch diff --git a/doc/pike/control_structures/catch b/doc/pike/control_structures/catch deleted file mode 100644 index 66467304ca753db0d36b09f0e6f542d270596039..0000000000000000000000000000000000000000 --- a/doc/pike/control_structures/catch +++ /dev/null @@ -1,18 +0,0 @@ -NAME - catch - catch errors - -SYNTAX - catch { commands } - or - catch ( expression ) - -DESCRIPTION - catch traps exceptions such as run time errors or calls to throw() and - returns the argument given to throw. For a run time error, this value - is ({ "error message", backtrace }) - -KEYWORDS - control - -SEE ALSO - builtin/throw diff --git a/doc/pike/control_structures/continue b/doc/pike/control_structures/continue deleted file mode 100644 index 6326b87f81072b33ec981bea9514ab615b585985..0000000000000000000000000000000000000000 --- a/doc/pike/control_structures/continue +++ /dev/null @@ -1,15 +0,0 @@ -NAME - continue - continue a loop - -SYNTAX - continue - -DESCRIPTION - Continue work similarly to break only it does't finish the loop, - it just aborts the rest of this turn in the loop. - -KEYWORDS - control - -SEE ALSO - do-while, while, for diff --git a/doc/pike/control_structures/do-while b/doc/pike/control_structures/do-while deleted file mode 100644 index 12a91e91f1e034d658f28f5f6e8ba48da86e5d0b..0000000000000000000000000000000000000000 --- a/doc/pike/control_structures/do-while +++ /dev/null @@ -1,24 +0,0 @@ -NAME - do-while - execute a statement while an expression is true - -SYNTAX - do <statement> while ( expression ); - -DESCRIPTION - do - while only differs from the ordinary while-loop in that it does - _not_ evaluate the expression until after the statement has been - executed once. Thus it always runs the statement once. - -EXAMPLE - int i=circular_buffer_pos; - do - { - write(circular_buffer[i]); - i=(i+1) % sizeof(circular_buffer); - }while(i != circular_buffer_pos); - -KEYWORDS - control - -SEE ALSO - do - while diff --git a/doc/pike/control_structures/for b/doc/pike/control_structures/for deleted file mode 100644 index 54a2c1883a3cf0046b57f5524ee805ee3ea28b85..0000000000000000000000000000000000000000 --- a/doc/pike/control_structures/for +++ /dev/null @@ -1,28 +0,0 @@ -NAME - for - generic loop statement - -SYNTAX - for ( expression1 ; expression2 ; expression3 ) <statement> - -DESCRIPTION - the above statement is exactly equal to: - - expression1; - while( expression2 ) - { - <statement> - expression3; - } - - Except when using 'continue'. When using continue in <statement> - expresstion3 will not be called. - -EXAMPLE - int e; - for(e=0;e<10;e++) write(e+"\n"); - -KEYWORDS - control - -SEE ALSO - while, break, continue diff --git a/doc/pike/control_structures/foreach b/doc/pike/control_structures/foreach deleted file mode 100644 index d934abc05ebabd6e1002097456b47e9d7abef602..0000000000000000000000000000000000000000 --- a/doc/pike/control_structures/foreach +++ /dev/null @@ -1,19 +0,0 @@ -NAME - foreach - loop over an array - -SYNTAX - foreach ( array, variable ) statement - -DESCRIPTION - For each element in array, set variable to that value and execute - 'statement'. - -EXAMPLE - string word; - foreach( explode(sentence," "), word) foo(word); - -KEYWORDS - control - -SEE ALSO - for, while diff --git a/doc/pike/control_structures/if-else b/doc/pike/control_structures/if-else deleted file mode 100644 index d19e638c3270e30dd7fafc9e7b0e74aad7f169bb..0000000000000000000000000000000000000000 --- a/doc/pike/control_structures/if-else +++ /dev/null @@ -1,19 +0,0 @@ -NAME - if-else - run on condition - -SYNTAX - if( expression ) <statement> - or - if( expression ) <statement> else <statement> - -DESCRIPTION - If is the simplest of all control structures, in the first form - it runs the statement if the expression is true and in the second - form it runs the first statement if the expression is true and the - second if it is false. - -KEYWORDS - control - -SEE ALSO - switch diff --git a/doc/pike/control_structures/return b/doc/pike/control_structures/return deleted file mode 100644 index 43ac6e834bc02ddad0c315e4ded3a65e6eacf005..0000000000000000000000000000000000000000 --- a/doc/pike/control_structures/return +++ /dev/null @@ -1,14 +0,0 @@ -NAME - return - return from a function - -SYNTAX - return - or - return <expression> - -DESCRIPTION - Return jumps directly out of a function returning the given value to - the calling function. If no expression is given, 0 is returned. - -KEYWORDS - control diff --git a/doc/pike/control_structures/switch b/doc/pike/control_structures/switch deleted file mode 100644 index 79b4b54d595df8cf9c81d90c81fd54f3c65b033e..0000000000000000000000000000000000000000 --- a/doc/pike/control_structures/switch +++ /dev/null @@ -1,41 +0,0 @@ -NAME - switch - Complicated conditional statement - -SYNTAX - switch( expression ) - { - case constant1: - <statement1> - - case constant2: - <statement2> - break; - - case constant3..constant4: - <statement4> - break; - - default: - <statement3> - } - -DESCRIPTION - Switch evaluates the expression give and then executes one or more - statement accordingly to the result. If the result is equal to - constant1 then statement1 will be executed, please observe that - the second case-statement dos _not_ abort the execution in any way - instead statement2 will also be executed. After that break will - cause execution to continue after the after the last } in the - switch statement. If the result is equal to constant2 only - statement2 will be executed. If expression <= consant3 and - expression >= constant4, statement4 will be executed. In all other - cases statement3 is executed because it is 'default'. Please note - that the expression and constants can be any type that can be - written as a constant. Arrays, mappings and multisets have little or - no use though. - -KEYWORDS - control - -SEE ALSO - if-else, break diff --git a/doc/pike/control_structures/while b/doc/pike/control_structures/while deleted file mode 100644 index 0d2c2068d0dccfabbe47bdf548b73be903cbf144..0000000000000000000000000000000000000000 --- a/doc/pike/control_structures/while +++ /dev/null @@ -1,16 +0,0 @@ -NAME - while - execute a statement while an expression is true - -SYNTAX - while( expression ) <statement> - -DESCRIPTION - While runns the statement until the expression is false. The - expression is evaluated once for every loop. If the expression is - false the first time the statement is never executed. - -KEYWORDS - control - -SEE ALSO - for, do-while diff --git a/doc/pike/efuns.bmml b/doc/pike/efuns.bmml deleted file mode 100644 index e035e385c912a1b2b3c63c6d8408714014305189..0000000000000000000000000000000000000000 --- a/doc/pike/efuns.bmml +++ /dev/null @@ -1,3 +0,0 @@ -All builtin functions: - - KEYWORD_INDEX efuns diff --git a/doc/pike/functions b/doc/pike/functions deleted file mode 100644 index 7787cae69ce4a50a0df091954608bba3e8cceadb..0000000000000000000000000000000000000000 --- a/doc/pike/functions +++ /dev/null @@ -1,75 +0,0 @@ -NAME - functions - how to write a function - -SYNTAX - modifier type function_name (argument_specification) - { - /* function body */ - } - -DESCRIPTION - A function is basically a piece of code which takes some data - does some things, and hands some data back. Data sent to a - a function is called an 'argument'. - - This defines a function called 'function_name' returning the type - 'type'. The argument_specification is a comma separated list of - arguments. Each argument is specified with a type, whitespace and - the name of the argument. The last argument may have ... before - the name to indicate that that argument shall contain an array of - the rest of the arguments given by the caller. Note that using - ... automatically makes an the variable an array, so writing - - int foo(int * ... ints); - - means that 'ints' is an array of arrays of integers. Which might not - be what you want. - - The modifiers can be zero or more of: static, no_mask, varargs, inline - and private. Varargs means that it is ok to call the function with - less arguments that would otherwise be needed. Inline means that - the function may be inlined in other code. Inline also makes the - function no_mask. Static means that the function can not be called - from other objects. Private means that the function can not be accessed - from programs that inherits this program. - - Some times you need to use a function before it is defined, then you - can write a 'forward declaration' of the function. This is done by - copying the function definition up until (but not including) the '{' - and putting a semicolon after it. The forward declaration should be - put before the use of the function of course. - - Function definitions and forward declarations are toplevel constructs, - they can not be written inside functions or expressions. - -EXAMPLES - /* Forward declare foobar as taking an array of int as argument - *and returning an int - */ - static int foobar(int *a); - - /* This function takes a format string and any number of integers - * as argument and returns a string - */ - string dofobar(string format ,int ... rest) - { - return sprintf(format, foobar(rest)); - } - - /* Define foobar */ - static int foobar(int *a) - { - int e, ret; - ret=1; - - for(e=0;e<sizeof(a);e++) - ret*=a[e]; - - return ret; - } - -KEYWORDS - pike - -SEE ALSO - lambda, return, modifier diff --git a/doc/pike/gauge b/doc/pike/gauge deleted file mode 100644 index 528c0e037cde2a888309e97d8ecc35f259831e21..0000000000000000000000000000000000000000 --- a/doc/pike/gauge +++ /dev/null @@ -1,18 +0,0 @@ -NAME - gauge - measure system time - -SYNTAX - gauge { commands } - or - gauge ( expression ) - -DESCRIPTION - Gauge measure how much cpu time is used to execute the commands - given as arguments. The number of milliseconds used is returned - as an integer. - -KEYWORDS - control - -SEE ALSO - catch, builtin/rusage diff --git a/doc/pike/hilfe b/doc/pike/hilfe deleted file mode 100644 index 6e3b94f7ad4922953242bed6cb113d1c34021697..0000000000000000000000000000000000000000 --- a/doc/pike/hilfe +++ /dev/null @@ -1,52 +0,0 @@ -NAME - hilfe - Hubbe's Incremental Pike FrontEnd - -SYNTAX - $ hilfe - or - $ pike -Cstay hilfe - -DESCRIPTION - Hilfe is a Pike-script that supplies an incremental environment for - Pike. It allowes you to evaluate Pike 'on the fly'. If you're running - UNIX, you only have to write 'hilfe' to start it, otherwise you will - have to write 'driver -Cstay hilfe' to run it. If you don't know what - 'incremeantal' means in this context, ask you local LISP junkie. - - Hilfe has the following commands: - - quit - exit hilfe - new - clear all variables and function definition - dump - dump all current variables - . - clear input buffer - - Hilfe parses a subset of Pike, there many things it doesn't handle. Here - is a list of what you can do: - - Define a function: - <type> <name>( <arguments> ) { <statements > } - Note that hilfe simulates a function defenition by defining a variable - and setting it to the function pointer. Therefor actual typechecking is - almost nil. Also note that hilfe doesn't recognize type modifiers such - as static, private, varargs etc. - - Declare one or many global variables: - <type> <name> [=<value>], <name> [=value>] ..... ; - Hilfe simulates variable handling, and typechecking is almost nil, - therefor all global variables are declared as mixed, whatever the - <type> may be. - - Evaluate a statement: - <statement> ; - Statements include the following examples: - - for(e=0;e<10;e++) ; - - e=10; - - write(e); - - if(foo) return bar; else return gazonk; - - Statements beginning with for, while, switch, if, do or return will - not automatically return anything, and no result will be printed. diff --git a/doc/pike/how_to_make_modules b/doc/pike/how_to_make_modules deleted file mode 100644 index b182b2ed610851abb45d407c2430db90c3276909..0000000000000000000000000000000000000000 --- a/doc/pike/how_to_make_modules +++ /dev/null @@ -1,30 +0,0 @@ -This file describes briefly how to add modules with functions and programs -written in C to Pike. - -1) decide upon a name for your module -2) create a dir with this name in src/modules -3) create a configure script and a Makefile or Makefile.in in this directory - Look at the src/modules/files/configure.in and src/modules/files/Makefile.in - I recommend using autoconf 2.0 or later for creating the configure scripts. -4) Hack away - Your module needs to contain a few functions: - init_<module name>_efuns() - This function is meant to add any efuns this module wants to add, - normally this function is called before any pike is compiled, but - in the future modules might be loaded dynamically, and then this - will be called when the module is loaded. - init_<module name>_programs() - This is called after all modules has been inited and the master has - been compiled, this allows this function to call pike functions and - and add Pike programs with C functions to the pool of precompiled - programs. (see src/modules/files/file.c for an example) - exit_<module name>() - This is called when the module is unloaded, it must free any memory - allocated by the module that is not freed anywhere else. - - There will be other required functions in the future, for instanece there - will be an garbage_collect_<module name>(). - - For now you will have to look at the file module to see how C programs, - efuns and other constants are added. - diff --git a/doc/pike/inherit b/doc/pike/inherit deleted file mode 100644 index 3987ca680754e875f1982635506650cf616299f6..0000000000000000000000000000000000000000 --- a/doc/pike/inherit +++ /dev/null @@ -1,52 +0,0 @@ -NAME - inherit - use definitions from another program - -SYNTAX - inherit "<program name>"; - or - inherit "<program name>" : local_name; - -DESCRIPTION - Inherit copies the global identifiers (functions and global variables) - from the named program. These functions and variables can then be - used as if they were defined in this program. All the inherited - identifiers that was no declared as no_mask in the inherited program - can be also be redefined. The redefinition will not only - affect functions following the redefinition, but all functions in - this program, including the inherited ones. - - Even if an identifier is redefined you can still access the original - though. Prepending the identifier name with :: will return the original - identifier, OR an array of all inherited identifiers with that name. - - You can also use the local_name to access a specific identifier, just - prepend it like 'local_name::identifier'. This will return the named - identifer in the program inherited with the given local_name. If no - local_name was given to inherit , the last part of the path in the - program name will be used as local_name. - - Inherit calls master()->cast_to_program(<program name>) to get the - program to inherit. For this reason there can be no inherits in the - master object. - - Inherit is not an expression or statement, it is a toplevel construct - and must not be written inside a function body. - -EXAMPLES - /* This is file hworld.pike */ - int hello_world() { write("Hello world.\n"); } - - /* This is the file hello_world.pike */ - inherit "hworld.pike"; - - int main() - { - hello_world(); - exit(0); - } - -KEYWORDS - pike - -SEE ALSO - class diff --git a/doc/pike/lambda b/doc/pike/lambda deleted file mode 100644 index 44a5fed2e315d84ae98b4074f3f608d8b5364737..0000000000000000000000000000000000000000 --- a/doc/pike/lambda +++ /dev/null @@ -1,45 +0,0 @@ -NAME - lambda - write nameless functions - -SYNTAX - lambda(<argument specifications>) { <code> } - -DESCRIPTION - Lambda let's you write a function as a value to a function call - or anywhere where you can enter an expression. Using lambda is - basically the same as defining the function before the current - function with a temporary name and then use the name instead. - -EXAMPLES - /* These two lettersort routines are equal */ - string *lettersort(string *words) - { - return sort_array(lettersort, lambda(string a,string b) - { - return a < b; - }); - } - - int tmp_cmp_fun(string a, string b) - { - return a < b; - } - - string *lettersort(string *words) - { - return sort_array(lettersort, tmp_cmp_fun); - } - -NOTA BENE - function_name() will return something for lambda functions, - what it returns is unspecified though. - -BUGS - confuses the hell out of C indent programs - -KEYWORDS - pike - -SEE ALSO - class, function - diff --git a/doc/pike/modifier b/doc/pike/modifier deleted file mode 100644 index 8b4c92de10ae312417380ddcecda6c9baa1552df..0000000000000000000000000000000000000000 --- a/doc/pike/modifier +++ /dev/null @@ -1,17 +0,0 @@ -NAME - modifier - modify function / variable definitions - -DESCRIPTION - Modifiers makes it possible to give functions and gobal variables - certain characteristics. A list of modifiers follows: - - static make this identifier unavailable by indexing - inline allow inlining this function - private hide this identifier to inheriting programs - nomask don't allow this identifier to be re-defined - -KEYWORDS - pike - -SEE ALSO - functions, variables \ No newline at end of file diff --git a/doc/pike/preprocessor b/doc/pike/preprocessor deleted file mode 100644 index 0ec76429a6c005e8cc0b6fa9ce6a698fd4f10e11..0000000000000000000000000000000000000000 --- a/doc/pike/preprocessor +++ /dev/null @@ -1,176 +0,0 @@ -NAME - preprocessor - textually process code before compiling - -DESCRIPTION - Pike has a builtin C-style preprocessor. It works similar to old - C preprocessors but has a few extra features. This file describes - the different preprocessor directives. - -PREPROCESSOR DIRECTIVES - #! - #define - #elif - #else - #elseif - #endif - #error - #if - #ifdef - #ifndef - #include - #line - #pragma - #undef - -KEYWORDS - pike - -============================================================================ -DIRECTIVE - #! - -DESCRIPTION - This directive is in effect a comment statement, since the - preprocessor will ignore everything to the end of the line. - This is used to write unix type scripts in Pike by starting - the script with - - #!/usr/local/bin/pike -============================================================================ -DIRECTIVE - #define - -DESCRIPTION - The simplest way to use define is to write - - #define <identifier> <replacement string> - - which will cause all subsequent occurances of 'identifier' to be - replaced with the replacement string. - - Define also has the capability to use arguments, thus a line like - - #define <identifier>(arg1, arg2) <replacement string> - - would cause identifer to be a macro. All occurances of - 'identifier(something1,something2d)' would be replaced with - the replacement string. And in the replacement string, arg1 and arg2 - will be replaced with something1 and something2. - -BUGS - Note that it is not a good idea to do something like this: - - #define foo bar // a comment - - The comment will be included in the define, and thus inserted in the - code. This will have the effect that the rest of the line will be - ignored when the word foo is used. Not exactly what you might expect. - -============================================================================ -DIRECTIVE - #undef - -DESCRIPTION - This removes the effect of a #define, all subsequent occurances of - the undefined identifier will not be replaced by anything. Note that - when undefining a macro, you just give the identifer, not the - arguments. - -EXAMPLES - #define foo bar - #undef foo - #define foo(bar) gazonk bar - #undef foo -============================================================================ -DIRECTIVE - #if - #elif - #elseif - #else - #endif - -DESCRIPTION - The #if directive causes conditional compiling of code depending on - the expression after the #if directive. That is, if the expression - is true, the code up to the next #else, #elif, #elseif or #endif is - compiled. If the expression is false, that code will be skipped. - If the skip leads up to a #else, the code after the else will be - compiled. #elif and #elseif are equivialent and causes the code that - follow them to be compiled if the previous #if or #elif evaluated - false and the expression after the #elif evaluates true. - - Expressions given to #if, #elif or #endif are special, all identifiers - evaluate to zero unless they are defined to something else. Integers, - strings and floats are the only types that can be used, but all pike - operators can be used on these types. - - Also, two special functions can be used, defined() and constant(). - defined(<identifer>) expands to '1' if the identifier is defined, - '0' otherwise. constant(<identifier>) expands to '1' if identifer is - an predefined constant (with add_constant), '0' otherwise. - -EXAMPLES - #if 1 - write("foo"); - #else - write("bar"); - #endif - - #if defined(FOO) - write(FOO); - #elif defined(BAR) - write(BAR); - #else - write("default"); - #endif - - #if !constant(write_file) - inherit "simulate.pike" - #endif -============================================================================ -DIRECTIVE - #error - -DESCRIPTION - This directive causes a compiler error, it can be used to notify - the user that certain functions are missing and similar things. - -EXAMPLES - #if !constant(write_file) - #error write_file efun is missing - #endif -============================================================================ -DIRECTIVE - #include - -DESCRIPTION - This directive should be given a file as argument, it will then be - compiled as if all those lines were written at the #include line. - The compiler then continues to compile this file. - -EXAMPLES - #include "foo.h" -============================================================================ -DIRECTIVE - #line - -DESCRIPTION - This directive tells the compiler what line and file we are compiling. - This is for instance used by the #include directive to tell the - compiler that we are compiling another file. The directive takes - the line number first, and optionally, the file afterwards. - - This can also be used when generating pike from something else, to - tell teh compiler where the code originally originated from. - -EXAMPLES - #line 4 "foo.cf" /* The next line was generated from 4 in foo.cf */ -============================================================================ -DIRECTIVE - #pragma - -DESCRIPTION - This is a generic directive for flags to the compiler. Currently, the - only flag available is 'all_inline' which is the same as adding the - modifier 'inline' to all functions that follows. -============================================================================ diff --git a/doc/pike/reserved.bmml b/doc/pike/reserved.bmml deleted file mode 100644 index 7db35007f8111888d7347efef75256c2fe0f2db7..0000000000000000000000000000000000000000 --- a/doc/pike/reserved.bmml +++ /dev/null @@ -1,6 +0,0 @@ -Reserved Words - - array break case catch continue default do else float for foreach - function gauge if inherit inline int lambda mapping mixed multiset nomask - object predef private program protected public return sscanf static string - switch typeof varargs void while diff --git a/doc/pike/sscanf b/doc/pike/sscanf deleted file mode 100644 index 2ddc785129269f37308fc9be1fd8aec2b482a6df..0000000000000000000000000000000000000000 --- a/doc/pike/sscanf +++ /dev/null @@ -1,35 +0,0 @@ -NAME - sscanf - scan a string using a format string - -SYNTAX - int sscanf(string str, string fmt, mixed var1, mixed var2 ...); - -DESCRIPTION - Parse a string str using the format fmt. fmt can contain strings - separated by "%d,%s,%c and %f. Every % corresponds to one of var1, - var2... - - %d gives an integer - %o gives an octal integer - %x gives a hexadecimal integer - %D gives an integer that is either octal (leading zero), - hexadecimal (leading 0x) or decimal. - %f gives a float - %c matches one char and returns it as an integer - %2c matches two chars and returns them as an integer (short) - %s gives a string - %5s gives a string of 5 characters (5 can be any number) - %[set] matches a string containing a given set of characters. - (thos given inside the brackets) %[^set] means any character - ecept those inside brackets. %[0-9H] means any number or 'H'. - - If a * is put between the percent and the operator, the operator - will not only match it's argument, not assign any variables. - - Number of matched arguments is returned. - -KEYWORDS - string - -SEE ALSO - explode, sprintf diff --git a/doc/pike/typeof b/doc/pike/typeof deleted file mode 100644 index 78ccd6e4ee20c6725cd8f7afb04683e9aa75dfc4..0000000000000000000000000000000000000000 --- a/doc/pike/typeof +++ /dev/null @@ -1,21 +0,0 @@ -NAME - typeof - check return type of expression - -SYNTAX - typeof ( expression ) - -DESCRIPTION - This is a not really a function even if it looks like it, it returns - a human readable (almost) representation of the type that the - expression would return without actually evaluating it. - The representation is in the form of a string. - -EXAMPLE - > typeof(`sizeof); - Result: function(object | mapping | array | multiset | string : int) - > typeof(sizeof(({}))); - Result: int - > - -KEYWORDS - pike diff --git a/doc/pike/variables b/doc/pike/variables deleted file mode 100644 index 56f54040739798173d91f776d01306206a36deb6..0000000000000000000000000000000000000000 --- a/doc/pike/variables +++ /dev/null @@ -1,35 +0,0 @@ -NAME - variables - how to declare a variable - -SYNTAX - modifier type variable_name_list; - -DESCRIPTION - This is how you declare a global variable. Local variables are defined - in the same way, but you may not use any modifiers for local variables. - The variable_name_list is a comma separated list of the variables - to declare as the type 'type'. Note that '*' binds to the variable - names, not the type. This means that: - - int * i,j; - - Declares i as an array of int, but j will be declared as int. To - declare both i and j as arrays of int you have to write. - - int * i, * j; - - or - - array(int) i,j; - - Modifiers can be zero or more of: static, no_mask and private. - Private means that the variable can not be accessed from programs - that inherit this program. Static means that it can not be accessed - from other objects with the index operator. No_mask means that it - can not be redefined in inheriting programs. - -KEYWORDS - pike - -SEE ALSO - functions diff --git a/doc/precompiled/FILE b/doc/precompiled/FILE deleted file mode 100644 index 133a3fb74d86bf466152e0473e4777df4acaf11f..0000000000000000000000000000000000000000 --- a/doc/precompiled/FILE +++ /dev/null @@ -1,68 +0,0 @@ -NAME - /precompiled/FILE - buffered IO - -DESCRIPTION - /precompiled/FILE implements buffered IO and some nice functions - not available in /precompiled/file such as gets(). Almost all the - functions of /precompiled/file are present. The extra functions - are listed below: - -SEE ALSO - /precompiled/file - -============================================================================ -NAME - gets - get one line - -SYNTAX - #include <stdio.h> - - string FILE->gets(); - -DESCRIPTION - This function returns one line from the FILE, it returns zero if - no more lines are available. - -============================================================================ -NAME - printf - formatted print - -SYNTAX - #include <stdio.h> - - string FILE->printf(string format, mixed ... data); - -DESCRIPTION - This function does aproximately the same as: - FILE->write(sprintf(format,@data)) - -SEE ALSO - sprintf -============================================================================ -NAME - ungets - put a character back in the buffer - -SYNTAX - #include <stdio.h> - - string FILE->ungets(string s); - -DESCRIPTION - This function puts a string back in the input buffer. The string - can then be read with read or gets. - -============================================================================ -NAME - getchar - get one character from the input stream - -SYNTAX - #include <stdio.h> - - int FILE->getchar(); - -DESCRIPTION - This function returns one character from the input stream. Note - that the return value is the ascii value of the character, not - a string containing one character. - -============================================================================ diff --git a/doc/precompiled/condition b/doc/precompiled/condition deleted file mode 100644 index 0db7235a80dca1aef70121b35af454cff9205be6..0000000000000000000000000000000000000000 --- a/doc/precompiled/condition +++ /dev/null @@ -1,96 +0,0 @@ -NAME - /precompiled/condition - condition variables - -DESCRIPTION - /precompiled/condition is a precompiled Pike program that implements - condition variables. Condition variables are used by threaded programs - to wait for events happening in other threads. - -NOTA BENE - Mutex locks are only available on systems with POSIX threads support. - -EXAMPLE - // This program implements a fifo that can be used to send - // data between two threads. - inherit "/precompiled/condition": r_cond; - inherit "/precompiled/condition": w_cond; - inherit "/precompiled/mutex": lock; - - mixed *buffer = allocate(128); - int r_ptr, w_ptr; - - int query_messages() { return w_ptr - r_ptr; } - - // This function reads one mixed value from the fifo. - // If no values are available it blocks until a write has been done. - mixed read() - { - mixed tmp; - // We use this mutex lock to make sure no write() is executed - // between the query_messages and the wait() call. If it did - // we would wind up in a deadlock. - object key=lock::lock(); - while(!query_messages()) r_cond::wait(key); - tmp=buffer[r_ptr++ % sizeof(buffer)]; - w_cond::signal(); - return tmp; - } - - // This function pushes one mixed value on the fifo. - // If the fifo is full it blocks until a value has been read. - void write(mixed v) - { - object key=lock::lock(); - while(query_messages() == sizeof(buffer)) w_cond::wait(key); - buffer[w_ptr++ % sizeof(buffer)]=v; - r_cond::signal(); - } - -SEE ALSO - /precompiled/mutex - -============================================================================ -NAME - wait - wait for condition - -SYNTAX - void condition->wait(); - or - void condition->wait(object mutex_key); - -DESCRIPTION - This function makes the current thread sleep until the condition - variable is signalled. The optional argument should be the 'key' - to a mutex lock. If present the mutex lock will be unlocked before - waiting for the condition in one atomical operation. After waiting - for the condition the mutex referenced by mutex_key will be re-locked. - -SEE ALSO - mutex->lock - -============================================================================ -NAME - signal - signal a condition variable - -SYNTAX - void condition->signal(); - -DESCRIPTION - Signal wakes up one of the threads currently waiting for the - condition. - -BUGS - It sometimes wakes up more than one thread. - -============================================================================ -NAME - broadcast - signal all waiting threads - -SYNTAX - void condition->broadcast(); - -DESCRIPTION - This function wakes up all threads currently waiting for this - condition. - -============================================================================ diff --git a/doc/precompiled/fifo b/doc/precompiled/fifo deleted file mode 100644 index 3d83d9f88ded53ebd489c089a93335c7eee957cb..0000000000000000000000000000000000000000 --- a/doc/precompiled/fifo +++ /dev/null @@ -1,73 +0,0 @@ -NAME - /precompiled/fifo - first in, first out object - -DESCRIPTION - /precompiled/fifo implements a fixed length fifo. A fifo is a queue - of values and is often used as a stream of data between two threads. - -SEE ALSO - /precompiled/queue - -NOTA BENE - Fifos are only available on systems with POSIX threads support. - -============================================================================ -NAME - create - initialize the fifo - -SYNTAX - #include <fifo.h> - - void fifo->create(int size); - or - clone(Fifo); - or - clone(Fifo,size); - -DESCRIPTION - The function create() is called when the fifo is cloned, if the - optional size argument is present it sets how many values can be - written to the fifo without blocking. The default size is 128. - -============================================================================ -NAME - write - queue a value - -SYNTAX - #include <fifo.h> - - void fifo->write(mixed value); - -DESCRIPTION - This function puts a value last in the fifo. If there is no more - room in the fifo the current thread will sleep until space is - available. - -============================================================================ -NAME - read - read a value from the fifo - -SYNTAX - #include <fifo.h> - - mixed fifo->read(); - -DESCRIPTION - This function retreives a value from the fifo. Values will be - returned in the order they were written. If there are no values - present in the fifo the current thread will sleep until some other - thread writes a value to the fifo. - -============================================================================ -NAME - size - return number of values in fifo - -SYNTAX - #include <fifo.h> - - int fifo->size(); - -DESCRIPTION - This function returns how many values are currently in the fifo. - -============================================================================ diff --git a/doc/precompiled/mutex b/doc/precompiled/mutex deleted file mode 100644 index 42e3d80e0e1085279e046c1bdb6208a1dbaa85dc..0000000000000000000000000000000000000000 --- a/doc/precompiled/mutex +++ /dev/null @@ -1,41 +0,0 @@ -NAME - /precompiled/mutex - mutex locks - -DESCRIPTION - /precompiled/mutex is a precompiled Pike program that implements - mutal exclusion locks. Mutex locks are used to prevent multiple - threads from simultaneously execute sections of code which accesses - or changes shared data. The basic operations for a mutex is locking - and unlocking, if a thread attempts to lock an already locked mutex - the thread will sleep until the mutex is unlocked. - -NOTA BENE - Mutex locks are only available on systems with POSIX threads support. - -============================================================================ -NAME - lock - lock the mutex - -SYNTAX - object mutex->lock(); - -DESCRIPTION - This function attempts to lock the mutex, if the mutex is already - locked current thread will sleep until the lock is unlocked by some - other thread. The value returned is the 'key' to the lock, which the - key is destructed or has no more references the lock will automatically - be unlocked. - -============================================================================ -NAME - trylock - try to lock the mutex - -SYNTAX - object mutex->trylock(); - -DESCRIPTION - This function preforms the same operation as lock(), but if the mutex - is already locked zero will be returned instead of sleeping until the - lock is unlocked. - -============================================================================ diff --git a/doc/precompiled/queue b/doc/precompiled/queue deleted file mode 100644 index 0778f80873741ccf140525866535966109af60bc..0000000000000000000000000000000000000000 --- a/doc/precompiled/queue +++ /dev/null @@ -1,56 +0,0 @@ -NAME - /precompiled/queue - a queue of values - -DESCRIPTION - /precompiled/queue implements a queue, or fifo. The main differance - between /precompiled/queue and /precompiled/fifo is that queues - will never block in write, only allocate more memory. - -SEE ALSO - /precompiled/fifo - -NOTA BENE - Queues are only available on systems with POSIX threads support. - -============================================================================ -NAME - write - queue a value - -SYNTAX - #include <fifo.h> - - void queue->write(mixed value); - -DESCRIPTION - This function puts a value last in the queue. If the queue is - to small to hold the value the queue will be expanded to make - room for it. - -============================================================================ -NAME - read - read a value from the queue - -SYNTAX - #include <fifo.h> - - mixed queue->read(); - -DESCRIPTION - This function retreives a value from the queue. Values will be - returned in the order they were written. If there are no values - present in the queue the current thread will sleep until some other - thread writes a value to the queue. - -============================================================================ -NAME - size - return number of values in queue - -SYNTAX - #include <fifo.h> - - int queue->size(); - -DESCRIPTION - This function returns how many values are currently in the queue. - -============================================================================ diff --git a/doc/precompiled/sql b/doc/precompiled/sql deleted file mode 100644 index 67063392b3b22178184f31db2669a0de6df8d921..0000000000000000000000000000000000000000 --- a/doc/precompiled/sql +++ /dev/null @@ -1,334 +0,0 @@ -NAME - Sql.sql - Generic interface to SQL databases (ALPHA) - -DESCRIPTION - Sql.sql is a program in the Sql module. It enables access - to SQL databases from within Pike. - -NOTA BENE - To use this module you need at least one specific SQL-module e.g. - Mysql.mysql or Msql.msql. - -KEYWORDS - sql, database - -SEE ALSO - Mysql.mysql, Msql.msql - - -============================================================================ -NAME - create - connect to an SQL database - -SYNTAX - #include <sql.h> - - object(sql) sql(); - or - object(sql) sql(object obj); - or - object(sql) sql(object obj, string database); - or - object(sql) sql(string hostname); - or - object(sql) sql(string hostname, string database); - or - object(sql) sql(string hostname, string database, string user); - or - object(sql) sql(string hostname,string database, - string user, string password); - -DESCRIPTION - To access a database, you must first connect to it. This is - done with the function sql(). - - If the first argument is an object, access to the SQL-database will - go through that object. - - Otherwise all currently available programs named /precompiled/sql/* - will be tried in turn to get a successfull connection. - - If hostname is "" or 0 (zero) access to the SQL-database will be - done through a UNIX-domain socket. Otherwise communication will - be through TCP/IP or similar to the named host. - - If database is not "" or 0 (zero) that database will be selected. - - user and password are used for access-control to the SQL-database. - -EXAMPLE - /* Connect to the database "test" and dump the table "db" */ - - #include <sql.h> - #include <mysql.h> - - int main() - { - /* First: Do it with the first available SQL-server */ - - object(sql) sql_connection = sql(0, "test"); - - write(sprintf("sql: %O\n", - sql_connection->query("select * from db"))); - - /* Second: Use the Mysql-server */ - sql_connection = sql(mysql(), "test"); - - write(sprintf("mysql: %O\n", - sql_connection->query("select * from db"))); - } - -SEE ALSO - sql->query - - -============================================================================ -NAME - error - report the last error from the underlying SQL module - -SYNTAX - #include <sql.h> - - string sql->error(); - -DESCRIPTION - When a SQL-method fails you may get a decription of why with - this function. - - -============================================================================ -NAME - select_db - select database - -SYNTAX - #include <sql.h> - - void select_db(string database); - -DESCRIPTION - Most SQL-servers can hold several databases. You select which one - you want to access with this function. - -SEE ALSO - Sql, sql->create_db, sql->drop_db - - -============================================================================ -NAME - query - make an SQL query - -SYNTAX - #include <sql.h> - - int|array(mapping(string:mixed)) sql->query(string q); - -DESCRIPTION - This function sends an SQL query to the underlying SQL-server. The - result is returned as an array of mappings indexed on the name of - the columns. Returns 0 if the query didn't return any result (e.g. - INSERT or similar). - -SEE ALSO - sql->big_query - - -============================================================================ -NAME - big_query - make an SQL query (advanced version) - -SYNTAX - #include <sql.h> - - object(sql_result) sql->big_query(string q); - -DESCRIPTION - This function sends an SQL query to the underlying SQL-server. The - result is returned as a Sql.sql_result object. This allows for - having results larger than the available memory, and returning some - more info on the result. Returns 0 if the query didn't return any - result (e.g. INSERT or similar). - -SEE ALSO - sql->query, Sql.sql_result - - -============================================================================ -NAME - create_db - create a new database - -SYNTAX - #include <sql.h> - - void sql->create_db(string database) - -DESCRIPTION - This function attempts to create a new database in the SQL-server. - -SEE ALSO - sql->select_db, sql->drop_db - - -============================================================================ -NAME - drop_db - drop a database - -SYNTAX - #include <sql.h> - - void sql->drop_db(string database) - -DESCRIPTION - This function attempts to drop the named database from the - SQL-server. - -SEE ALSO - sql->select_db, sql->create_db - - -============================================================================ -NAME - shutdown - shutdown the SQL server - -SYNTAX - #include <sql.h> - - void sql->shutdown(); - -DESCRIPTION - This function attempts to shutdown the SQL-server. - -SEE ALSO - sql->reload - - -============================================================================ -NAME - reload - reload the tables - -SYNTAX - #include <sql.h> - - void sql->reload(); - -DESCRIPTION - If possible the tables will be reloaded by the SQL-server. - -SEE ALSO - sql->shutdown - - -============================================================================ -NAME - server_info - give information about the current SQL server - -SYNTAX - #include <sql.h> - - string sql->server_info(); - -DESCRIPTION - This function returns version information about the SQL-server. - -SEE ALSO - sql->host_info - - -============================================================================ -NAME - host_info - give information about the SQL-server connection - -SYNTAX - #include <sql.h> - - string sql->host_info(); - -DESCRIPTION - This function returns a string describing the connection to the - SQL-server. - -SEE ALSO - sql->server_info - - -============================================================================ -NAME - list_dbs - list available databases from this SQL server - -SYNTAX - #include <sql.h> - - array(mapping(string:string)) list_dbs(); - or - array(mapping(string:string)) list_dbs(string wild); - -DESCRIPTION - Returns an array with mappings containing the names of the - databases in this SQL-server. - - If wild is specified, only those matching it are returned. - -NOTA BENE - Might be better to return just an array(string), and skip the - mapping part. - -SEE ALSO - sql->list_tables, sql->list_fields - - -============================================================================ -NAME - list_tables - list available tables in this database - -SYNTAX - #include <sql.h> - - array(mapping(string:string)) list_tables(); - or - array(mapping(string:string)) list_tables(); - -DESCRIPTION - Returns an array with mappings containing the names of the - tables in the current database. - - If wild is specified, only those matching it are returned. - -NOTA BENE - Might be better to return just an array(string), and skip the - mapping part. - -SEE ALSO - sql->list_dbs, sql->list_fields - - -============================================================================ -NAME - list_fields - list names of all fields in a table - -SYNTAX - #include <sql.h> - - array(mapping(string:mixed)) list_fields(string table); - or - array(mapping(string:mixed)) list_fields(string table, string wild); - -DESCRIPTION - Returns an array of mappings containing data about the fields - in the specified table. - - If wild is specified, only those fields matching it are returned. - - The mappings contain at least the following entries: - - "name": string The name of the field. - "table": string The name of the table. - "default": mixed The default value for the field. - "type": string The type of the field. - -NOTA BENE - Might be better to return just an array(string), and skip the - mapping part. - -SEE ALSO - sql->list_dbs, sql->list_tables, - sql_result->fetch_fields - diff --git a/doc/precompiled/sql_result b/doc/precompiled/sql_result deleted file mode 100644 index 0f77b04ba79c4c7b08aea9f245da18ccb4f320dc..0000000000000000000000000000000000000000 --- a/doc/precompiled/sql_result +++ /dev/null @@ -1,160 +0,0 @@ -NAME - Sql.sql_result - generic SQL result from a big_query (ALPHA) - -DESCRIPTION - Sql.sql_result is a precompiled Pike program. It usually - contains the result from an SQL-query. It acts as a wrapper for - e.g. Mysql.mysql_result and Msql.msql_result. - -KEYWORDS - sql, database - -SEE ALSO - Mysql.mysql_result, Msql.msql_result - - -============================================================================ -NAME - create - make a new sql_result object - -SYNTAX - #include <sql.h> - - object(sql_result) sql_result(object res); - or - object(sql_result) sql_result(array(mapping(string:mixed)) res); - or - object(sql_result) sql->big_query(string q); - -DESCRIPTION - The first two functions generate a sql_result object from an - existing result. The second makes it from the result of the - SQL-query q. - -SEE ALSO - sql->big_query, Sql.sql - - -============================================================================ -NAME - num_rows - number of rows in the result - -SYNTAX - #include <sql.h> - - int sql_result->num_rows(); - -DESCRIPTION - Returns the number of rows in the result. - -SEE ALSO - sql_result->num_fields - - -============================================================================ -NAME - num_fields - number of fields in the result - -SYNTAX - #include <sql.h> - - int sql_result->num_fields(); - -DESCRIPTION - Returns the number of fields in the result. - -SEE ALSO - sql_result->num_rows - - -============================================================================ -NAME - eof - at end of result table - -SYNTAX - #include <sql.h> - - int sql_result->eof(); - -DESCRIPTION - Returns non-zero when all rows have been read. - -SEE ALSO - sql_result->fetch_row, sql_result->seek - - -============================================================================ -NAME - fetch_fields - return specification of fields - -SYNTAX - #include <sql.h> - - array(int|mapping(string:mixed)) sql_result->fetch_field(); - -DESCRIPTION - Returns an array of mappings with information about the fields - in the sql_result. - - The mappings may contain these fields: - - "name": string The name of the field. - "table": string The name of the table. - "type": string The type of the field. - "length": int The length of the field. - "max_length": int The length of the longest element in this field. - "flags": int Some flags (Server specific). - "decimals": int The number of decimalplaces. - - The only field guaranteed to exist is "name". - - The type of the field can be any of: - "decimal", "char", "short", "long", "float", "double", "null", - "time", "longlong", "int24", "tiny blob", "medium blob", - "long blob", "var string", "string" or "unknown". - -BUGS - The "flags" entry should be parsed. - - Maybe too stringent definition of the type-field. - -SEE ALSO - sql->list_fields - - -============================================================================ -NAME - seek - skip ahead a number of rows - -SYNTAX - #include <sql.h> - - void sql_result->seek(int skip); - -DESCRIPTION - Skips ahead the specified number of rows. - -NOTA BENE - Only seeking ahead is supported. - -SEE ALSO - sql_result->fetch_row - - -============================================================================ -NAME - fetch_row - fetch the next row from the result - -SYNTAX - #include <sql.h> - - int|array(string|int) sql_result->fetch_row(); - -DESCRIPTION - Returns an array with the contents of the next row of the result. - Advances the row cursor to the next row. Returns 0 (zero) at the - end of the table. - -SEE ALSO - sql_result->seek - diff --git a/doc/precompiled/stack b/doc/precompiled/stack deleted file mode 100644 index 8ea6d3121a2b1e4d86d14b5445cc60dbc803de6d..0000000000000000000000000000000000000000 --- a/doc/precompiled/stack +++ /dev/null @@ -1,48 +0,0 @@ -NAME - /precompiled/stack - generic stack - -DESCRIPTION - /precompiled/stack is a Pike program that implements a generic stack. - The stack can hold any amount of values. - - Only three methods are available: push(), pop() and reset() - -============================================================================ -NAME - push - push a value on the stack - -SYNTAX - #include <stack.h> - - void stack->push(mixed value) - -DESCRIPTION - This function pushes a value on top of the stack. There is always - room for more values on the stack. (Until you run out of memory.) - -============================================================================ -NAME - pop - pop a value off the stack - -SYNTAX - #include <stack.h> - - mixed stack->pop() - -DESCRIPTION - This function pops the topmost value off the stack. If there are - no values left on the stack a 'stack underflow' error is generated. - -============================================================================ -NAME - reset - remove all values from the stack - -SYNTAX - #include <stack.h> - - void stack->reset() - -DESCRIPTION - This function simply returns the stack to it's original state: empty. - -============================================================================ diff --git a/doc/precompiled/string_buffer b/doc/precompiled/string_buffer deleted file mode 100644 index 61379133aba2087cabfa77fc04f382567c936996..0000000000000000000000000000000000000000 --- a/doc/precompiled/string_buffer +++ /dev/null @@ -1,54 +0,0 @@ -NAME - /precompiled/string_buffer - incremental string buffer - -DESCRIPTION - string_buffer implements a fast way to build strings by appending - strings or chars to the end of the buffer. - -BUGS - This object is not thread-safe, if several threads access the same - buffer they have to protect the accesses with mutex locks. - -============================================================================ -NAME - flush - flush the contents of the buffer - -SYNTAX - #include <string.h> - - void string_buffer->flush(); - -DESCRIPTION - This function empties the string buffer. You don't need to call this - function if you use the string buffer only once since the start - state for a string buffer is flushed. - -============================================================================ -NAME - append - append a string to the buffer - -SYNTAX - #include <string.h> - - void string_buffer->append(string s); - -DESCRIPTION - This function appends the string s to the end of the buffer. - -============================================================================ -NAME - get_buffer - get the contents of the buffer as a string. - -SYNTAX - #include <string.h> - - mixed string_buffer->get_buffer(); - or - (string)string_buffer; - -DESCRIPTION - This function retreives the content of the buffer. Note that it does - not clear the contents of the buffer. You have to do that yourself - with create(). - -============================================================================ diff --git a/doc/simulated/PI b/doc/simulated/PI deleted file mode 100644 index b4828c600fe8a113a106b30a7b90a2cf1d947d05..0000000000000000000000000000000000000000 --- a/doc/simulated/PI +++ /dev/null @@ -1,13 +0,0 @@ -NAME - PI - pi - -SYNTAX - #include <simulate.h> - - PI - -DESCRIPTION - This is not a function, it is a constant added by simulate.pike. - -KEYWORDS - float diff --git a/doc/simulated/add_efun b/doc/simulated/add_efun deleted file mode 100644 index 4ccfe6f2945984ce08049f15e024de1185dbf3d1..0000000000000000000000000000000000000000 --- a/doc/simulated/add_efun +++ /dev/null @@ -1,15 +0,0 @@ -NAME - add_efun - add an efun or constant - -SYNTAX - #include <simulate.h> - - void add_efun(string func_name, mixed function) - or - void add_efun(string func_name) - -DESCRIPTION - This function is the same as add_constant. - -SEE ALSO - builtin/add_constant diff --git a/doc/simulated/aggregage_list b/doc/simulated/aggregage_list deleted file mode 100644 index 8ebb81efedcb4e2c0299d0de3849e48d16e95acf..0000000000000000000000000000000000000000 --- a/doc/simulated/aggregage_list +++ /dev/null @@ -1,13 +0,0 @@ -NAME - aggregage_list - aggregate a multiset - -SYNTAX - #include <simulate.h> - - multiset aggregage_list(mixed ... args); - -DESCRIPTION - This function is exactly the same as aggregate_multiset. - -SEE ALSO - builtin/aggregate_multiset diff --git a/doc/simulated/all_efuns b/doc/simulated/all_efuns deleted file mode 100644 index d436be0c309eba9d774033505d0a0cc58ffd7ed5..0000000000000000000000000000000000000000 --- a/doc/simulated/all_efuns +++ /dev/null @@ -1,13 +0,0 @@ -NAME - all_efuns - return all 'efuns' - -SYNTAX - #include <simulate.h> - - mapping all_efuns(); - -DESCRIPTION - This function is the same as all_constants. - -SEE ALSO - all_constants diff --git a/doc/simulated/capitalize b/doc/simulated/capitalize deleted file mode 100644 index 10b360340101031dd17ae8f823f882fba9a3be45..0000000000000000000000000000000000000000 --- a/doc/simulated/capitalize +++ /dev/null @@ -1,17 +0,0 @@ -NAME - capitalize - capitalize a string - -SYNTAX - #include <simulate.h> - - string capitalize(string str) - -DESCRIPTION - Convert the first character in str to upper case, and return the - new string. - -KEYWORDS - string - -SEE ALSO - builtin/lower_case, builtin/upper_case diff --git a/doc/simulated/describe_backtrace b/doc/simulated/describe_backtrace deleted file mode 100644 index e0e89c1de8f8af3800366544345ad5d503e0e032..0000000000000000000000000000000000000000 --- a/doc/simulated/describe_backtrace +++ /dev/null @@ -1,15 +0,0 @@ -NAME - describe_backtrace - make a backtrace readable - -SYNTAX - #include <simulate.h> - - string describe_backtrace(mixed **backtrace); - -DESCRIPTION - Describe backtrace returns a string containing a readable message - that describes where the backtrace was made. The argument 'backtrace' - should normally be the return value from a call to backtrace() - -SEE ALSO - builtin/backtrace diff --git a/doc/simulated/exec b/doc/simulated/exec deleted file mode 100644 index ef2397aad600443ab4f3d0854eae39c8e9aaf2f4..0000000000000000000000000000000000000000 --- a/doc/simulated/exec +++ /dev/null @@ -1,17 +0,0 @@ -NAME - exec - simple way to use exece() - -SYNTAX - #include <process.h> - - int exec(string file, string ... args); - -DESCRIPTION - This function destroys the Pike parser and runs the program - 'file' instead with the arguments. If no there are no '/' in - the filename, the variable PATH will be consulted when looking - for the program. This function does not return except when - the exec fails for some reason. - -EXAMPLE - exec("/bin/echo","hello","world"); diff --git a/doc/simulated/explode b/doc/simulated/explode deleted file mode 100644 index 45a64030b0c0e5348f5f0f3ee47ed8e010ea7de3..0000000000000000000000000000000000000000 --- a/doc/simulated/explode +++ /dev/null @@ -1,31 +0,0 @@ -NAME - explode - explode a string on a delimeter - -SYNTAX - #include <simulate.h> - - string *explode(string victim, string delimeter); - -DESCRIPTION - Explode divides the string called victim at every occurance of - the string delimeter and returns the resulting parts in an array. - If delimeter is an empty string, victim will be divided into strings - of length 1. - - Explode is the same as division. - -EXAMPLES - > explode("foobar","o"); - Result: ({ "f", "", "bar" }) - > explode("10101001010100010101","10"); - Result: ({ "", "", "", "0", "", "", "00", "", "1" }) - > explode("/foo/bar/gazonk","/"); - Result: ({ "", "foo", "bar", "gazonk" }) - > explode("foobar",""); - Result: ({ "f", "o", "o", "b", "a", "r" }) - -KEYWORDS - string - -SEE ALSO - implode, `/ diff --git a/doc/simulated/file_size b/doc/simulated/file_size deleted file mode 100644 index d426b2043a48bc3e8b17be5d812ef6fe4702841e..0000000000000000000000000000000000000000 --- a/doc/simulated/file_size +++ /dev/null @@ -1,18 +0,0 @@ -NAME - file_size - return the size of a file in bytes - -SYNTAX - #include <stdio.h> - - int file_size(string file); - -DESCRIPTION - Give the size of a file. Size -1 indicates that the file either - does not exist, or that it is not readable by you. Size -2 - indicates that it is a directory. - -KEYWORDS - file - -SEE ALSO - write_file, read_bytes diff --git a/doc/simulated/filter b/doc/simulated/filter deleted file mode 100644 index 4b3ed8fc092996ab0a5bb794591647a8bae98d08..0000000000000000000000000000000000000000 --- a/doc/simulated/filter +++ /dev/null @@ -1,30 +0,0 @@ -NAME - filter - filter an array or mapping through a function - -SYNTAX - #include <array.h> - - mixed *filter(mixed arr,function fun,mixed ... args); - or - mixed *filter(object *arr,string fun,mixed ... args); - or - mixed *filter(function *arr,-1,mixed ... args); - -DESCRIPTION - First syntax: - Filter array returns an array holding the items of arr for which - fun returns true. - - Second syntax: - Filter array calls fun in all the objects in the array arr, and - return all objects that returned true. - - Third syntax: - Filter array calls all functionpointers in the array arr, and - return all that returned true. - -KEYWORDS - array - -SEE ALSO - sum_arrays, map diff --git a/doc/simulated/filter_array b/doc/simulated/filter_array deleted file mode 100644 index 2c5f2a7dd0e3be4d6aa3e5cd21fd34c509fa8265..0000000000000000000000000000000000000000 --- a/doc/simulated/filter_array +++ /dev/null @@ -1,20 +0,0 @@ -NAME - filter_array - filter an array through a function - -SYNTAX - #include <simulate.h> - - mixed *filter_array(mixed *arr,function fun,mixed ... args); - or - mixed *filter_array(object *arr,string fun,mixed ... args); - or - mixed *filter_array(function *arr,-1,mixed ... args); - -DESCRIPTION - Filter array is the same function as filter. - -KEYWORDS - array - -SEE ALSO - sum_arrays, map_array, filter diff --git a/doc/simulated/find_option b/doc/simulated/find_option deleted file mode 100644 index 83671cf06a12058f245f3718b73955b8b2e517f0..0000000000000000000000000000000000000000 --- a/doc/simulated/find_option +++ /dev/null @@ -1,48 +0,0 @@ -NAME - find_option - find command line options - -SYNTAX - #include <getopt.h> - - mixed find_option(string *argv, - string shortform, - string longform, - string envvar, - mixed def); - -DESCRIPTION - This is a generic function to parse command line options of the - type '-f', '--foo' or '--foo=bar'. The first argument should be - the array of strings that is sent as second argument to your - main() function, the second is a string with the short form of - your option. The short form must be only one character long. - The 'longform' is an alternative and maybe more readable way to - give the same option. If you give "foo" as longform your program - will accept --foo as argument. The envvar argument specifies what - environment variable can be used to specify the same option. The - envvar option exists to make it easier to custimizer program usage. - The 'def' has two functions: It specifies that the option takes an - argument and it tells find_option what to return if the option is - not present. If 'def' is given and the option does not have an - argument find_option will print an error message and exit the program. - - Also, as an extra bonus: shortform, longform and envvar can all be - arrays, in which case either of the options in the array will be - accpted. - -NOTA BENE - find_option modifies argv. - -EXAMPLE - int main(int argc, string *argv) - { - if(find_option(argv,"f","foo")) - werror("The FOO option was given.\n"); - - werror("The BAR option got the "+ - find_option(argv,"b","bar","BAR_OPTION","default")+ - " argument.\n"); - } - -SEE ALSO - get_args diff --git a/doc/simulated/get_args b/doc/simulated/get_args deleted file mode 100644 index 08cd432428984e79e4190ea7cf93c668c830a624..0000000000000000000000000000000000000000 --- a/doc/simulated/get_args +++ /dev/null @@ -1,28 +0,0 @@ -NAME - get_args - get the non-option arguments - -SYNTAX - #include <getopt.h> - - string *get_args(string *argv); - -DESCRIPTION - This function returns the remaining command line arguments after - you have run find_options to find all the options in the - argument list. If there are any options left not handled by - find_options an error message will be written and the program will - exit. Otherwise a new 'argv' array without the parsed options is - returned. - -EXAMPLE - int main(int argc, string *argv) - { - if(find_option(argv,"f","foo")) - werror("The FOO option was given.\n"); - - argv=get_args(argv); - werror("The arguments are: "+(argv*" ")+".\n"); - } - -SEE ALSO - find_option \ No newline at end of file diff --git a/doc/simulated/get_function b/doc/simulated/get_function deleted file mode 100644 index 0dbfde627c92f407e7e9269eb39a8573a81d83fb..0000000000000000000000000000000000000000 --- a/doc/simulated/get_function +++ /dev/null @@ -1,13 +0,0 @@ -NAME - get_function - fetch a function from an object - -SYNTAX - #include <simulate.h> - - function get_function(object o, string name); - -DESCRIPTION - Defined as: return o[name]; - -KEYWORDS - function diff --git a/doc/simulated/getenv b/doc/simulated/getenv deleted file mode 100644 index 7b12802d7657530b2ef90341aecdde98d9b54665..0000000000000000000000000000000000000000 --- a/doc/simulated/getenv +++ /dev/null @@ -1,12 +0,0 @@ -NAME - getenv - get an environment variable - -SYNTAX - string getenv(string varname); - -DESCRIPTION - Reurns the value of the environment variable with the name varname, - if no such environment variable exists, zero is returned. - -NOTA BENE - This function is provided by master.c diff --git a/doc/simulated/implode b/doc/simulated/implode deleted file mode 100644 index c70a79be49ae5adffa2c830e78060402f60cd711..0000000000000000000000000000000000000000 --- a/doc/simulated/implode +++ /dev/null @@ -1,29 +0,0 @@ -NAME - implode - implode an array of strings - -SYNTAX - #include <simulate.h> - - string implode(string *a, string delimeter); - or - a * delimeter - -DESCRIPTION - This function is the inverse of explode. It contatenates all the - strings in a with a delimeter in between each. - - This function is the same as multiplication. - -EXAMPLES - > implode( ({ "foo","bar","gazonk"}), "-" ); - Result: foo-bar-gazonk - > ({ "a","b","c" })*" and "; - Result: a and b and c - > - -KEYWORDS - string - -SEE ALSO - explode - \ No newline at end of file diff --git a/doc/simulated/implode_nicely b/doc/simulated/implode_nicely deleted file mode 100644 index 987810eca7860051dbec33ea801ba648edc36378..0000000000000000000000000000000000000000 --- a/doc/simulated/implode_nicely +++ /dev/null @@ -1,27 +0,0 @@ -NAME - implode_nicely - make an english comma separated list - -SYNTAX - #include <string.h> - - string implode_nicely(string *words, string|void separator) - -DESCRIPTION - This function implodes a list of words to a readable string. - If the separator is omitted, the default is 'and'. - -EXAMPLES - > implode_nicely(({"green"})); - Result: green - > implode_nicely(({"green","blue"})); - Result: green and blue - > implode_nicely(({"green","blue","white"})); - Result: green, blue and white - > implode_nicely(({"green","blue","white"}),"or"); - Result: green, blue or white - -KEYWORDS - string - -SEE ALSO - `* diff --git a/doc/simulated/l_sizeof b/doc/simulated/l_sizeof deleted file mode 100644 index c6ecc996e72b5db35972b443efb49286e30411d7..0000000000000000000000000000000000000000 --- a/doc/simulated/l_sizeof +++ /dev/null @@ -1,16 +0,0 @@ -NAME - l_sizeof - Return the size of a multiset - -SYNTAX - #include <simulate.h> - - int l_sizeof(multiset m); - -DESCRIPTION - This function is equal to sizeof. - -KEYWORDS - multiset - -SEE ALSO - builtin/sizeof \ No newline at end of file diff --git a/doc/simulated/listp b/doc/simulated/listp deleted file mode 100644 index ad855533f39c1a93d5e84937b79fc4fb91cd7f38..0000000000000000000000000000000000000000 --- a/doc/simulated/listp +++ /dev/null @@ -1,13 +0,0 @@ -NAME - listp - is the argument a list? (multiset) - -SYNTAX - #include <simulate.h> - - int listp(mixed l) - -DESCRIPTION - This function is the same as multisetp. - -SEE ALSO - builtin/multisetp diff --git a/doc/simulated/m_indices b/doc/simulated/m_indices deleted file mode 100644 index 8d91aee4e52c10878b6a996d2077686bac5a5e82..0000000000000000000000000000000000000000 --- a/doc/simulated/m_indices +++ /dev/null @@ -1,16 +0,0 @@ -NAME - m_indices - return all indices from a mapping - -SYNTAX - #include <simulate.h> - - mixed *m_indices(mapping m); - -DESCRIPTION - This function is equal to indices - -KEYWORDS - mapping - -SEE ALSO - builtin/indices diff --git a/doc/simulated/m_sizeof b/doc/simulated/m_sizeof deleted file mode 100644 index 3f8265eb3c4b30cf7d11246678ae58d16f8d5e31..0000000000000000000000000000000000000000 --- a/doc/simulated/m_sizeof +++ /dev/null @@ -1,16 +0,0 @@ -NAME - m_sizeof - Return the size of a mapping - -SYNTAX - #include <simulate.h> - - int m_sizeof(mapping m); - -DESCRIPTION - This function is equal to sizeof. - -KEYWORDS - mapping - -SEE ALSO - builtin/sizeof \ No newline at end of file diff --git a/doc/simulated/m_values b/doc/simulated/m_values deleted file mode 100644 index fff446084734f558ef7c5608cb954bb471abfbb8..0000000000000000000000000000000000000000 --- a/doc/simulated/m_values +++ /dev/null @@ -1,16 +0,0 @@ -NAME - m_values - return all values from a mapping - -SYNTAX - #include <simulate.h> - - mixed *m_values(mapping m); - -DESCRIPTION - This function is equal to values - -KEYWORDS - mapping - -SEE ALSO - builtin/values diff --git a/doc/simulated/map b/doc/simulated/map deleted file mode 100644 index aadc04d8ca2c1f5276352bd9e74d79631996f648..0000000000000000000000000000000000000000 --- a/doc/simulated/map +++ /dev/null @@ -1,28 +0,0 @@ -NAME - map - map an array or mapping over a function - -SYNTAX - mixed *map(mixed arr,function fun,mixed ... args); - or - mixed *map(object *arr,string fun,mixed ... args); - or - mixed *map(function *arr,-1,mixed ... arg); - -DESCRIPTION - First syntax: - Map array returns an array holding the items of arr mapped thrugh - the function fun. ie. arr[x]=fun(arr[x], @args) for all x. - - Second syntax: - Map array calls function fun in all objects in the array arr. - ie. arr[x]=arr[x]->fun(@ args); - - Third syntax: - Map array calls the functions in the array arr: - arr[x]=arr[x]->fun(@ args); - -KEYWORDS - array - -SEE ALSO - sum_arrays, filter diff --git a/doc/simulated/map_array b/doc/simulated/map_array deleted file mode 100644 index cf280bea71e3141d66c3f741ec3eda654872912e..0000000000000000000000000000000000000000 --- a/doc/simulated/map_array +++ /dev/null @@ -1,18 +0,0 @@ -NAME - map_array - map an array over a function - -SYNTAX - mixed *map_array(mixed *arr,function fun,mixed ... args); - or - mixed *map_array(object *arr,string fun,mixed ... args); - or - mixed *map_array(function *arr,-1,mixed ... arg); - -DESCRIPTION - This function is the same as map. - -KEYWORDS - array - -SEE ALSO - filter_array, sum_arrays, map diff --git a/doc/simulated/master b/doc/simulated/master deleted file mode 100644 index 7015cbfaee58d4890cf7fc2ac56e6f5a749630b6..0000000000000000000000000000000000000000 --- a/doc/simulated/master +++ /dev/null @@ -1,11 +0,0 @@ -NAME - master - return the master object - -SYNTAX - object master(); - -DESCRIPTION - Master is added by the master object to make it easier to access it. - -KEYWORDS - object diff --git a/doc/simulated/member_array b/doc/simulated/member_array deleted file mode 100644 index d6ba57281cdae36f1ff1318ca2dfcd5c70879bc0..0000000000000000000000000000000000000000 --- a/doc/simulated/member_array +++ /dev/null @@ -1,14 +0,0 @@ -NAME - member_array - find first occurance of a value in an array - -SYNTAX - #include <simulate.h> - - int member_array(mixed item, mixed *arr); - -DESCRIPTION - Returns the index of the first occurence of item in array arr. - If not found, then -1 is returned. - -KEYWORDS - array diff --git a/doc/simulated/mklist b/doc/simulated/mklist deleted file mode 100644 index 0f34ee8d37255fa2240aa85b81c76bd374cd2ea7..0000000000000000000000000000000000000000 --- a/doc/simulated/mklist +++ /dev/null @@ -1,24 +0,0 @@ -NAME - mklist - make a multiset - -SYNTAX - #include <simulate.h> - - multiset mklist(mixed *a) - -DESCRIPTION - This function creates a multiset from an array. - -EXAMPLE - > mklist( ({1,2,3}) ); - Result: (< /* 3 elements */ - 1, - 2, - 3 - >) - -KEYWORDS - multiset - -SEE ALSO - builtin/aggregate_multiset \ No newline at end of file diff --git a/doc/simulated/mkmultiset b/doc/simulated/mkmultiset deleted file mode 100644 index 4453892210081f6913bdf545e6378505332bc53e..0000000000000000000000000000000000000000 --- a/doc/simulated/mkmultiset +++ /dev/null @@ -1,22 +0,0 @@ -NAME - mkmultiset - make a multiset - -SYNTAX - multiset mkmultiset(mixed *a) - -DESCRIPTION - This function creates a multiset from an array. - -EXAMPLE - > mkmultiset( ({1,2,3}) ); - Result: (< /* 3 elements */ - 1, - 2, - 3 - >) - -KEYWORDS - multiset - -SEE ALSO - builtin/aggregate_multiset diff --git a/doc/simulated/perror b/doc/simulated/perror deleted file mode 100644 index 861271568eaa41ee9f815354d44553a3f215a90b..0000000000000000000000000000000000000000 --- a/doc/simulated/perror +++ /dev/null @@ -1,18 +0,0 @@ -NAME - perror - print error - -SYNTAX - #include <stdio.h> - - void perror(string s); - -DESCRIPTION - This function prints a message to stderr along with a description - of what went wrong if available. It uses the system errno to find - out what went wrong, so it is only applicable to IO errors. - -KEYWORDS - file - -SEE ALSO - werror \ No newline at end of file diff --git a/doc/simulated/popen b/doc/simulated/popen deleted file mode 100644 index 2d6dee0275632aaf212b875ef327e08b2e4e354e..0000000000000000000000000000000000000000 --- a/doc/simulated/popen +++ /dev/null @@ -1,12 +0,0 @@ -NAME - popen - pipe open - -SYNTAX - #include <process.h> - - string popen(string cmd); - -DESCRIPTION - This function runs the command cmd as in a shell and returns the - output. See your unix/C manual for details on popen. - diff --git a/doc/simulated/previous_object b/doc/simulated/previous_object deleted file mode 100644 index 868061efaa7cec21b0d06d58cffe3abb9da04b9c..0000000000000000000000000000000000000000 --- a/doc/simulated/previous_object +++ /dev/null @@ -1,14 +0,0 @@ -NAME - previous_object - return the calling object - -SYNTAX - #include <simulate.h> - - object previous_object(); - -DESCRIPTION - Returns an object pointer to the object that called current function, - if any. - -SEE ALSO - builtin/call_function, builtin/backtrace diff --git a/doc/simulated/putenv b/doc/simulated/putenv deleted file mode 100644 index 5e1dbdb206b60b7929ce64a0ae21ee5360ddf366..0000000000000000000000000000000000000000 --- a/doc/simulated/putenv +++ /dev/null @@ -1,11 +0,0 @@ -NAME - putenv - put environment variable - -SYNTAX - void putenv(string varname, string value); - -DESCRIPTION - This function sets the environment variable 'varname' to 'value'. - -SEE ALSO - getenv, exece diff --git a/doc/simulated/read_bytes b/doc/simulated/read_bytes deleted file mode 100644 index c772396263477920454c65a537439c2ac0694e14..0000000000000000000000000000000000000000 --- a/doc/simulated/read_bytes +++ /dev/null @@ -1,18 +0,0 @@ -NAME - read_bytes - read a number of bytes into a string from a file - -SYNTAX - #include <stdio.h> - - string read_bytes(string file,int start,int len); - -DESCRIPTION - Read len number of bytes from file file staring at byte start and - return it as a string. - -KEYWORDS - file - -SEE ALSO - write_file - diff --git a/doc/simulated/read_file b/doc/simulated/read_file deleted file mode 100644 index 38940c9ba99a2e34e0bdb24924442cdcb1bfbbf6..0000000000000000000000000000000000000000 --- a/doc/simulated/read_file +++ /dev/null @@ -1,18 +0,0 @@ -NAME - read_file - read a number of lines into a string from file - -SYNTAX - #include <stdio.h> - - string read_file(string file, int start, int len); - -DESCRIPTION - Read 'len' lines from the file 'file' after skipping 'start' lines - and return those lines as a string. If start and len are omitted - the whole file is read. - -KEYWORDS - file - -SEE ALSO - read_bytes, write_file diff --git a/doc/simulated/regexp b/doc/simulated/regexp deleted file mode 100644 index 2aa7171ed2b83a2792d2535d6cfba3cfd6da3232..0000000000000000000000000000000000000000 --- a/doc/simulated/regexp +++ /dev/null @@ -1,16 +0,0 @@ -NAME - regexp - filter an array through a regexp - -SYNTAX - #include <simulate.h> - - string *regexp(string *arr, string reg); - -DESCRIPTION - Return those strings in arr that matches the regexp in reg. - -KEYWORDS - string - -SEE ALSO - regexp/regexp diff --git a/doc/simulated/search_array b/doc/simulated/search_array deleted file mode 100644 index f4ae391c4bf882b06819b6563c351ec26175ed8c..0000000000000000000000000000000000000000 --- a/doc/simulated/search_array +++ /dev/null @@ -1,22 +0,0 @@ -NAME - search_array - search for something in an array - -SYNTAX - #include <array.h> - - int search_array(mixed *arr,function fun,mixed arg, ...); - or - int search_array(object *arr,string fun,mixed arg, ...); - or - int search_array(function *arr,-1,mixed arg, ...); - -DESCRIPTION - search_array works like map_array, only it returns the index of the - first call that returned true instead or returning an array of the - returned values. If no call returns true, -1 is returned. - -KEYWORDS - array - -SEE ALSO - sum_arrays, filter_array, member_array diff --git a/doc/simulated/sort_array b/doc/simulated/sort_array deleted file mode 100644 index 7645c9ab5d5325571fdbfcca6ffb8808030b7be6..0000000000000000000000000000000000000000 --- a/doc/simulated/sort_array +++ /dev/null @@ -1,20 +0,0 @@ -NAME - sort_array - sort an array - -SYNTAX - #include <array.h> - - mixed *sort_array(mixed *arr,function fun,mixed ... args); - -DESCRIPTION - This function sorts an array after a compare-function 'fun' - which takes two arguments and should return 1 if the first argument - is larger then the second. The rest of the arguments 'args' will be - sent as 3rd, 4th etc. argument to fun. If fun is omitted, `< is unsed - instead. - -KEYWORDS - array - -SEE ALSO - map_array, filter_array diff --git a/doc/simulated/spawn b/doc/simulated/spawn deleted file mode 100644 index 5391e35709e186dba9d39684e17f4754e10dd5a1..0000000000000000000000000000000000000000 --- a/doc/simulated/spawn +++ /dev/null @@ -1,24 +0,0 @@ -NAME - spawn - spawn a process - -SYNTAX - #include <process.h> - - int spawn(string cmd); - or - int spawn(string cmd, object stdin); - or - int spawn(string cmd, object stdin, object stdout); - or - int spawn(string cmd, object stdin, object stdout, object stderr); - -DESCRIPTION - This function spawns a process but does not wait for it to finish. - Optionally, clones of /precompiled/file can be sent to it to - specify where stdin, stdout and stderr of the spawned processes - should go. - -SEE ALSO - popen, files/fork, files/exec, files/file->pipe, - files/file->dup2 - diff --git a/doc/simulated/stderr b/doc/simulated/stderr deleted file mode 100644 index e78d19f3c8483c9f73b4011176a2751d2374c3f0..0000000000000000000000000000000000000000 --- a/doc/simulated/stderr +++ /dev/null @@ -1,14 +0,0 @@ -NAME - stderr - Standard error stream - -SYNTAX EXAMPLE - #include <stdio.h> - - stderr->gets() - -DESCRIPTION - Stderr is a clone of /precompiled/file connected to the standard - error stream. - -SEE ALSO - /precompiled/file, werror diff --git a/doc/simulated/stdin b/doc/simulated/stdin deleted file mode 100644 index e56fa039894c5f5b41b9417272af1c79c34e89f6..0000000000000000000000000000000000000000 --- a/doc/simulated/stdin +++ /dev/null @@ -1,13 +0,0 @@ -NAME - stdin - Standard input - -SYNTAX EXAMPLE - #include <stdio.h> - - stdin->gets() - -DESCRIPTION - Stdin is a clone of /precompiled/FILE connected to the standard input. - -SEE ALSO - /precompiled/FILE diff --git a/doc/simulated/stdout b/doc/simulated/stdout deleted file mode 100644 index 1ced6a61a8e67784e80b2ed93ee29ac75e0da2da..0000000000000000000000000000000000000000 --- a/doc/simulated/stdout +++ /dev/null @@ -1,13 +0,0 @@ -NAME - stdout - Standard output - -SYNTAX EXAMPLE - #include <stdio.h> - - stdout->gets() - -DESCRIPTION - Stdout is a clone of /precompiled/file connected to the standard output. - -SEE ALSO - /precompiled/file, write diff --git a/doc/simulated/strlen b/doc/simulated/strlen deleted file mode 100644 index a76e3bc0e14d30b567b6bd9bf15699cf5cd933cb..0000000000000000000000000000000000000000 --- a/doc/simulated/strlen +++ /dev/null @@ -1,16 +0,0 @@ -NAME - strlen - Return the length of a string - -SYNTAX - #include <simulate.h> - - int strlen(string s); - -DESCRIPTION - This function is equal to sizeof. - -KEYWORDS - string - -SEE ALSO - builtin/sizeof \ No newline at end of file diff --git a/doc/simulated/strmult b/doc/simulated/strmult deleted file mode 100644 index 87feb851923fafbf27a1a3f490a86fb4b9423817..0000000000000000000000000000000000000000 --- a/doc/simulated/strmult +++ /dev/null @@ -1,11 +0,0 @@ -NAME - strmult - multiply strings - -SYNTAX - #include <string.h> - - string strmult(string s, int num); - -DESCRIPTION - This function multplies 's' by 'num'. The return value is the same - as appending 's' to an empty string 'num' times. diff --git a/doc/simulated/strstr b/doc/simulated/strstr deleted file mode 100644 index 82f4d026db65e040d6bf3b82ef9cf84e3b34acf8..0000000000000000000000000000000000000000 --- a/doc/simulated/strstr +++ /dev/null @@ -1,17 +0,0 @@ -NAME - strstr - find a string inside a string - -SYNTAX - #include <simulate.h> - - int strstr(string str1,string str2); - -DESCRIPTION - Return the position of str2 in str1, if str2 can't be found in str1 - -1 is returned. - -KEYWORDS - string - -SEE ALSO - builtin/sscanf, builtin/explode diff --git a/doc/simulated/sum b/doc/simulated/sum deleted file mode 100644 index a4c75bbc8fa508044026cdd689d15f79a021c018..0000000000000000000000000000000000000000 --- a/doc/simulated/sum +++ /dev/null @@ -1,25 +0,0 @@ -NAME - sum - add values together - -SYNTAX - #include <simulate.h> - - int sum(int ... i); - or - float sum(float ... f); - or - string sum(string|float|int ... p); - or - array sum(array ... a); - or - mapping sum(mapping ... m); - or - list sum(multiset ... l); - -DESCRIPTION - This function does exactly the same thing as adding all the arguments - together with +. It's just here so you can get a function-pointer to - the summation operator. - -KEYWORDS - int, float, string, array, mapping, multiset diff --git a/doc/simulated/sum_arrays b/doc/simulated/sum_arrays deleted file mode 100644 index b749a6583cf88f63de7e38c5a2ddb6ed541cb57e..0000000000000000000000000000000000000000 --- a/doc/simulated/sum_arrays +++ /dev/null @@ -1,29 +0,0 @@ -NAME - sum_arrays - map any number of arrays over a function. - -SYNTAX - #include <array.h> - - mixed *sum_arrays(function fun,mixed *arr1,...); - -DESCRIPTION - Works like this: - - mixed *sum_arrays(function fun,mixed *arr1,...) - { - int e; - mixed *res=allocate(sizeof(arr1)); - for(e=0;e<sizeof(arr1);e++) - { - res[e]=fun(arr1[e],arr2[e],...); - } - return res; - } - - Simple ehh? - -KEYWORDS - array - -SEE ALSO - map_array, filter_array, search_array diff --git a/doc/simulated/system b/doc/simulated/system deleted file mode 100644 index 567dfbaecadd0a6d14200f1544ead35267dece2d..0000000000000000000000000000000000000000 --- a/doc/simulated/system +++ /dev/null @@ -1,15 +0,0 @@ -NAME - system - run an external program - -SYNTAX - #include <process.h> - - void system(string cmd); - -DESCRIPTION - This function runs the external program cmd and waits until it - is finished. Standard /bin/sh completions/redirectoins/etc. can - be used. - -SEE ALSO - popen, exec, spawn \ No newline at end of file diff --git a/doc/simulated/this_function b/doc/simulated/this_function deleted file mode 100644 index 6aac86684a928bc021b8197c548b05d55dd4762c..0000000000000000000000000000000000000000 --- a/doc/simulated/this_function +++ /dev/null @@ -1,19 +0,0 @@ -NAME - this_function - return a functionpointer to the current function - -SYNTAX - #include <simulate.h> - - function this_function(); - -DESCRIPTION - Returns a functionpointer to the current function, useful for - making recursive lambda-functions. - -KEYWORDS - function - -SEE ALSO - builtin/get_function, builtin/function_name, builtin/function_object, - builtin/backtrace - diff --git a/doc/simulated/uniq b/doc/simulated/uniq deleted file mode 100644 index 931dfdf54d7cc88a550b22b884125e5869122930..0000000000000000000000000000000000000000 --- a/doc/simulated/uniq +++ /dev/null @@ -1,14 +0,0 @@ -NAME - uniq - return one of each element - -SYNTAX - #include <array.h> - - array uniq(array a); - -DESCRIPTION - This function returns an copy of the array a with all duplicate - values removed. The order of the values in the result is undefined. - -KEYWORDS - array diff --git a/doc/simulated/version b/doc/simulated/version deleted file mode 100644 index adc6a557a9554ccf315aa177d639b9d96c18c6f6..0000000000000000000000000000000000000000 --- a/doc/simulated/version +++ /dev/null @@ -1,12 +0,0 @@ -NAME - version - return version info - -SYNTAX - string version(); - -DESCRIPTION - This function returns a brief information about the Pike version. - -EXAMPLE - > version(); - Result: Pike v1.0E-13 diff --git a/doc/simulated/write b/doc/simulated/write deleted file mode 100644 index 00d4f9817f42c902f7c0f83f2a922ff2b9326c0b..0000000000000000000000000000000000000000 --- a/doc/simulated/write +++ /dev/null @@ -1,12 +0,0 @@ -NAME - write - write text to stdout - -SYNTAX - int write(string text); - -DESCRIPTION - Added by the master, it directly calls write in a clone of - /precompiled/file - -SEE ALSO - builtin/werror diff --git a/doc/simulated/write_file b/doc/simulated/write_file deleted file mode 100644 index 8446f0d0f49fc97e7796866d9a520b5c6b871ddf..0000000000000000000000000000000000000000 --- a/doc/simulated/write_file +++ /dev/null @@ -1,16 +0,0 @@ -NAME - write_file - append a string to a file - -SYNTAX - #include <stdio.h> - - int write_file(string file, string str) - -DESCRIPTION - Append the string str onto the file file. Returns number of bytes written. - -KEYWORDS - file - -SEE ALSO - read_bytes diff --git a/doc/types/array b/doc/types/array deleted file mode 100644 index 01d6323d63156d217ca9bd7b90e45679a8490e85..0000000000000000000000000000000000000000 --- a/doc/types/array +++ /dev/null @@ -1,54 +0,0 @@ -NAME - array - an array of values - -SYNTAX EXAMPLE - ({ 1, 2, 3 }) - allocate(10); - -DESCRIPTION - Arrays are basically a place to store a number of other values. - Arrays in pike are allocated blocks of values. They are dynamically - allocated and does not need to be declared as in C. The values in - the array can be set when creating the array as in the first - construction or anytime afterwards like this: arr[index]=data where - index is an integer. Index is normally 0 <= index < sizeof(arr), and - refers to the corresponding element in the array. If index is less - than zero, it is the same as doing arr[sizeof(arr)+index]. This - means that negative index will index the array from the end rather - than from the beginning. - - Note that arrays are shared and use reference counts to keep - track of their references. This will have the effect that you can - have two variables pointing to the same array, and when you change - an index in in it, both variables will show the change. - - Here follows a list of operators that applies to arrays: - In this list a and b is used to represent an array expression: - - a + b summation ( ({1}) + ({2}) returns ({1,2}) ) - a - b subtraction, returns a copy of a with all values that are - present in b removed, ( ({1, 2, 3}) - ({2}) returns ({1,3}) ) - a & b intersection, return an array with all values that are - present in both a and b - a | b union, return an array with all values that are present in - a or b, differs from summation in that values that are - present in both a and b are only returned once. - a ^ b xor, return an array with all values that are present in - a or b but not in both. - a * c multiplication (c is a string) same thing as implode(a,c) - a == b returns 1 if a is the same array as b, same size and values - is not enough. - a != b returns 0 if a is the same array as b, same size and values - is not enough. - ! a boolean not, returns 0 - a[c] indexing, returns element c in the array (c is an int) - a[c]=d setting, sets element c in the array to d (c is an int) - a[c..d] range (c & d are ints) returns an array containing a pice of - the array a. The piece starts at element c and ends (and - includes) element d. - -KEYWORDS - types - -SEE ALSO - mapping, multiset, builtin/allocate, builtin/sizeof diff --git a/doc/types/float b/doc/types/float deleted file mode 100644 index 3ce15fac72454f7209ccb69c82c0a9417635e86e..0000000000000000000000000000000000000000 --- a/doc/types/float +++ /dev/null @@ -1,37 +0,0 @@ -NAME - float - floating point numbers - -SYNTAX EXAMPLE - 0.9 - 1.0 - 2.7e7 - -DESCRIPTION - This type stores a floating point number, normally it use 4 bytes - of storage when used in a global variable. - - A list of operators that applies to floats follows: - In this list a and b is used to represent a float expression: - - a + b summation - a - b subtraction - a * b multiplication - a / b division - a % b modulo ( same thing as a - floor( a / b ) * b ) - - a negation - a == b return 1 if a is equal to b, 0 otherwise - a != b return 0 if a is equal to b, 1 otherwise - a < b returns 1 if a is lesser than b, 0 otherwise - a <= b returns 1 if a is lesser or equal to b, 0 otherwise - a > b returns 1 if a is greater than b, 0 otherwise - a >= b returns 1 if a is greater or equal to b, 0 otherwise - -NOTA BENE - floats and ints cannot be used together, they have to be cast - to the same type first. - -KEYWORDS - types - -SEE ALSO - math/sin, math/cos, math/tan, math/sqrt diff --git a/doc/types/function b/doc/types/function deleted file mode 100644 index f90318276923c589087442e52af58decc47c0708..0000000000000000000000000000000000000000 --- a/doc/types/function +++ /dev/null @@ -1,21 +0,0 @@ -NAME - function - a function pointer - -SYNTAX EXAMPLE - foo /* if foo is a function in this object */ - bar::foo /* if foo is a function in the inherited program 'bar' */ - o->foo /* function (or variable) foo in the object o */ - -DESCRIPTION - A functionpointer is a reference to a function in an object. It can be - called with call_function which can also be written as just (). - If the object the functionpointer is in is destructed the pointer will - become 0. If you try to call a functionpointer that has is 0 then 0 - will be returned. - -KEYWORDS - types - -SEE ALSO - object, builtin/call_function, builtin/functionp, - builtin/function_object, builtin/function_name diff --git a/doc/types/int b/doc/types/int deleted file mode 100644 index 13014a0eb0f3224fb1f6d6aded6bfb7e263d75cf..0000000000000000000000000000000000000000 --- a/doc/types/int +++ /dev/null @@ -1,39 +0,0 @@ -NAME - int - integers numbers - -SYNTAX EXAMPLE - 9797 /* decimal number */ - 0x20 /* hexadecimal number */ - 020 /* octal number */ - -DESCRIPTION - This type stores an integer, normally it is 32 bits and use 4 bytes - of storage when used in a global variable. - - A list of operators that applies to ints follows: - - In this list a and b is used to represent an integer expression: - - a + b summation - a - b subtraction - a * b multiplication - a / b integer division - a % b modulo ( same thing as a - ( a / b ) * b ) - a | b bitwise or - a & b bitwise and - a ^ b bitwise xor - ! a boolean not, returns 1 if a is zero 0 otherwise - ~ a bitwise complement - - a negation - a == b return 1 if a is equal to b, 0 otherwise - a != b return 0 if a is equal to b, 1 otherwise - a < b returns 1 if a is lesser than b, 0 otherwise - a <= b returns 1 if a is lesser or equal to b, 0 otherwise - a > b returns 1 if a is greater than b, 0 otherwise - a >= b returns 1 if a is greater or equal to b, 0 otherwise - -KEYWORDS - types - -SEE ALSO - float diff --git a/doc/types/mapping b/doc/types/mapping deleted file mode 100644 index 4f571a3f7a71fa87f647d7580c369f5734bdb856..0000000000000000000000000000000000000000 --- a/doc/types/mapping +++ /dev/null @@ -1,48 +0,0 @@ -NAME - mapping - an associative array - -SYNTAX EXAMPLE - ([ index1:data1, index2:data2 ]) - -DESCRIPTION - A mapping is basically an array that can be indexed on any type, not - not just integers. It can also be seen as a way of linking data - (usaully strings) together. It consists of a lot of index-data pairs - which are linked togeter in such a way that map[index1] returns data1. - It is also possible to set that data by writing map[index1]=new_data1. - If you try to set an index in a mapping that isn't already present in - the mapping then it will be added. - - Here follows a list of operators that applies to mappings: - In this list a and b is used to represent a mapping expression: - - a + b summation ( ([1:1]) + ([2:2,2:2]) returns ([1:1,2:2,2:2]) ) - a - b subtraction, returns a copy of a with all pairs whos - index is present in b removed. - a & b intersection, return a mapping with all indices that are - resent in both a and b, if an index is present in both - a & b the data for that index will be taken from b. - a | b union, return a mapping with all values that are present in - a or b, differs from summation in that values that are - present in both a and b are only returned once, as with - intersection, data will be taken from b when possible. - a ^ b xor, return a mapping with all indices that are present in - a or b but not in both. - a == b returns 1 if a is the same mapping as b, same size, indices - and values is not enough, 0 otherwise. - a != b returns 0 if a is the same mapping as b, same size, indices - and values is not enough, 1 otherwise. - ! a boolean not, returns 0 - a[c] indexing, returns the value associated with the value c - in the mapping a. If there is no index c in the mapping - zero will be returned. (With zero_type = 1) - a[c]=d setting, this associates d with c in the mapping, the index - c will be added to the mapping automatically if it isn't - already there. - -KEYWORDS - types - -SEE ALSO - array, multiset, builtin/sizeof, builtin/indices, builtin/values, - builtin/zero_type diff --git a/doc/types/mixed b/doc/types/mixed deleted file mode 100644 index 6f620ced154f892cd10dd7bb8254a5cd0e5a3de0..0000000000000000000000000000000000000000 --- a/doc/types/mixed +++ /dev/null @@ -1,15 +0,0 @@ -NAME - mixed - any type - -DESCRIPTION - This is not really a type. But this keyword can be used to specify - that a variable, argument or return type can be of any type. - -EXAMPLES - mixed i=1; - mixed j="foo"; - mixed foo() { return "bar"; } - mixed bar() { return ({}); } - -KEYWORDS - types diff --git a/doc/types/multiset b/doc/types/multiset deleted file mode 100644 index a1a9cbd9e2d14842ba3a5212918447893beabe40..0000000000000000000000000000000000000000 --- a/doc/types/multiset +++ /dev/null @@ -1,38 +0,0 @@ -NAME - multiset - a set of values - -SYNTAX EXAMPLE - (< 1, 7, 8, 9 >) - -DESCRIPTION - A multiset is basically a mapping without data values, when indexing a - multiset 1 willl be returned if the index is present, zero otherwise. - - Here follows a list of operators that applies to multisets: - In this list a and b is used to represent a multiset expression: - - a + b summation ( (<1>) + (<2>) returns (<1,2>) ) - a - b subtraction, returns a copy of a with all values that are - present in b removed. - a & b intersection, return a multiset with all values that are - present in both a & b. - a | b union, return a multiset with all values that are present in - a or b, differs from summation in that values that are - present in both a and b are only returned once. - a ^ b xor, return a multiset with all indices that are present in - a or b but not in both. - a == b returns 1 if a is the same multiset as b, same size and values - is not enough. - a != b returns 1 if a is the same multiset as b, same size and values - is not enough. - ! a boolean not, returns 0 - a[c] indexing, returns 1 c is present in the multiset a. - a[c]=d setting, if d is true, c is added to the multiset if it is not - present already. If d is false, it is removed if it is - present. - -KEYWORDS - types - -SEE ALSO - mapping, array, builtin/indices, builtin/sizeof diff --git a/doc/types/object b/doc/types/object deleted file mode 100644 index c96f0de705be25882cbc1ed64da260706e9870f5..0000000000000000000000000000000000000000 --- a/doc/types/object +++ /dev/null @@ -1,25 +0,0 @@ -NAME - object - an instance of a class (program) - -DESCRIPTION - There is no syntax example in this file because there is no way to - write constant object. The only way to make new objects is to use - clone() on a program. - - Here follows a list of operators that applies to objects: - In this list, o and o2 are used to represent object expressions, - and s is a string expression: - - o[s] indexing, returns the identifier named s in the object o, - an identifier is a global variable or a function. - o[s]=c This sets the global variable s int the object o to c, - if s is a function however, an error is produced. - o->foo same as o["foo"] - o == o2 return 1 if o and o2 are the same object - o != o2 return 0 if o and o2 are the same object - -KEYWORDS - types - -SEE ALSO - program, function, builtin/clone, builtin/destruct diff --git a/doc/types/program b/doc/types/program deleted file mode 100644 index 76f32cbd5360ccbb00482db68b8e508909baa4b1..0000000000000000000000000000000000000000 --- a/doc/types/program +++ /dev/null @@ -1,21 +0,0 @@ -NAME - program - a class, or blueprint for an object - -DESCRIPTION - There is no syntax example in this file because there is no way to - write constant programs. (yet) New programs are made with - compile_file() or compile_string(). Programs are only useful as - arguments to clone() and the only operators that applies to programs - are == and !=. - -NOTA BENE - In Pike the term 'program' is somewhat confusing, becuase it is used - both to reference a complete runnable software package, and to a - structure in Pike containing code. - -KEYWORDS - types - -SEE ALSO - object, function, builtin/compile_file, builtin/compile_string, - builtin/clone diff --git a/doc/types/string b/doc/types/string deleted file mode 100644 index 1c56bff1e067d8fb7f1d36976eb16b121a4ce967..0000000000000000000000000000000000000000 --- a/doc/types/string +++ /dev/null @@ -1,52 +0,0 @@ -NAME - string - a string of characters - -SYNTAX EXAMPLE - "foo" - -DESCRIPTION - This type can contan text. ie. a word, a sentence, or a book. Note - that this is not simply the letters A to Z, special characters, - null characters, newlines can all be stored in a string. Any 8-bit - character in fact. Strings are a basic - type in Pike, as opposed to C where strings are represented by an - array of char. This means that you cannot set individual characters - in a string with the index operator for instance. In fact, there are - no functions that alters strings destructively. Also, all strings - are 'shared', that means that if the same string is used in several - places, only one will be stored in memory. - - When writing a string in a program, you enclose it in doublequotes. - To write special characters you need to use one of the following - syntaxes: - - \n newline - \r carriage return - \t tab - \b backspace - \" " - \\ \ - - A list of operators that applies to strings follow: - In this list a and b is used to represent a string expression: - - a + b summation ( "a"+"b" returns "ab") - a - b subtraction ( same as replace(a,b,"") ) - a / b division ( same thing as explode(a,b) ) - ! a boolean not, returns 0 - - The following operators compare two string alphabetically: - - a == b return 1 if a is equal to b, 0 otherwise - a != b return 0 if a is equal to b, 1 otherwise - a < b returns 1 if a is lesser than b, 0 otherwise - a <= b returns 1 if a is lesser or equal to b, 0 otherwise - a > b returns 1 if a is greater than b, 0 otherwise - a >= b returns 1 if a is greater or equal to b, 0 otherwise - -KEYWORDS - types - -SEE ALSO - builtin/indices, builtin/values, builtin/sscanf, builtin/sprintf, - builtin/sizeof