jstrncat.gml

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

GML
70
字号
.func jstrncat _fjstrncat
#include <jstring.h>
JSTRING jstrncat( JCHAR *dst,
                  const JCHAR *src,
                  size_t n );
.ixfunc2 '&String' &func
.ixfunc2 '&Concats' &func
.if &farfnc eq 1 .do begin
FJSTRING __far _fjstrncat( JCHAR __far *dst,
                           const JCHAR __far *src,
                           size_t n );
.ixfunc2 '&String' &ffunc
.ixfunc2 '&Concats' &ffunc
.do end
.funcend
.desc begin
.if &farfnc eq 0 .do begin
The &func function appends
.do end
.el .do begin
The &func and &ffunc functions append
.do end
not more than
.arg n
single or double-byte characters of the Kanji string pointed to by
.arg src
to the end of the Kanji string pointed to by
.arg dst.
The first character of
.arg src
overwrites the null character at the end of
.arg dst.
A terminating null character is always appended to the result.
.im ffarfunc
.desc end
.return begin
.if &farfnc eq 0 .do begin
The &func function returns
.do end
.el .do begin
The &func and &ffunc functions return
.do end
the value of
.arg dst.
.return end
.see begin
.seelist &function. jstrcat jstrncat strcat strncat
.see end
.exmp begin
#include <stdio.h>
#include <string.h>
#include <jstring.h>

JCHAR buffer[80];

void main()
  {
    strcpy( buffer, "Hello " );
    jstrncat( buffer, "world", 8 );
    printf( "%s\n", buffer );
    jstrncat( buffer, "*************", 4 );
    printf( "%s\n", buffer );
  }
.exmp output
Hello world
Hello world****
.exmp end
.class WATCOM
.system

⌨️ 快捷键说明

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