summaryrefslogtreecommitdiff
path: root/legacy/embryo/include/default.inc
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2004-03-29 11:58:57 +0000
committerCarsten Haitzler <raster@rasterman.com>2004-03-29 11:58:57 +0000
commit811cd94fbab432b59866aed3b9a724fe66227a4a (patch)
tree5271e95060d2acd529857b5d6e6d06b1b5dd5522 /legacy/embryo/include/default.inc
parent419bd778771ae100be0402de0795b71052cbd58e (diff)
more meaty api...
SVN revision: 9518
Diffstat (limited to 'legacy/embryo/include/default.inc')
-rw-r--r--legacy/embryo/include/default.inc81
1 files changed, 73 insertions, 8 deletions
diff --git a/legacy/embryo/include/default.inc b/legacy/embryo/include/default.inc
index 8440f270d5..704a348518 100644
--- a/legacy/embryo/include/default.inc
+++ b/legacy/embryo/include/default.inc
@@ -4,9 +4,13 @@
4 * Written by Greg Garner (gmg@artran.com) 4 * Written by Greg Garner (gmg@artran.com)
5 * Modified in March 2001 to include user defined 5 * Modified in March 2001 to include user defined
6 * operators for the floating point functions. 6 * operators for the floating point functions.
7 * (c) Copyright 2004, Carsten Haitzler
7 * Modified March 2004 by Carsten Haitzler <raster@rasterman.com> to conform 8 * Modified March 2004 by Carsten Haitzler <raster@rasterman.com> to conform
8 * to E coding style 9 * to E coding style
9 * Became default include for embryo... 10 * Became default include for embryo...
11 * Added string functions
12 * Added rand functions
13 * Added time functions
10 * 14 *
11 * This file is provided as is (no warranties). 15 * This file is provided as is (no warranties).
12 */ 16 */
@@ -34,25 +38,86 @@ native Float:atof(const string[]);
34native Float:fract(Float:value); 38native Float:fract(Float:value);
35/* Round a float into a integer value */ 39/* Round a float into a integer value */
36native round(Float:value, Float_Round_Method:method=ROUND); 40native round(Float:value, Float_Round_Method:method=ROUND);
37/* Return the square root of the input value, same as float_power(value, 0.5) */ 41/* Return the square root of value, same as float_power(value, 0.5) */
38native Float:sqrt(Float:value); 42native Float:sqrt(Float:value);
39/* Return the value raised to the power of the exponent */ 43/* Return the value raised to the power of the exponent */
40native Float:pow(Float:value, Float:exponent); 44native Float:pow(Float:value, Float:exponent);
41/* Return the logarithm */ 45/* Return the logarithm */
42native Float:log(Float:value, Float:base=10.0); 46native Float:log(Float:value, Float:base=10.0);
43/* Return the sine, cosine or tangent. The input angle may be in radian, degrees or grades. */ 47/* Return the sine, cosine or tangent. The input angle may be in radian*/
48/* degrees or grades. */
44native Float:sin(Float:value, Float_Angle_Mode:mode=RADIAN); 49native Float:sin(Float:value, Float_Angle_Mode:mode=RADIAN);
45native Float:cos(Float:value, Float_Angle_Mode:mode=RADIAN); 50native Float:cos(Float:value, Float_Angle_Mode:mode=RADIAN);
46native Float:tan(Float:value, Float_Angle_Mode:mode=RADIAN); 51native Float:tan(Float:value, Float_Angle_Mode:mode=RADIAN);
47/* Return the absolute value */ 52/* Return the absolute value */
48native Float:abs(Float:value); 53native Float:abs(Float:value);
54/* return integer from string */
55native atoi(str[]);
56/* return 0 if string matches glob, non-zero otherwise */
57native fnmatch(glob[], str[]);
58/* same as strcmp() */
59native strcmp(str1[], str2[]);
60/* same as strncmp */
61native strncmp(str1[], str2[]);
62/* same as strcpy */
63native strcpy(dst[], src[]);
64/* same as strncpy except it nul terminates */
65native strncpy(dst[], src[], n);
66/* same as strlen */
67native strlen(str[]);
68/* same as strcat */
69native strcat(dst[], src[]);
70/* same as strncat except it nul terminates */
71native strncat(dst[], src[], n);
72/* prepends src string onto start of dst string */
73native strprep(dst[], src[]);
74/* prepends at most n chars from src string onto dst string */
75native strnprep(dst[], src[], n);
76/* cuts chars from char n to (not including) n2, and puts them in str */
77native strcut(dst[], str[], n, n2);
78/* same as snprintf, except only supports %%, %c, %i, %d, %f, %x, %X, %s, \n and \t */
79native snprintf(dst[], dstn, fmt[], ...);
80/* same as strstr */
81native strstr(str[], ndl[]);
82/* same as strchr, except ch must be a 1 charater long string, and returns string index */
83native strchr(str[], ch[]);
84/* same as strrchr, except ch must be a 1 charater long string and returns string index */
85native strrchr(str[], ch[]);
86/* return random number 0 - 65535 */
87native rand();
88/* return random number 0.0 - 1.0 */
89native Float:randf();
90/* return seconds since midnight as a float */
91native Float:seconds();
92/* return the current date, year, time etc. in the variables provided */
93native date(&year, &month, &day, &yearday, &weekday, &hr, &min, &Float:sec);
49 94
50 95/*****************************************************************************/
51 96/*****************************************************************************/
52 97/*****************************************************************************/
53 98/*****************************************************************************/
54 99/*****************************************************************************/
55 100/*****************************************************************************/
101/*****************************************************************************/
102/*****************************************************************************/
103/*****************************************************************************/
104/*****************************************************************************/
105/*****************************************************************************/
106/*****************************************************************************/
107/*****************************************************************************/
108/*****************************************************************************/
109/*****************************************************************************/
110/*****************************************************************************/
111/*****************************************************************************/
112/*****************************************************************************/
113/*****************************************************************************/
114/*****************************************************************************/
115/*****************************************************************************/
116/*****************************************************************************/
117/*****************************************************************************/
118/*****************************************************************************/
119/*****************************************************************************/
120/*****************************************************************************/
56 121
57/**************************************************/ 122/**************************************************/
58/* Hidden calls - all are overloaded on operators */ 123/* Hidden calls - all are overloaded on operators */