strrev.gml
来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 77 行
GML
77 行
.func strrev _strrev _fstrrev _wcsrev _mbsrev _fmbsrev _ustrrev
#include <string.h>
char *strrev( char *s1 );
.ixfunc2 '&String' &func
.if &'length(&_func.) ne 0 .do begin
char *_strrev( char *s1 );
.ixfunc2 '&String' &_func
.do end
.if &farfnc eq 1 .do begin
char __far *_fstrrev( char __far *s1 );
.ixfunc2 '&String' &ffunc
.do end
.if &'length(&wfunc.) ne 0 .do begin
#include <wchar.h>
wchar_t *_wcsrev( wchar_t *s1 );
.ixfunc2 '&String' &wfunc
.ixfunc2 '&Wide' &wfunc
.do end
.if &'length(&mfunc.) ne 0 .do begin
#include <mbstring.h>
unsigned char *_mbsrev( unsigned char *s1 );
.ixfunc2 '&String' &mfunc
.ixfunc2 '&Multibyte' &mfunc
.do end
.if &'length(&fmfunc.) ne 0 .do begin
unsigned char __far *_fmbsrev( unsigned char __far *s1 );
.ixfunc2 '&String' &fmfunc
.ixfunc2 '&Multibyte' &fmfunc
.do end
.if &'length(&ufunc.) ne 0 .do begin
wchar_t *_ustrrev( wchar_t *s1 );
.ixfunc2 '&String' &ufunc
.do end
.funcend
.desc begin
The &func function replaces the string
.arg s1
with a string whose characters are in the reverse order.
.if &'length(&_func.) ne 0 .do begin
.np
The &_func function is identical to &func..
Use &_func for ANSI/ISO naming conventions.
.do end
.im farfunc
.im widefunc
.im mbsffunc
.im unifunc
.desc end
.return begin
The address of the original string
.arg s1
is returned.
.return end
.exmp begin
#include <stdio.h>
#include <string.h>
char source[] = { "A sample STRING" };
void main()
{
printf( "%s\n", source );
printf( "%s\n", strrev( source ) );
printf( "%s\n", strrev( source ) );
}
.exmp output
A sample STRING
GNIRTS elpmas A
A sample STRING
.exmp end
.class WATCOM
.if &'length(&_func.) ne 0 .do begin
.np
&_func conforms to ANSI/ISO naming conventions
.do end
.system
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?