authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-09 12:10:27-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-10 20:53:57-04:00
log077cd4b9a46d431b09698554d321d7dad1bca8ca
treeab19a93ac2b5181a1dc95f56baea4d96759498d3
parent9e92dbdd0889a68e32cde85c1a07767200a9ad7e

langref: correct builtin function names


1 files changed, 20 insertions(+), 20 deletions(-)

doc/langref.md+20-20
......@@ -398,10 +398,10 @@ false otherwise.
398398
399399```
400400Function Operation
401@add_with_overflow(inline T: type, a: T, b: T, result: &T) -> bool *x = a + b
402@sub_with_overflow(inline T: type, a: T, b: T, result: &T) -> bool *x = a - b
403@mul_with_overflow(inline T: type, a: T, b: T, result: &T) -> bool *x = a * b
404@shl_with_overflow(inline T: type, a: T, b: T, result: &T) -> bool *x = a << b
401@addWithOverflow(inline T: type, a: T, b: T, result: &T) -> bool *x = a + b
402@subWithOverflow(inline T: type, a: T, b: T, result: &T) -> bool *x = a - b
403@mulWithOverflow(inline T: type, a: T, b: T, result: &T) -> bool *x = a * b
404@shlWithOverflow(inline T: type, a: T, b: T, result: &T) -> bool *x = a << b
405405```
406406
407407### @memset(dest, c: u8, byte_count: usize)
......@@ -437,7 +437,7 @@ debuggers to break there.
437437
438438This function is only valid within function scope.
439439
440### @return_address()
440### @returnAddress()
441441
442442This function returns a pointer to the return address of the current stack
443443frame.
......@@ -447,7 +447,7 @@ all platforms.
447447
448448This function is only valid within function scope.
449449
450### @frame_address()
450### @frameAddress()
451451
452452This function returns the base pointer of the current stack frame.
453453
......@@ -457,21 +457,21 @@ aggressive optimizations.
457457
458458This function is only valid within function scope.
459459
460### @max_value(inline T: type) -> (number literal)
460### @maxValue(inline T: type) -> (number literal)
461461
462462This function returns the maximum integer value of the integer type T.
463463
464464The result is a compile time constant. For some types such as `c_long`, the
465465result is marked as depending on a compile variable.
466466
467### @min_value(inline T: type) -> (number literal)
467### @minValue(inline T: type) -> (number literal)
468468
469469This function returns the minimum integer value of the integer type T.
470470
471471The result is a compile time constant. For some types such as `c_long`, the
472472result is marked as depending on a compile variable.
473473
474### @member_count(inline T: type) -> (number literal)
474### @memberCount(inline T: type) -> (number literal)
475475
476476This function returns the number of enum values in an enum type.
477477
......@@ -487,7 +487,7 @@ such as "std".
487487
488488This function is only valid at top level scope.
489489
490### @c_import(expression) -> (namespace)
490### @cImport(expression) -> (namespace)
491491
492492This function parses C code and imports the functions, types, variables, and
493493compatible macro definitions into the result namespace.
......@@ -498,25 +498,25 @@ appending to a temporary buffer which is then parsed as C code.
498498
499499This function is only valid at top level scope.
500500
501### @c_include(inline path: []u8)
501### @cInclude(inline path: []u8)
502502
503503This function can only occur inside `@c_import`.
504504
505505This appends `#include <$path>\n` to the `c_import` temporary buffer.
506506
507### @c_define(inline name: []u8, value)
507### @cDefine(inline name: []u8, value)
508508
509509This function can only occur inside `@c_import`.
510510
511511This appends `#define $name $value` to the `c_import` temporary buffer.
512512
513### @c_undef(inline name: []u8)
513### @cUndef(inline name: []u8)
514514
515515This function can only occur inside `@c_import`.
516516
517517This appends `#undef $name` to the `c_import` temporary buffer.
518518
519### @compile_var(inline name: []u8) -> (varying type)
519### @compileVar(inline name: []u8) -> (varying type)
520520
521521This function returns a compile-time variable. There are built in compile
522522variables:
......@@ -533,7 +533,7 @@ Build scripts can set additional compile variables of any name and type.
533533The result of this function is a compile time constant that is marked as
534534depending on a compile variable.
535535
536### @const_eval(expression) -> @typeof(expression)
536### @constEval(expression) -> @typeof(expression)
537537
538538This function wraps an expression and generates a compile error if the
539539expression is not known at compile time.
......@@ -550,7 +550,7 @@ type T.
550550This function counts the number of leading zeroes in x which is an integer
551551type T.
552552
553### @err_name(err: error) -> []u8
553### @errorName(err: error) -> []u8
554554
555555This function returns the string representation of an error. If an error
556556declaration is:
......@@ -564,7 +564,7 @@ Then the string representation is "OutOfMem".
564564If there are no calls to `@err_name` in an entire application, then no error
565565name table will be generated.
566566
567### @embed_file(inline path: []u8) -> [X]u8
567### @embedFile(inline path: []u8) -> [X]u8
568568
569569This function returns a compile time constant fixed-size array with length
570570equal to the byte count of the file given by `path`. The contents of the array
......@@ -578,7 +578,7 @@ This function performs an atomic compare exchange operation.
578578
579579The `fence` function is used to introduce happens-before edges between operations.
580580
581### @div_exact(a: T, b: T) -> T
581### @divExact(a: T, b: T) -> T
582582
583583This function performs integer division `a / b` and returns the result.
584584
......@@ -608,13 +608,13 @@ const b: u8 = @truncate(u8, a);
608608// b is now 0xcd
609609```
610610
611### @compile_err(inline msg: []u8)
611### @compileError(inline msg: []u8)
612612
613613This function, when semantically analyzed, causes a compile error with the message `msg`.
614614
615615There are several ways that code avoids being semantically checked, such as using `if`
616616or `switch` with compile time constants, and inline functions.
617617
618### @int_type(inline is_signed: bool, inline bit_count: u8) -> type
618### @intType(inline is_signed: bool, inline bit_count: u8) -> type
619619
620620This function returns an integer type with the given signness and bit count.