![Linux에 dspcat와 유사한 유틸리티가 있습니까?](https://linux55.com/image/37615/Linux%EC%97%90%20dspcat%EC%99%80%20%EC%9C%A0%EC%82%AC%ED%95%9C%20%EC%9C%A0%ED%8B%B8%EB%A6%AC%ED%8B%B0%EA%B0%80%20%EC%9E%88%EC%8A%B5%EB%8B%88%EA%B9%8C%3F.png)
답변1
소스 코드를 찾았습니다 dspcat.c
.http://www.smart.net/~rlhamil/. 특히 이와 관련하여보관소. 컴파일을 시도했지만 변수가 누락되었습니다.
$ make
cc -O -DSOLARIS dspcat.c -o dspcat
dspcat.c: In function ‘format_msg’:
dspcat.c:11:23: error: ‘NL_TEXTMAX’ undeclared (first use in this function)
static char result[NL_TEXTMAX*2+1];
^
dspcat.c:11:23: note: each undeclared identifier is reported only once for each function it appears in
dspcat.c: In function ‘print_file’:
dspcat.c:240:23: error: ‘NL_SETMAX’ undeclared (first use in this function)
int setlo=1, sethi=NL_SETMAX, msglo=1, msghi=NL_MSGMAX, x, y;
^
dspcat.c:240:49: error: ‘NL_MSGMAX’ undeclared (first use in this function)
int setlo=1, sethi=NL_SETMAX, msglo=1, msghi=NL_MSGMAX, x, y;
^
dspcat.c: In function ‘main’:
dspcat.c:338:30: error: ‘NL_MSGMAX’ undeclared (first use in this function)
if (msg_nr<1 || msg_nr>NL_MSGMAX) {
^
dspcat.c:353:32: error: ‘NL_SETMAX’ undeclared (first use in this function)
if (msg_set<1 || msg_set>NL_SETMAX) {
^
make: *** [dspcat] Error 1
내 시스템에 변수가 NL_SETMAX
정의되지 않은 것 같습니다. 나는 이 헤더 파일을 찾았고 bits/xopen_lim.h
여기에 이 변수가 있었기 때문에 변덕스럽게 헤더 파일 목록에 추가했습니다.
$ make
cc -O -DSOLARIS dspcat.c -o dspcat
dspcat.c: In function ‘format_msg’:
dspcat.c:11:33: warning: integer overflow in expression [-Woverflow]
static char result[NL_TEXTMAX*2+1];
^
dspcat.c:11:16: error: size of array ‘result’ is negative
static char result[NL_TEXTMAX*2+1];
^
dspcat.c:11:16: error: storage size of ‘result’ isn’t constant
dspcat.c:15:29: warning: integer overflow in expression [-Woverflow]
for (x=0; x < (NL_TEXTMAX*2) && *s != '\0'; s++)
^
make: *** [dspcat] Error 1
시간이 더 있으면 이것을 시도해 볼 수 있지만 코드에서 직접 변수를 정적으로 설정하면 직접 컴파일할 수 있을 것이라고 생각합니다.