jstradv.gml

来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 62 行

GML
62
字号
.func jstradv _fjstradv
#include <jstring.h>
JSTRING jstradv( const JCHAR *src, size_t n );
.ixfunc2 '&Jstring' &func
.ixfunc2 '&Jconcat' &func
.if &farfnc eq 1 .do begin
FJSTRING __far _fjstradv( const JCHAR __far *src,
                          size_t n );
.ixfunc2 '&Jstring' &ffunc
.ixfunc2 '&Jconcat' &ffunc
.do end
.funcend
.desc begin
.if &farfnc eq 0 .do begin
The &func function skips
.do end
.el .do begin
The &func and &ffunc functions skip
.do end
over
.arg n
single- or double-byte characters in the Kanji string
.arg src.
A pointer to the next character is returned.
.im ffarfunc
.desc end
.return begin
A pointer to the next character is returned unless the number of
characters in the Kanji string is less than
.arg n
in which case a pointer to the end of the string
.arg src
is returned.
If
.arg n
is 0 then a pointer to
.arg src
is returned.
.return end
.see begin
.seelist &function. btom jgetmoji jstradv mtob
.see end
.exmp begin
#include <stdio.h>
#include <string.h>
#include <jstring.h>

void main()
  {
    JCHAR buffer[80];
    JSTRING p;
.exmp break
    strcpy( buffer, "Hello world" );
    p = jstradv( buffer, 6 );
    printf( "%s\n", p );
  }
.exmp output
Hello world
.exmp end
.class WATCOM
.system

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?