[AIX 진단 서브시스템 12] 진단 라이브러리 (3) 카탈로그·메뉴 함수와 장치 속성
https://archive.horanglab.com/posts/aix-diag-lib-3
핵심 정리
- 카탈로그:
diag_catopen으로 메시지 카탈로그를 열고diag_cat_gets로 메시지를 꺼냅니다. 둘 다$LANG·$NLSPATH경로를 먼저 찾고 없으면 기본 진단 카탈로그 디렉터리를 찾습니다. - 진단 응용 프로그램(DA)의 공통 화면은
diag_resource_screen, 진단 작업(서비스 보조)의 화면은diag_task_screen, 진행 표시는diag_progress, 팝업은diag_popup을 씁니다. 화면 유형은 INFORMATIVE, TRANSITIONAL, DIALOG, SINGLE_SELECTION, MULTIPLE_SELECTION입니다. - ASL 계열:
diag_asl_init(첫 호출) →diag_display·diag_msg·diag_asl_read등 →diag_asl_quit(마지막 호출). 반환값은 눌린 기능 키(DIAG_ASL_ENTER,DIAG_ASL_CANCEL,DIAG_ASL_EXIT등)입니다. - 광 매체:
diag_check_optical_media(상태 확인),diag_load_optical_media(마운트하고 경로 돌려줌),diag_unload_optical_media(마운트 해제). - 장치 정보:
diag_get_property(Open Firmware 장치 트리 특성),diag_get_sid_lun(connwhere의x,y에서 SCSI ID·LUN),get_cpu_model,get_dev_desc(PdDv 카탈로그 설명),get_diag_att(PDiagAtt 속성 읽기).diag_get_device_flag는 AIX 5.2에서 없어졌습니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (내용이 같음) |
| 원문 | Understanding the Diagnostic Subsystem for AIX — 5.3판 3장(130150쪽), 6.1판 122141쪽 |
| 라이브러리 | /usr/lib/libdiag.a |
| 헤더 | diag/diago.h, diag/diag_screen.h, diag/diag.h, diag/modid.h, asl.h |
diag_catopen
목적
진단 카탈로그 메시지 파일을 엽니다.
구문
#include <diag/diago.h>
nl_catd diag_catopen ( filename , reserved )
char* filename ;
int reserved ;
설명
diag_catopen 서브루틴은 카탈로그 메시지 파일을 엽니다. 먼저 $LANG과 $NLSPATH 환경 변수가 지정하는 일반 카탈로그 디렉터리를 찾고, 카탈로그 파일이 없으면 기본 카탈로그 디렉터리를 찾습니다.
매개변수
| 매개변수 | 설명 |
|---|---|
filename |
열 카탈로그 파일 이름 |
반환값
nl_catd 카탈로그 서술자를 돌려줍니다.
영어 원문
diag_catopen
Purpose
Opens a diagnostic catalog message file.
Syntax
#include <diag/diago.h>
nl_catd diag_catopen ( filename , reserved )
char* filename ;
int reserved ;
Description
The diag_catopen subroutine is used to open a catalog message file. It first searches the normal catalog directory as specified by the $LANG and $NLSPATH environment variables. If the catalog file is not found, the function searches the default catalog directory.
Parameters
- filename — Catalog file name to be opened.
Return Value
The diag_catopen subroutine returns a nl_catd catalog descriptor.
diag_cat_gets
목적
NLSPATH나 기본 진단 카탈로그 디렉터리에서 카탈로그 메시지를 얻습니다.
구문
#include <diag/diago.h>
char *diag_cat_gets ( fdes , setid , msgid )
nl_catd fdes ;
unsigned short setid ;
unsigned short msgid ;
설명
diag_cat_gets 서브루틴은 카탈로그 파일에서 메시지를 가져옵니다. 먼저 $LANG과 $NLSPATH 환경 변수가 지정하는 일반 카탈로그 디렉터리를 찾고, 세트와 메시지가 없으면 기본 카탈로그 디렉터리를 찾습니다.
매개변수
| 매개변수 | 설명 |
|---|---|
fdes |
diag_catopen 시스템 호출이 돌려준, 열린 카탈로그 파일 서술자 |
setid |
카탈로그에서 메시지의 세트 ID |
msgid |
카탈로그에서 서식 문자열로 쓸 메시지의 메시지 ID |
반환값
메시지 문자열의 문자 포인터를 돌려줍니다.
영어 원문
diag_cat_gets
Purpose
Obtains catalog messages from NLSPATH or default diagnostic catalog directory.
Syntax
#include <diag/diago.h>
char *diag_cat_gets ( fdes , setid , msgid )
nl_catd fdes ;
unsigned short setid ;
unsigned short msgid ;
Description
The diag_cat_gets subroutine is used to get messages from a catalog file. It first searches the normal catalog directory as specified by the $LANG and $NLSPATH environment variables. If the set and message is not found, the function searches the default catalog directory.
Parameters
- fdes — Open catalog file descriptor returned from the
diag_catopensystem call. - setid — Set ID of the message in the catalog.
- msgid — Message ID of the message in the catalog that serves as the format string.
Return Value
The diag_cat_gets subroutine returns a character pointer to the message string.
diag_popup
목적
메시지 텍스트가 든 팝업 창을 만듭니다.
구문
#include <diag/diag_screen.h>
long diag_popup ( char * fmt, [, name, ...] )
char * fmt;
설명
diag_popup 서브루틴은 팝업 창을 표시합니다.
매개변수
매개변수는 표준 I/O 라이브러리 서브루틴 printf()의 것과 비슷합니다. 메시지 길이는 2000자로 제한됩니다.
반환값
| 값 | 뜻 |
|---|---|
DIAG_CANCEL |
Cancel 키가 눌림 |
DIAG_ENTER |
Enter 기능 키가 눌림 |
DIAG_EXIT |
Exit 기능 키가 눌림 |
영어 원문
diag_popup
Purpose
Creates a popup window with message text.
Syntax
#include <diag/diag_screen.h>
long diag_popup ( char * fmt, [, name, ...] )
char * fmt;
Description
The diag_popup subroutine displays a popup window.
Parameters
The parameters are similar to those of the standard I/O library subroutine printf(). There is a 2000 character limit on the length of the message.
Return Value
The diag_popup subroutine returns one of the following values:
DIAG_CANCEL— Cancel key was entered.DIAG_ENTER— Enter Function key was entered.DIAG_EXIT— Exit Function key was entered.
diag_progress
목적
진단 응용 프로그램과 진단 작업의 진행 메시지를 표시합니다.
구문
#include <diag/diag_screen.h>
#include <diag/diag.h>
void diag_progress ( screen_progress )
screen_prog_t *screen_progress;
설명
diag_progress 서브루틴은 진단 응용 프로그램과 다른 진단 작업이 쓰는 진행 표시를 보여 줍니다.
매개변수
| 매개변수 | 설명 |
|---|---|
screen_prog |
화면 진행 정보(구문의 이름은 screen_progress). 표시할 진행 메시지와 완료 비율을 정의하는 구조체이며 멤버는 아래 표와 같습니다. |
| 멤버 | 설명 |
|---|---|
int max_value |
최댓값(Web-based System Manager 진행 막대에 씀) |
int current_value |
현재 값(Web-based System Manager 진행 막대에 씀) |
char *progress_msg |
표시할 진행 메시지 |
영어 원문
diag_progress
Purpose
Displays progress messages by the Diagnostic Applications and Diagnostic Tasks.
Syntax
#include <diag/diag_screen.h>
#include <diag/diag.h>
void diag_progress ( screen_progress )
screen_prog_t *screen_progress;
Description
The diag_progress subroutine displays the progress indicators used by Diagnostic Applications and other Diagnostic Tasks.
Parameters
screen_prog— Screen Progress Information. This structure defines the progress message to be displayed and the percentage complete. intmax_value(Used for Web-based System Manager progress bars) Maximum value. intcurrent_value(Used for Web-based System Manager progress bars) Current value. char*progress_msgProgress message to be displayed.
diag_read
목적
사용자 입력을 읽습니다.
구문
#include <diag/diag_screen.h>
#include <diag/diag.h>
long diag_read ( screen_info, wait, buffer )
screen_info_t *screen_info;
int wait;
char * buffer;
설명
diag_read 서브루틴은 키보드 버퍼를 읽습니다.
매개변수
| 매개변수 | 설명 |
|---|---|
screen_info |
화면 정보. 화면 유형과 화면 ID를 정의하는 구조체이며 screen_type만 씁니다. short screen_type(화면 유형): INFORMATIVE, TRANSITIONAL, DIALOG, SINGLE_SELECTION, MULTIPLE_SELECTION |
wait |
TRUE면 사용자가 screen_type이 허용하는 키 가운데 하나를 누를 때까지 기다립니다. FALSE면 사용자 입력을 기다리지 않지만, 미리 입력해 둔 것은 TRUE일 때와 똑같이 처리합니다. |
buffer |
응용 프로그램이 할당하며 사용자가 입력한 값을 돌려받는 데 씁니다. 크기는 100바이트를 넘으면 안 됩니다(지금은 구현되지 않음). |
영어 원문
diag_read
Purpose
Reads user input.
Syntax
#include <diag/diag_screen.h>
#include <diag/diag.h>
long diag_read ( screen_info, wait, buffer )
screen_info_t *screen_info;
int wait;
char * buffer;
Description
The diag_read subroutine reads the keyboard buffer.
Parameters
screen_info— Screen Information. This structure defines the screen type and screen ID. Only thescreen_typeis used. shortscreen_typeScreen Type. • INFORMATIVE • TRANSITIONAL • DIALOG •SINGLE_SELECTION•MULTIPLE_SELECTION- wait — If TRUE, causes this subroutine to wait until the user presses one of the keys allowed by the
screen_type. If this parameter is FALSE, then this subroutine does not wait for the user input but processes anything typed ahead just as it would if the parameter were TRUE. - buffer — Allocated by the application. It is used to return the values entered by the user. The buffer size must not be greater than 100 bytes. (Currently not implemented).
diag_resource_screen
목적
진단 응용 프로그램(DA)이 흔히 쓰는 메뉴를 표시합니다.
구문
#include <diag/diag_screen.h>
#include <diag/diag.h>
long diag_resource_screen ( screen_info, screen_data, screen_msg )
screen_info_t *screen_info;
screen_data_t *screen_data;
screen_msg_t screen_msg[];
설명
diag_resource_screen 서브루틴은 진단 응용 프로그램이 흔히 쓰는 메뉴를 표시합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
screen_info |
화면 정보. 화면 유형과 화면 ID를 정의하는 구조체(멤버는 아래 표) |
screen_data |
화면 데이터. 화면을 만드는 데 필요한 모든 데이터를 담은 구조체(멤버는 아래 표) |
screen_msg |
화면 본문을 만드는 데 쓰는 setid와 msgid 배열. 마지막 줄, 곧 지시(INSTRUCTION) 줄을 뺀 모든 메시지가 들어갑니다. TRANSITIONAL 화면 유형에는 필요 없으므로 screen_msg 인수에 NULL을 씁니다(멤버는 아래 표). |
screen_info 멤버
| 멤버 | 설명 |
|---|---|
short screen_type |
화면 유형: INFORMATIVE, TRANSITIONAL, SINGLE_SELECTION |
short screen_id |
화면 식별자: TESTING_MENU, ANALYZE_ERROR_LOG, ANALYZE_POST, ANALYZE_FIRMWARE, ANALYZE_CHECKSTOP, ANALYZE_SUBSYS |
short screen_key |
화면에 더할 기능 키: DIAG_HELP_KEY |
long item_selected |
screen_type이 SINGLE_SELECTION일 때 목록에서 고른 항목. screen_msg의 첫 번째 고를 수 있는 항목이면 1, 두 번째면 2를 돌려주는 식입니다. |
screen_data 멤버
| 멤버 | 설명 |
|---|---|
nl_catd fdes |
카탈로그 파일 서술자 |
long menu_number |
화면 오른쪽 위 모서리에 16진수로 오른쪽 정렬해 표시하는 메뉴 번호 |
char *resource_name |
시험 중인 자원의 이름(tminput->dname) |
char *location_code |
시험 중인 자원의 논리 위치 코드(tminput->dnameloc) |
short test_mode |
이 세션이 실행 중인 시험 모드(ADVANCED, NON_ADVANCED)(tminput->advanced) |
short loop_mode |
루프 모드를 골랐는지(tminput->loopmode) |
short lcount |
지금까지 실행한 전체 횟수. loop_mode가 LOOPMODE_NOTLM이 아닐 때만 씁니다. |
short lerrors |
지금까지 만난 전체 오류 수. loop_mode가 LOOPMODE_NOTLM이 아닐 때만 씁니다. |
short msg_count |
screen_msg 구조체에 든 메시지의 총수 |
screen_msg 멤버
| 멤버 | 설명 |
|---|---|
short set_num |
메시지 텍스트가 든 세트 번호 |
short msg_num |
메시지 텍스트가 든 메시지 번호 |
char *message |
<set_num, msg_num> 대신 쓸 텍스트 메시지. 메시지 텍스트를 만드는 데 문자열 치환이 필요했을 때 유용합니다. NULL이 아니면 <set_num, msg_num>보다 우선합니다. |
short msg_type |
표시할 메시지 유형: HELP_MSG(하나만 허용. 도움말은 특정 줄이 아니라 늘 화면 전체에 연결됩니다), SELECTABLE_MSG, INFO_MSG |
참고
SINGLE_SELECTION화면 유형에서는 이 구조체를 정확히 만들어야 합니다. 고를 수 있는 메시지인screen_msg[0..n]은 모두msg_type이SELECTABLE_MSG여야 합니다.- 지시 줄 앞에 사용자에게 어떤 정보를 보여 주려면
screen_msg[n+1]의msg_type이INFO_MSG여야 합니다. - 도움말 메시지가 있으면 마지막에 둡니다.
반환값
| 값 | 뜻 |
|---|---|
DIAG_OK |
성공 |
DIAG_MALLOCFAILED |
메모리 할당 실패 |
DIAG_ENTER |
Enter 기능 키가 눌림 |
DIAG_EXIT |
Exit 기능 키가 눌림 |
DIAG_CANCEL |
Cancel 기능 키가 눌림 |
DIAG_HELP |
Help 기능 키가 눌림 |
DIAG_FAIL |
자료 구조가 올바르지 않음, 소프트웨어 오류 |
영어 원문
diag_resource_screen
Purpose
Displays menus commonly used by Diagnostic Applications (DA).
Syntax
#include <diag/diag_screen.h>
#include <diag/diag.h>
long diag_resource_screen ( screen_info, screen_data, screen_msg )
screen_info_t *screen_info;
screen_data_t *screen_data;
screen_msg_t screen_msg[];
Description
The diag_resource_screen subroutine displays menus commonly used by Diagnostic Applications.
Parameters
screen_info— Screen Information. This structure defines the screen type and screen ID. shortscreen_typeScreen Type. • INFORMATIVE • TRANSITIONAL •SINGLE_SELECTIONshortscreen_idScreen Identifier. •TESTING_MENU•ANALYZE_ERROR_LOG•ANALYZE_POST•ANALYZE_FIRMWARE•ANALYZE_CHECKSTOP•ANALYZE_SUBSYSshortscreen_keyIdentifies extra function keys for screen. •DIAG_HELP_KEYlongitem_selectedIndicates the selected item in the list, ifscreen_typeisSINGLE_SELECTION. First selectable item inscreen_msgwould have a 1 returned, second selectable item would have a 2 returned, and so on.screen_data— Screen Data. This structure contains all data needed to construct the screen.nl_catdfdes Catalog file descriptor. longmenu_numberMenu number that is displayed, right-justified, as a hex number at the top-right corner of the screen. char*resource_nameThe name of the resource being tested. (tminput->dname) char*location_codeThe logical location code of the resource being tested. (tminput->dnameloc) shorttest_modeThe test mode (ADVANCED,NON_ADVANCED) this session is running in. (tminput->advanced) shortloop_modeIndicates whether Loop Mode has been selected. (tminput->loopmode) short lcount Total number of passes made. This value is used only whenloop_modeis not set toLOOPMODE_NOTLM. short lerrors Total number of errors encountered. This value is used only whenloop_modeis not set toLOOPMODE_NOTLM. shortmsg_countTotal number of messages in thescreen_msgstructure.screen_msg— Thescreen_msgstructure contains an array of setid's and msgid's used to construct the text (or body) of the screen. This includes all messages except the last line, or INSTRUCTION line. This structure is not required for a TRANSITIONAL screen type, use NULL for thescreen_msgargument. shortset_numThe set number containing the message text. shortmsg_numThe message number containing the message text. char*message Text message to use in place of<set_num,msg_num>. This is useful if string substitution was required in order to build the message text. This text will take precedence over the<set_num,msg_num> if not NULL. shortmsg_typeFlag indicating the type of message to be displayed. •HELP_MSGOnly one message of this type allowed. This help message will always be associated with the screen, and not any particular line. •SELECTABLE_MSG•INFO_MSG
NOTES
This structure must be built exactly for a
SINGLE_SELECTIONscreen type.screen_msg[0..n]MUST have themsg_typeset toSELECTABLE_MSGfor all selectable messages.screen_msg[n+1]MUST have themsg_typeset toINFO_MSGif you want some kind of information displayed to the user before the INSTRUCTION line.The help message, if any, should be last.
Return Value
The diag_resource_screen subroutine returns one of the following values:
DIAG_OK— Successful return.DIAG_MALLOCFAILED— Memory allocation was unsuccessful.DIAG_ENTER— Enter Function key was entered.DIAG_EXIT— Exit Function key was entered.DIAG_CANCEL— Cancel Function key was entered.DIAG_HELP— Help Function key was entered.DIAG_FAIL— Invalid data structure, software error
diag_task_screen
목적
진단 작업이 흔히 쓰는 메뉴를 표시합니다.
구문
#include <diag/diag_screen.h>
#include <diag/diag.h>
long diag_task_screen ( screen_info, screen_task_data, screen_task_msg )
screen_info_t *screen_info;
screen_task_t *screen_task_data;
screen_task_msg_t screen_task_msg[];
설명
diag_task_screen 서브루틴은 진단 작업이 흔히 쓰는 메뉴를 표시합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
screen_info |
화면 정보. 화면 유형을 정의하는 구조체(멤버는 아래 표) |
screen_task_data |
화면 데이터. 화면을 만드는 데 필요한 모든 데이터를 담은 구조체(멤버는 아래 표) |
screen_task_msg |
화면 본문을 만드는 데 쓰는 setid와 msgid 배열. 마지막 줄, 곧 지시 줄을 뺀 모든 것이 들어갑니다(멤버는 아래 표). |
screen_info 멤버
| 멤버 | 설명 |
|---|---|
short screen_type |
화면 유형: INFORMATIVE, TRANSITIONAL, DIALOG, SINGLE_SELECTION, MULTIPLE_SELECTION |
short screen_id |
화면 식별자(쓰지 않음) |
short screen_key |
화면에 더할 기능 키: DIAG_LIST_KEY, DIAG_HELP_KEY(screen_type이 INFORMATIVE일 때) |
long item_selected |
screen_type이 SINGLE_SELECTION일 때 목록에서 고른 항목. 첫 번째 고를 수 있는 항목이면 1, 두 번째면 2를 돌려주는 식입니다. MULTIPLE_SELECTION에서는 COMMIT 기능 키를 쓸 때까지 뒤이은 호출에서 현재 선택을 추적하는 데 씁니다. |
screen_task_data 멤버
| 멤버 | 설명 |
|---|---|
nl_catd fdes |
카탈로그 파일 서술자 |
long menu_number |
화면 오른쪽 위 모서리에 16진수로 오른쪽 정렬해 표시하는 메뉴 번호 |
short msg_count |
screen_task_msg 구조체에 든 메시지의 총수 |
screen_task_msg 멤버
| 멤버 | 설명 |
|---|---|
short set_num |
메시지 텍스트가 든 세트 번호 |
short msg_num |
메시지 텍스트가 든 메시지 번호 |
char *message |
<set_num, msg_num> 대신 쓸 텍스트 메시지. 문자열 치환이 필요했을 때 유용하며, NULL이 아니면 <set_num, msg_num>보다 우선합니다. |
short help_set_num |
HELP 키를 눌렀을 때의 메시지 텍스트가 든 세트 번호. 도움말 텍스트는 줄마다 다르며 보통 msg_type이 SELECTABLE_MSG나 DIALOG_MSG일 때 씁니다. |
short help_msg_num |
HELP 키를 눌렀을 때의 메시지 텍스트가 든 메시지 번호. 쓰임은 help_set_num과 같습니다. |
short msg_type |
텍스트가 도움말, 선택, 대화, 정보 가운데 무엇인지 나타내는 플래그: TITLE_MSG, SELECTABLE_MSG, DIALOG_MSG, INFO_MSG |
char leading_char |
메시지 텍스트 앞에 표시할 문자. MULTIPLE_SELECTION 화면에서 어느 항목을 골랐는지 판단하는 장치로도 씁니다. |
long line_num |
내부 화면 줄 번호 |
char op_type |
이 필드에 허용하는 작업 유형 |
char entry_type |
필드에 허용하는 (사용자) 입력 유형 |
char required |
DIAG_YES, DIAG_YES_NON_EMPTY, DIAG_EXCEPT_WHEN_EMPTY, DIAG_NO(기본값). DIAG_YES나 DIAG_YES_NON_EMPTY면 필수 표시를 보여 줍니다. |
char changed |
DIAG_YES, DIAG_NO(기본값). 필드가 기본값에서 바뀌었는지 |
char *disp_values |
허용·기본 선택지의 표시 텍스트(여럿이면 쉼표로 구분) |
char *data_value |
값이 바뀔 수 있는 경로(직접 입력, 목록, 링)가 하나라도 있으면 크기가 (entry_size + 1)인 문자열(버퍼)을 반드시 가리켜야 합니다. |
long entry_size |
입력하거나 돌려받을 수 있는 (data_)value의 최대 크기(disp_values에서 돌려받는 것도 포함) |
long cur_value_index |
(원문에 설명 없음) |
long default_value_index |
기본값의 0부터 시작하는 인덱스 |
반환값
| 값 | 뜻 |
|---|---|
DIAG_OK |
성공 |
DIAG_MALLOCFAILED |
메모리 할당 실패 |
DIAG_ENTER |
Enter 기능 키가 눌림 |
DIAG_EXIT |
Exit 기능 키가 눌림 |
DIAG_CANCEL |
Cancel 기능 키가 눌림 |
DIAG_HELP |
Help 기능 키가 눌림 |
DIAG_LIST |
List 기능 키가 눌림 |
DIAG_FAIL |
자료 구조가 올바르지 않음, 소프트웨어 오류 |
DIAG_COMMIT |
Commit 기능 키가 눌림 |
영어 원문
diag_task_screen
Purpose
Displays menus commonly used by Diagnostic Tasks.
Syntax
#include <diag/diag_screen.h>
#include <diag/diag.h>
long diag_task_screen ( screen_info, screen_task_data, screen_task_msg )
screen_info_t *screen_info;
screen_task_t *screen_task_data;
screen_task_msg_t screen_task_msg[];
Description
The diag_task_screen subroutine displays menus commonly used by Diagnostic Tasks.
Parameters
screen_info— Screen Information. This structure defines the screen type. shortscreen_typeScreen Type. • INFORMATIVE • TRANSITIONAL • DIALOG •SINGLE_SELECTION•MULTIPLE_SELECTIONshortscreen_idScreen Identifier - Not Used. shortscreen_keyIdentifies extra function keys for screen. •DIAG_LIST_KEY•DIAG_HELP_KEYifscreen_typeis INFORMATIVE longitem_selectedIndicates the selected item in the list, ifscreen_typeisSINGLE_SELECTION. First selectable item inscreen_msgwould have a 1 returned, second selectable item would have a 2 returned, and so on. For aMULTIPLE_SELECTIONscreen_type, this field is used to keep track of the current selection for subsequent calls until the COMMIT function key is used.screen_task_data— Screen Data. This structure contains all data needed to construct the screen.nl_catdfdes Catalog file descriptor. longmenu_numberMenu number that is displayed, right-justified, as a hex number at the top-right corner of the screen. shortmsg_countTotal number of messages in thescreen_task_msgstructure.screen_task_msg— Thescreen_task_msgstructure contains an array of setid's and msgid's used to construct the text (or body) of the screen. This includes all except the last line, or Instruction line. shortset_numThe set number containing the message text. shortmsg_numThe message number containing the message text. char*message Text message to use in place of<set_num,msg_num>. This is useful if string substitution was required in order to build the message text. This text will take precedence over the<set_num,msg_num> if not NULL. shorthelp_set_numThe set number containing the message text when the HELP key is pressed. Help message text is line sensitive, and is normally used when themsg_typeis set toSELECTABLE_MSGorDIALOG_MSG. shorthelp_msg_numThe message number containing the message text when the HELP key is pressed. Help message text is line sensitive, and is normally used when themsg_typeis set toSELECTABLE_MSGorDIALOG_MSG. shortmsg_typeFlag indicating if text is help, selectable, dialog, or information. •TITLE_MSG•SELECTABLE_MSG•DIALOG_MSG•INFO_MSGcharleading_charA specific character to be displayed before the message text. Note that this is also used as the mechanism to determine which selectable items had been selected on aMULTIPLE_SELECTIONscreen. longline_numInternal screen line number. charop_typeType of operation allowed on this field charentry_typetype of (user) entry allowed in the field char required •DIAG_YES•DIAG_YES_NON_EMPTY•DIAG_EXCEPT_WHEN_EMPTY•DIAG_NO= default •DIAG_YESorDIAG_YES_NON_EMPTYmeans display required flag char changedDIAG_YES,DIAG_NO= default; field changed from default value char*disp_valuesdisp. text of allowed/default choice(s, separated by ",") char*data_valueMUST point to string (buffer) of size (entry_size+ 1) if there is ANY way values may be changed (typein/list/ring) longentry_sizemaximum size of (data_)valuethat can be entered OR returned (include a "return" of anything fromdisp_values) longcur_value_indexlongdefault_value_index0 origin index of default value
Return Value
The diag_task_screen subroutine returns one of the following values:
DIAG_OK— Successful return.DIAG_MALLOCFAILED— Memory allocation was unsuccessful.DIAG_ENTER— Enter Function key was entered.DIAG_EXIT— Exit Function key was entered.DIAG_CANCEL— Cancel Function key was entered.DIAG_HELP— Help Function key was entered.DIAG_LIST— List Function key was entered.DIAG_FAIL— Invalid data structure, software errorDIAG_COMMIT— Commit function key was entered.
diag_asl_clear_screen
목적
화면을 지웁니다.
구문
#include <diag/diago.h>
long diag_asl_clear_screen ( )
설명
diag_asl_clear_screen 서브루틴은 화면을 지웁니다.
매개변수
매개변수가 없습니다.
반환값
| 값 | 뜻 |
|---|---|
DIAG_ASL_OK |
성공 |
DIAG_ASL_FAIL |
diag_asl_init 뒤, diag_asl_quit 전에 부르지 않음 |
영어 원문
diag_asl_clear_screen
Purpose
Clears the screen.
Syntax
#include <diag/diago.h>
long diag_asl_clear_screen ( )
Description
The diag_asl_clear_screen subroutine is used to clear the screen.
Parameters
Takes no parameters.
Return Value
The following values are returned:
DIAG_ASL_OK— Successful return.DIAG_ASL_FAIL— Not called followingdiag_asl_initand beforediag_asl_quit.
diag_asl_init
목적
사용자 인터페이스를 초기화합니다.
구문
#include <diag/diago.h>
long diag_asl_init ( name )
char * name ;
설명
diag_asl_init 서브루틴은 사용자 인터페이스를 초기화하며, 사용자 인터페이스에 대한 첫 호출이어야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
name |
옵션을 나타냅니다. DEFAULT: 미리 입력(type ahead) 허용. NO_TYPE_AHEAD: 미리 입력 허용하지 않음 |
반환값
| 값 | 뜻 |
|---|---|
DIAG_ASL_OK |
성공 |
DIAG_ASL_ERR_NO_SUCH_TERM |
지정한 TERM 항목이 없음 |
DIAG_ASL_ERR_TERMINFO_GET |
TERMINFO 가져오기 실패 |
DIAG_ASL_ERR_NO_TERM |
TERM 항목이 빠짐 |
DIAG_ASL_ERR_INITSCR |
initscr() 실패 |
DIAG_ASL_ERR_SCREEN_SIZE |
화면·창 크기가 최소보다 작음 |
영어 원문
diag_asl_init
Purpose
Initializes the user interface.
Syntax
#include <diag/diago.h>
long diag_asl_init ( name )
char * name ;
Description
The diag_asl_init subroutine is used to initialize the user interface and should be the first call made to the user interface.
Parameters
- name — Identifies any options. This field has the following values: DEFAULT Type ahead allowed.
NO_TYPE_AHEADType ahead not allowed.
Return Value
The following values are returned:
DIAG_ASL_OK— Successful return.DIAG_ASL_ERR_NO_SUCH_TERM— Specified TERM entry does not exist.DIAG_ASL_ERR_TERMINFO_GET— TERMINFO get failed.DIAG_ASL_ERR_NO_TERM— TERM entry missing.DIAG_ASL_ERR_INITSCR— nitscr() failed.DIAG_ASL_ERR_SCREEN_SIZE— Screen/window size less than minimum.
diag_asl_msg
목적
메시지 텍스트가 든 팝업 창을 만듭니다.
구문
#include <diag/diago.h>
long diag_asl_msg ( fmt , [, name , ... ] )
char * fmt ;
설명
diag_asl_msg 서브루틴은 서비스 보조(service aid)가 정보 텍스트가 든 팝업 창을 표시하는 데만 써야 합니다.
매개변수
매개변수는 표준 I/O 라이브러리 서브루틴 printf의 것과 비슷합니다.
반환값
| 값 | 뜻 |
|---|---|
DIAG_ASL_CANCEL |
Cancel 키가 눌림 |
DIAG_ASL_ENTER |
Enter 키가 눌림 |
DIAG_ASL_HELP |
Help 키가 눌림 |
DIAG_ASL_LIST |
List 키가 눌림 |
DIAG_ASL_COMMAND |
Command 키가 눌림 |
DIAG_ASL_COMMIT |
Commit 키가 눌림 |
영어 원문
diag_asl_msg
Purpose
Creates a pop-up window with message text.
Syntax
#include <diag/diago.h>
long diag_asl_msg ( fmt , [, name , ... ] )
char * fmt ;
Description
The diag_asl_msg subroutine should only be used by service aids to display a pop-up window with informational text.
Parameters
The parameters are similar to those of the standard I/O library subroutine printf.
Return Value
The following values are returned:
DIAG_ASL_CANCEL— Cancel key was pressed.DIAG_ASL_ENTER— Enter key was pressed.DIAG_ASL_HELP— Help key was pressed.DIAG_ASL_LIST— List key was pressed.DIAG_ASL_COMMAND— Command key was pressed.DIAG_ASL_COMMIT— Commit key was pressed.
diag_asl_read
목적
사용자 입력을 읽습니다.
구문
#include <diag/diago.h>
long diag_asl_read ( screen_code , wait , buf )
ASL_SCREEN_CODE screen_code ;
int wait ;
char * buf ;
설명
diag_asl_read 서브루틴은 키보드 버퍼를 읽습니다.
매개변수
| 매개변수 | 설명 |
|---|---|
screen_code |
활성화할 기능 키 묶음을 나타냅니다. |
wait |
True면 사용자가 screen_type이 허용하는 키 가운데 하나를 누를 때까지 기다립니다. False면 사용자 입력을 기다리지 않지만, 미리 입력해 둔 것은 True일 때와 똑같이 처리합니다. |
buf |
응용 프로그램이 할당하며 사용자가 입력한 값을 돌려받는 데 씁니다. 쓴다면 적어도 ASL_READ_BUF_SIZE 크기여야 합니다. 보통은 NULL로 설정하며, NULL이면 눌린 기능 키만 돌려줍니다. |
반환값
| 값 | 뜻 |
|---|---|
DIAG_ASL_OK |
성공 |
DIAG_ASL_FAIL |
데이터 읽기 실패 |
DIAG_ASL_CANCEL |
Cancel 키가 눌림 |
DIAG_ASL_ENTER |
Enter 키가 눌림 |
DIAG_ASL_EXIT |
Exit 키가 눌림 |
영어 원문
diag_asl_read
Purpose
Reads user input.
Syntax
#include <diag/diago.h>
long diag_asl_read ( screen_code , wait , buf )
ASL_SCREEN_CODE screen_code ;
int wait ;
char * buf ;
Description
The diag_asl_read subroutine reads the keyboard buffer.
Parameters
screen_code— Identifies the set of function keys that should be active.- wait — If True, causes this subroutine to wait until the user presses one of the keys allowed by the
screen_type. If this parameter is False, then this subroutine does not wait for the user input but processes anything typed ahead just as it would if the parameter were True. - buf — Allocated by the application. It is used to return the values entered by the user. If used, this buffer MUST be at least
ASL_READ_BUF_SIZE. Normally this value should be set to NULL. When NULL, only the function key pressed is returned.
Return Value
The diag_asl_read subroutine returns one of the following values:
DIAG_ASL_OK— Successful return.DIAG_ASL_FAIL— Failure reading data.DIAG_ASL_CANCEL— Cancel key was entered.DIAG_ASL_ENTER— Enter key was entered.DIAG_ASL_EXIT— Exit key was entered.
diag_asl_quit
목적
사용자 인터페이스를 끝냅니다.
구문
#include <diag/diago.h>
long diag_asl_quit ( name )
char * name ;
설명
diag_asl_quit 서브루틴은 사용자 인터페이스를 끝내며, 사용자 인터페이스에 대한 마지막 호출이어야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
name |
옵션을 나타냅니다. DCTRL: 진단 컨트롤러만 씀. DEFAULT: 다른 모든 응용 프로그램이 씀 |
반환값
늘 0(성공)을 돌려줍니다.
영어 원문
diag_asl_quit
Purpose
Terminates the user interface.
Syntax
#include <diag/diago.h>
long diag_asl_quit ( name )
char * name ;
Description
The diag_asl_quit subroutine is used to end the user interface and should be the last call made to the user interface.
Parameters
- name — Identifies any options. This field has the following values: DCTRL Used by Diagnostic Controller only. DEFAULT Used by all other applications.
Return Value
The following value is always returned:
- 0 — Successful return.
diag_display
목적
메뉴를 표시하고 사용자의 응답을 읽습니다.
구문
#include <diag/diago.h>
long diag_display ( mnum , fdes , msglist , proctype ,
scrtype , menutype , menuinfo )
long mnum ;
nl_catd fdes ;
struct msglist msglist[ ] ;
long proctype ;
long scrtype ;
ASL_SCR_TYPE * menutype ;
ASL_SCR_INFO * menuinfo ;
설명
diag_display 서브루틴은 사용자가 여러 가지 가운데 고를 수 있는 메뉴를 표시하고 사용자의 응답을 읽습니다.
매개변수
| 매개변수 | 설명 |
|---|---|
mnum |
화면 오른쪽 위 모서리에 16진수로 오른쪽 정렬해 표시하는 메뉴 번호 |
fdes |
diag_catopen 시스템 호출이 돌려준, 열린 카탈로그 파일 서술자 |
msglist |
세트 번호와 메시지 ID의 배열. Null 요소로 끝나야 합니다. |
proctype |
수행할 작업 유형. DIAG_MSGONLY: 지정한 메시지를 카탈로그에서 가져오기만 하고 표시하지 않습니다. 응용 프로그램 작성자가 menuinfo 매개변수를 갱신한 뒤 msglist를 Null로 해서 diag_display를 다시 불러야 합니다. DIAG_IO: msglist가 지정한 메시지 목록을(Null이면 menuinfo 배열의 메시지를) menutype 매개변수가 지정한 형식으로 표시합니다. |
scrtype |
표시할 화면 유형. 유형마다 출력 형식과 사용자에게 열리는 기능 키가 정해집니다. |
menutype |
/usr/include/asl.h 파일에 정의되어 있습니다. Null이면 기본 버전을, 아니면 응용 프로그램의 버전을 씁니다. |
menuinfo |
/usr/include/asl.h 파일에 정의되어 있습니다. Null이 아니면 가져온 메시지로 초기화합니다. |
반환값
| 값 | 뜻 |
|---|---|
DIAG_ASL_OK |
성공 |
DIAG_ASL_ARGS1 |
msglist와 menuinfo 매개변수가 모두 Null |
DIAG_ASL_ARGS2 |
DIAG_MSGONLY 옵션을 지정했지만 메시지를 하나도 지정하지 않음 |
DIAG_MALLOCFAILED |
메모리 할당 실패 |
DIAG_ASL_ENTER |
Enter 기능 키가 눌림 |
DIAG_ASL_EXIT |
Exit 기능 키가 눌림 |
DIAG_ASL_CANCEL |
Cancel 기능 키가 눌림 |
DIAG_ASL_HELP |
Help 기능 키가 눌림 |
DIAG_ASL_LIST |
List 기능 키가 눌림 |
DIAG_ASL_COMMIT |
Commit 기능 키가 눌림 |
DIAG_ASL_PRINT |
Print 기능 키가 눌림 |
영어 원문
diag_display
Purpose
Displays a menu and reads the user's response.
Syntax
#include <diag/diago.h>
long diag_display ( mnum , fdes , msglist , proctype ,
scrtype , menutype , menuinfo )
long mnum ;
nl_catd fdes ;
struct msglist msglist[ ] ;
long proctype ;
long scrtype ;
ASL_SCR_TYPE * menutype ;
ASL_SCR_INFO * menuinfo ;
Description
The diag_display subroutine displays a menu that has multiple user selections and reads the user's response.
Parameters
- mnum — Menu number that is displayed, right-justified, as a hex number at the top-right corner of the screen.
- fdes — Open catalog file descriptor returned from the
diag_catopensystem call. - msglist — Array of set numbers and message IDs. The msglist parameter must be ended by a Null element.
- proctype — Specifies the type of operation to be performed. This parameter has the following values:
DIAG_MSGONLYThe specified messages are retrieved from the catalog, but not displayed. The application writer should update the menuinfo parameter and restart thediag_displaysubroutine with the msglist parameter equal to Null.DIAG_IOThe list of messages specified by msglist or, if that is Null, those in the array menuinfo, are displayed in the format specified by the menutype parameter. - scrtype — Specifies the type of screen to be displayed, where each type determines the format of the output and the active function keys for the user.
- menutype — Defined in the file /usr/include/asl.h. If this parameter is equal to Null, the default version is used. Otherwise, the application's version is used.
- menuinfo — Defined in the file /usr/include/asl.h. If this field is not equal to Null, it is initialized with the retrieved messages.
Return Value
The diag_display subroutine returns one of the following values:
DIAG_ASL_OK— Successful return.DIAG_ASL_ARGS1— Both the msglist and menuinfo parameters were Null.DIAG_ASL_ARGS2—DIAG_MSGONLYoption was specified, but no messages were named.DIAG_MALLOCFAILED— Memory allocation was unsuccessful.DIAG_ASL_ENTER— Enter Function key was entered.DIAG_ASL_EXIT— Exit Function key was entered.DIAG_ASL_CANCEL— Cancel Function key was entered.DIAG_ASL_HELP— Help Function key was entered.DIAG_ASL_LIST— List Function key was entered.DIAG_ASL_COMMIT— Commit Function key was entered.DIAG_ASL_PRINT— Print Function key was entered.
diag_display_menu
목적
진단 응용 프로그램(DA)이 흔히 쓰는 메뉴를 표시합니다.
구문
#include <diag/diago.h>
#include <diag/diag.h>
long diag_display_menu ( msgid, mnum, substitution, lcount, lerrors )
long msgid;
long mnum;
char *substitution[];
int lcount;
int lerrors;
설명
diag_display_menu 서브루틴은 흔히 쓰는 메뉴를 표시합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
msgid |
dcda.msg에 정의된 메시지 ID 번호. 지금 정의된 메시지 ID는 CUSTOMER_TESTING_MENU, ADVANCED_TESTING_MENU, LOOPMODE_TESTING_MENU, NO_MICROCODE_MENU, NO_DIAGMICROCODE_MENU, NO_DDFILE_MENU, NO_HOT_KEY, DEVICE_INITIAL_STATE_FAILURE입니다. |
mnum |
화면 오른쪽 위 모서리에 16진수로 오른쪽 정렬해 표시하는 메뉴 번호 |
substitution |
메뉴에 치환할 문자열을 넘깁니다. 문자 포인터 세 개의 배열이어야 하며, 첫째는 장치 설명 텍스트, 둘째는 TMInput->dname에서 온 장치 이름, 셋째는 위치 코드입니다. |
lcount |
루프 횟수 값을 표시하게 합니다. mnum이 LOOPMODE_TESTING_MENU일 때만 씁니다. |
lerrors |
오류 수 값을 표시하게 합니다. mnum이 LOOPMODE_TESTING_MENU일 때만 씁니다. |
반환값
| 값 | 뜻 |
|---|---|
DIAG_ASL_OK |
성공 |
DIAG_ASL_ARGS1 |
msglist와 menuinfo 매개변수가 모두 Null |
DIAG_ASL_ARGS2 |
DIAG_MSGONLY 옵션을 지정했지만 메시지를 하나도 지정하지 않음 |
DIAG_MALLOCFAILED |
메모리 할당 실패 |
DIAG_ASL_ENTER |
Enter 기능 키가 눌림 |
DIAG_ASL_EXIT |
Exit 기능 키가 눌림 |
DIAG_ASL_CANCEL |
Cancel 기능 키가 눌림 |
DIAG_ASL_HELP |
Help 기능 키가 눌림 |
DIAG_ASL_LIST |
List 기능 키가 눌림 |
DIAG_ASL_COMMIT |
Commit 기능 키가 눌림 |
DIAG_ASL_PRINT |
Print 기능 키가 눌림 |
영어 원문
diag_display_menu
Purpose
Displays menus commonly used by Diagnostic Applications (DA).
Syntax
#include <diag/diago.h>
#include <diag/diag.h>
long diag_display_menu ( msgid, mnum, substitution, lcount, lerrors )
long msgid;
long mnum;
char *substitution[];
int lcount;
int lerrors;
Description
The diag_display_menu subroutine displays commonly used menus.
Parameters
- msgid — Message ID number defined in dcda.msg. Currently, the following message IDs are defined:
CUSTOMER_TESTING_MENUADVANCED_TESTING_MENULOOPMODE_TESTING_MENUNO_MICROCODE_MENUNO_DIAGMICROCODE_MENUNO_DDFILE_MENUNO_HOT_KEYDEVICE_INITIAL_STATE_FAILURE - mnum — Menu number that is displayed, right-justified, as a hex number at the top-right corner of the screen.
- substitution — Used to pass in strings to be substituted in the menu. This must be an array of three (3) character pointers. The device descriptive text is the first element. The device name as it comes from TMInput->dname is the second, and the location code is the third.
- lcount — Used to allow the loop-count value to be displayed. This value is used only when mnum is set to
LOOPMODE_TESTING_MENU. - lerrors — Used to allow the number of errors value to be displayed. This value is used only when mnum is set to
LOOPMODE_TESTING_MENU.
Return Value
The diag_display_menu subroutine returns one of the following values:
DIAG_ASL_OK— Successful return.DIAG_ASL_ARGS1— Both the msglist and menuinfo parameters were Null.DIAG_ASL_ARGS2—DIAG_MSGONLYoption was specified, but no messages were named.DIAG_MALLOCFAILED— Memory allocation was unsuccessful.DIAG_ASL_ENTER— Enter Function key was entered.DIAG_ASL_EXIT— Exit Function key was entered.DIAG_ASL_CANCEL— Cancel Function key was entered.DIAG_ASL_HELP— Help Function key was entered.DIAG_ASL_LIST— List Function key was entered.DIAG_ASL_COMMIT— Commit Function key was entered.DIAG_ASL_PRINT— Print Function key was entered.
diag_emsg
목적
오류 메시지를 표시합니다.
주의
진단 응용 프로그램(DA)은 이 서브루틴을 쓰면 안 됩니다.
구문
#include <diag/diago.h>
long diag_emsg ( fdes , setid , msgid [, val ,... ] )
nl_catd fdes ;
unsigned short setid ;
unsigned short msgid ;
설명
diag_emsg 서브루틴은 오류 메시지를 표시합니다. 보통 서비스 보조에서 씁니다.
매개변수
| 매개변수 | 설명 |
|---|---|
fdes |
diag_catopen 시스템 호출이 돌려준, 열린 카탈로그 파일 서술자 |
setid |
카탈로그에서 메시지의 세트 ID |
msgid |
카탈로그에서 서식 문자열로 쓸 메시지의 메시지 ID |
val |
개수가 정해지지 않은 선택 값. 표준 I/O 라이브러리 printf() 서브루틴의 규칙대로 지정한 메시지에 끼워 넣습니다. 서식은 카탈로그 세트·메시지 ID가 가리키는 메시지가 정합니다. |
반환값
| 값 | 뜻 |
|---|---|
DIAG_ASL_OK |
성공 |
DIAG_ASL_CANCEL |
Cancel 키가 눌림 |
DIAG_ASL_EXIT |
Exit 키가 눌림 |
영어 원문
diag_emsg
Purpose
Displays error messages.
Note: Diagnostic Applications (DAs) should not use this subroutine.
Syntax
#include <diag/diago.h>
long diag_emsg ( fdes , setid , msgid [, val ,... ] )
nl_catd fdes ;
unsigned short setid ;
unsigned short msgid ;
Description
The diag_emsg subroutine displays an error message. Normally used with service aids.
Parameters
- fdes — Open catalog file descriptor returned from the
diag_catopensystem call. - setid — Set ID of the message in the catalog.
- msgid — Message ID of the message in the catalog that serves as the format string.
- val — Values that are optional and variable in number are inserted in the specified message according to the conventions assumed by the printf() subroutine in the standard I/O library. The format is specified by the message referenced by the catalog set and message ID.
Return Value
The diag_emsg subroutine returns one of the following values:
DIAG_ASL_OK— Successful return.DIAG_ASL_CANCEL— Cancel key was entered.DIAG_ASL_EXIT— Exit key was entered.
diag_msg, diag_msg_nw
목적
간단한 메뉴를 표시합니다.
구문
#include <diag/diago.h>
long diag_msg ( mnum , fdes , setid , msgid [, val , ... ] )
long mnum ;
nl_catd fdes ;
unsigned short setid ;
unsigned short msgid ;
long diag_msg_nw ( mnum , fdes , setid , msgid [, val , ... ] )
long mnum ;
nl_catd fdes ;
unsigned short setid ;
unsigned short msgid ;
설명
diag_msg 서브루틴은 지정한 텍스트를 표시하고 사용자의 응답을 얻습니다. 끝나면 화면을 자동으로 지웁니다.
diag_msg_nw 서브루틴은 지정한 텍스트를 표시하지만 사용자의 응답을 기다리지 않습니다. 화면은 자동으로 지워지지 않습니다.
매개변수
| 매개변수 | 설명 |
|---|---|
mnum |
화면 오른쪽 위 모서리에 16진수로 오른쪽 정렬해 표시하는 메뉴 번호 |
fdes |
diag_catopen 시스템 호출이 돌려준, 열린 카탈로그 파일 서술자 |
setid |
카탈로그에서 메시지의 세트 ID |
msgid |
카탈로그에서 서식 문자열로 쓸 메시지의 메시지 ID |
val |
개수가 정해지지 않은 선택 값. 표준 I/O 라이브러리 printf() 서브루틴의 규칙대로 지정한 메시지에 끼워 넣습니다. 서식은 카탈로그 세트·메시지 ID가 가리키는 메시지가 정합니다. |
반환값
| 값 | 뜻 |
|---|---|
DIAG_ASL_OK |
성공 |
DIAG_ASL_CANCEL |
Cancel 키가 눌림 |
DIAG_ASL_EXIT |
Exit 키가 눌림 |
영어 원문
diag_msg, diag_msg_nw
Purpose
Displays simple menus.
Syntax
#include <diag/diago.h>
long diag_msg ( mnum , fdes , setid , msgid [, val , ... ] )
long mnum ;
nl_catd fdes ;
unsigned short setid ;
unsigned short msgid ;
long diag_msg_nw ( mnum , fdes , setid , msgid [, val , ... ] )
long mnum ;
nl_catd fdes ;
unsigned short setid ;
unsigned short msgid ;
Description
The diag_msg subroutine displays the specified text and obtains the user's response. The screen is automatically cleared upon completion.
The diag_msg_nw subroutine displays the specified text but does not wait for the user to respond. The screen is not automatically cleared.
Parameters
- mnum — Menu number that is displayed, right-justified, as a hex number at the top-right corner of the screen.
- fdes — Open catalog file descriptor returned from the
diag_catopensystem call. - setid — Set ID of the message in the catalog.
- msgid — Message ID of the message in the catalog that serves as the format string.
- val — Values that are optional and variable in number are inserted in the specified message according to the conventions assumed by the printf() subroutine in the standard I/O library. The format is specified by the message referenced by the catalog set and message ID.
Return Value
The diag_msg subroutine returns one of the following values:
DIAG_ASL_OK— Successful return.DIAG_ASL_CANCEL— Cancel key was entered.DIAG_ASL_EXIT— Exit key was entered.
diag_check_optical_media
목적
광 드라이브의 상태를 확인합니다.
구문
#include <diag.h>
int diag_check_optical_media(device_name)
char * device_name
설명
diag_check_optical_media 함수는 호출자가 넘긴 광 매체 장치 이름을 받아 드라이브의 상태를 확인하고, 할 수 있으면 마운트를 풉니다.
매개변수
| 매개변수 | 설명 |
|---|---|
device_name |
호출자가 접근하려는 광 매체 드라이브 이름. /dev/cdXX이며 XX는 ODM에 나열된 광 드라이브 번호입니다. |
반환값
| 값 | 뜻 |
|---|---|
| -2 | 소프트웨어 오류로 실패 |
| -1 | 실패. 광 장치가 사용 중 |
| 0 | 성공. 고른 광 장치를 쓸 준비가 됨 |
영어 원문
diag_check_optical_media
Purpose
Checks the status of the optical drive.
Syntax
#include <diag.h>
int diag_check_optical_media(device_name)
char * device_name
Description
The diag_check_optical_media function will take an optical media device name passed by the caller and check the status of the drive and unmount it if possible.
Parameters
device_name— This is the name of the optical media drive requested by the caller to be accessed. /dev/cdXX where XX is the number of the optical drive as listed by the ODM.
Return Value
- -2 — Fail due to software error.
- -1 — Fail. Optical device is in use.
- 0 — Success. The optical device chosen is ready for use.
diag_get_device_flag
목적
잔여(residual) 데이터 정보에서 장치 플래그를 얻습니다.
주의
이 진단 라이브러리 함수는 AIX 5.2에서 없어졌지만 참고용으로 정보를 남겨 두었습니다.
구문
#include <diag/diag.h>
#include <sys/residual.h>
int diag_get_device_flag (
char * device_name ,
long * Flag )
설명
diag_get_device_flag 서브루틴은 잔여 데이터에서 device_name으로 지정한 장치에 맞는 객체를 찾습니다. 그 장치의 DEVICE_ID 구조체에 정의된 Flags 필드 값을 Flag 인수로 돌려줍니다.
구현 특성
POWER 프로세서 기반
매개변수
| 매개변수 | 설명 |
|---|---|
device_name |
장치의 논리 이름이 든 문자열의 포인터 |
Flag |
sys/residual.h 헤더 파일에 정의된 DEVICE_ID 구조체의 Flag 필드 값을 써 넣을 long 정수의 포인터 |
반환값
장치 플래그 정보를 성공적으로 가져오면 0을, diag_get_device_flag가 실패하면 -1을 돌려줍니다.
영어 원문
diag_get_device_flag
Purpose
Obtain device flag from residual data information.
Attention
This diagnostic library function has been removed in AIX® 5.2 but the information has been
left in for reference.
Syntax
#include <diag/diag.h>
#include <sys/residual.h>
int diag_get_device_flag (
char * device_name ,
long * Flag )
Description
The diag_get_device_flagsubroutine searches residual data for an object matching the devicespecified by device_name. The value of the Flags field asdefined in the DEVICE_ID structure for the device is returned inthe Flag argument.
Implementation Specifics
POWER® processor-based
Parameters
device_name— Pointer to a character string containing the logical name of the device.- Flag — Pointer to a long integer where the value of the Flag field in the
DEVICE_IDstructure as defined by sys/residual.h header file will be written.
Return Value
Upon successful completion, a 0 isreturned if the device flag information was retrieved successfully. If thediag_get_device_flag fails, a value of -1 is returned.
diag_get_property
목적
CHRP(Common Hardware Reference Platform) 펌웨어에서 자원의 특성(property) 값을 얻습니다.
구문
#include <diag/diag.h>
char *diag_get_property (
char * device_name ,
char * property_name,
int * property_length )
설명
diag_get_property 서브루틴은 Open Firmware 장치 트리를 찾아 지정한 자원에 연결된 특성 값을 얻습니다. 자원은 Open Firmware 장치 트리 노드가 대응하는 올바른 ODM 자원 이름이어야 합니다. 자원에 대응하는 노드가 Open Firmware 장치 트리에 없거나 특성 값이 없으면 char *NULL을 돌려줍니다.
구현 특성
POWER 프로세서 기반
매개변수
| 매개변수 | 설명 |
|---|---|
device_name |
장치의 논리 이름이 든 문자열의 포인터 |
property_name |
찾을 특성이 든 문자열의 포인터 |
property_length |
반환 문자 값이 가리키는 문자의 총수 |
반환값
성공하면 요청한 특성의 값(또는 값들)이 든 문자열을 돌려줍니다. 값이 여럿이면 NULL 값으로 구분될 수 있습니다. 자원이 올바르지 않거나 특성 값이 없으면 char *NULL을 돌려줍니다.
영어 원문
diag_get_property
Purpose
Obtain property value from Common Hardware Reference Platform (CHRP) firmware for a resource.
Syntax
#include <diag/diag.h>
char *diag_get_property (
char * device_name ,
char * property_name,
int * property_length )
Description
The diag_get_property subroutine searches the Open Firmware device tree to obtain the value of a property associated with the specified resource. The resource must be a valid ODM resource name with a corresponding Open Firmware device tree node. If the resource's corresponding node is not found in the Open Firmware device tree, or if the property value is not found, then a char *NULL is returned.
Implementation Specifics
POWER® processor-based
Parameters
device_name— Pointer to a character string containing the logical name of the device.property_name— Pointer to a character string containing the property to find.property_length— Contains total number of characters pointed to by the return character value.
Return Value
Upon successful completion, a character string is returned containing the value (or values) of the property requested. Multiple values may be separated by a NULL value. If the resource is not valid, or the property value is not found, then a char *NULL is returned.
diag_get_sid_lun
목적
SCSI 주소에서 SCSI ID와 LUN(논리 장치 번호)을 돌려줍니다.
구문
#include <diag/diag.h>
int diag_get_sid_lun ( scsiaddr, sid_addr, lun_addr )
char * scsiaddr ;
uchar * sid_addr;
uchar * lun_addr ;
설명
diag_get_sid_lun 서브루틴은 장치의 SCSI 주소에 연결된 SCSI ID와 논리 장치 번호를 돌려줍니다. SCSI 주소는 CuDv 객체 클래스의 connwhere 필드가 쓰는 형식이어야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
scsiaddr |
SCSI 장치 주소의 포인터. 장치의 connwhere 필드이며 형식은 x,y(x는 SCSI ID, y는 논리 장치 번호)입니다. |
sid_addr |
장치의 SCSI ID를 가리키는 포인터 |
lun_addr |
장치의 논리 장치 번호를 가리키는 포인터 |
반환값
| 값 | 뜻 |
|---|---|
| 0 | 성공 |
| -1 | 오류. SCSI 주소 형식이 올바르지 않음 |
영어 원문
diag_get_sid_lun
Purpose
Returns the SCSI ID and Logical Unit Number (LUN) from a SCSI address.
Syntax
#include <diag/diag.h>
int diag_get_sid_lun ( scsiaddr, sid_addr, lun_addr )
char * scsiaddr ;
uchar * sid_addr;
uchar * lun_addr ;
Description
The diag_get_sid_lun subroutine returns the SCSI ID and logical unit number associated with a SCSI address for a device. The SCSI address must be in the format used by the connwhere field in CuDv object class.
Parameters
- scsiaddr — Pointer to the address of the SCSI device. This is the connwhere field of the device. Format is "x,y" where x is the SCSI ID, and y is the logical unit number.
sid_addr— Pointer to the SCSI ID of the device.lun_addr— Pointer to the logical unit number of the device.
Return Value
The diag_get_sid_lun subroutine returns one of the following values:
- 0 — Successful return.
- -1 — Error. Incorrect format for SCSI address.
diag_load_optical_media
목적
광 매체 데이터를 읽어 들여 호출자가 쓸 수 있게 합니다.
구문
#include <diag.h>
int diag_load_optical_media(device_name, mnt_path)
char * device_name
char * mnt_path
설명
diag_load_optical_media 함수는 호출자가 넘긴 광 매체 장치 이름을 받아, 그 데이터를 돌려줄 마운트 경로에 마운트해 호출자가 데이터에 접근하게 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
device_name |
호출자가 접근하려는 광 매체 드라이브 이름. /dev/cdXX이며 XX는 ODM에 나열된 광 드라이브 번호입니다. |
mnt_path |
광 매체 데이터에 접근하도록 호출자에게 돌려주는 마운트 경로(예: /usr/lpp/diagnostics/mnt/cdXX, XX는 ODM이 광 드라이브에 준 번호) |
반환값
| 값 | 뜻 |
|---|---|
DIAG_NO_MEDIA |
실패. 드라이브에 매체가 없음 |
| -2 | 실패. 소프트웨어 오류 |
| -1 | 실패. 장치가 사용 중 |
| 0 | 마운트 성공 |
영어 원문
diag_load_optical_media
Purpose
Loads optical media data and makes it available to the caller.
Syntax
#include <diag.h>
int diag_load_optical_media(device_name, mnt_path)
char * device_name
char * mnt_path
Description
The diag_load_optical_media function will take an optical media device name passed by the caller and mount its data over a returned mounted path for the caller to access the data.
Parameters
device_name— This is the name of the optical media drive requested by the caller to be accessed. /dev/cdXX where XX is the number of the optical drive as listed by the ODM.mnt_path— This is the mounted path returned to the caller to access the optical media data (for example, /usr/lpp/diagnostics/mnt/cdXX) where XX is the drive number given to the optical drive by the ODM.
Return Value
DIAG_NO_MEDIA— Fail. No Media found in the drive.- -2 — Fail. Software error.
- -1 — Fail. Device is in use.
- 0 — The mount was successful.
diag_unload_optical_media
목적
광 매체 드라이브의 마운트를 풀어 호출자가 쓸 수 있게 합니다.
구문
#include <diag.h>
int diag_unload_optical_media(device_name)
char * device_name
설명
diag_unload_optical_media 함수는 호출자가 넘긴 광 매체 장치 이름을 받아, 드라이브가 다른 응용 프로그램에 이미 마운트되어 있거나 사용 중이 아닐 때에만 마운트를 풉니다.
매개변수
| 매개변수 | 설명 |
|---|---|
device_name |
호출자가 접근하려는 광 매체 드라이브 이름. /dev/cdXX이며 XX는 ODM에 나열된 광 드라이브 번호입니다. |
반환값
| 값 | 뜻 |
|---|---|
| -2 | 실패. 소프트웨어 오류 |
| -1 | 실패. 장치가 사용 중 |
| 0 | 성공(원문은 "마운트 성공"이라고 적음) |
영어 원문
diag_unload_optical_media
Purpose
Unmounts the optical media drive and makes it available to the caller.
Syntax
#include <diag.h>
int diag_unload_optical_media(device_name)
char * device_name
Description
The diag_unload_optical_media function takes an optical media device name passed by the caller and unmounts the drive, if and only if, the drive is not already mounted or in use by another application.
Parameters
device_name— This is the name of the optical media drive requested by the caller to be accessed. /dev/cdXX where XX is the number of the optical drive as listed by the ODM.
Return Value
- -2 — Fail. Software error.
- -1 — Fail. Device is in use.
- 0 — The mount was successful.
get_cpu_model
목적
CPU 모델 번호를 돌려줍니다.
구문
#include <diag/modid.h>
unsigned int get_cpu_model ( model_code )
int model_code ;
설명
get_cpu_model 서브루틴은 CPU 모델 번호를 얻습니다.
참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.
구현 특성
POWER 프로세서 기반
매개변수
| 매개변수 | 설명 |
|---|---|
model_code |
sys0 모델 코드로 CuAt 데이터베이스에 저장된 속성. 함수가 돌려주는 부호 없는 정수는 IPL 제어 블록에서 얻은 원래 모델 코드입니다. modid.h에 정의된 매크로로 패키지 유형(타워, 랙, 데스크톱), 속도(저, 중, 고, 터보), 기계 유형(Release 1, RSC, Release 2, PowerPC)을 알아낼 수 있습니다. |
반환값
성공하면 iplcb 구조체에 저장된 모델 코드를, 아니면 -1을 돌려줍니다.
영어 원문
get_cpu_model
Purpose
Returns the CPU model number.
Syntax
#include <diag/modid.h>
unsigned int get_cpu_model ( model_code )
int model_code ;
Description
The get_cpu_model subroutine gets the CPU model number.
init_dgodm must be called before starting this subroutine.
Parameters
Implementation Specifics
POWER® processor-based
model_code— Attribute stored in the CuAt database for the sys0 model code. The unsigned integer returned by the function is the raw model code obtained from the IPL control block. Macros are defined in modid.h. These macros can be used to determine the following information: Package Type Tower, Rack, or Desktop. Speed Low, Medium, High, or Turbo Charged. Machine Type Release 1, RSC, Release 2, or PowerPC.
Return Value
Upon successful completion, the model code as stored in the iplcb structure is returned. Otherwise, a value of -1 is returned.
get_dev_desc
목적
장치의 설명 텍스트를 돌려줍니다.
구문
char * get_dev_desc ( device_name )
char * device_name ;
설명
get_dev_desc 서브루틴은 장치에 연결된 설명 텍스트를 얻습니다. 이 텍스트는 장치의 PdDv 항목의 catalog 필드에 저장되며, 대부분의 장치는 /usr/lib/methods/devices.cat 파일에 있습니다. 다른 카탈로그를 쓰는 장치도 있습니다.
참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
device_name |
장치 이름을 가리키는 문자 포인터 |
반환값
성공하면 메모리에 있는 텍스트 문자열의 char 포인터를, 아니면 -1을 돌려줍니다.
영어 원문
get_dev_desc
Purpose
Returns the device's descriptive text.
Syntax
char * get_dev_desc ( device_name )
char * device_name ;
Description
The get_dev_desc subroutine gets the descriptive text associated with the device. This text is stored in the catalog field of the PdDv entry for the device. This is usually found in the /usr/lib/methods/devices.cat file for most devices. Other devices may use different catalogs.
Note: init_dgodm must be called before starting this subroutine.
Parameters
device_name— Character pointer to the name of the device.
Return Value
Upon successful completion, a char pointer to a text string in memory is returned. Otherwise, a value of -1 is returned.
get_diag_att
목적
사전 정의 데이터베이스 PDiagAtt에서 속성을 읽습니다.
구문
#include <diag/modid.h>
int get_diag_att ( type, attribute, conversion, byte_count, value )
char * type ;
char * attribute ;
char conversion ;
int * byte_count ;
void * value ;
설명
get_diag_att 서브루틴은 사전 정의 진단 데이터베이스 PDiagAtt에서 속성을 가져옵니다.
매개변수
| 매개변수 | 설명 |
|---|---|
type |
장치 유형. Class/SubClass/Type 문자열이어야 합니다. 이렇게 완전한 문자열을 쓰면 PdDv 객체 클래스에서 Type 값이 같은 객체 둘을 찾게 될 가능성이 줄어듭니다. |
attribute |
사전 정의 속성 객체 클래스에서 가져올 속성 이름 |
conversion |
속성을 변환할 데이터 형(아래 표) |
byte_count |
바이트 수(바이트 시퀀스일 때만) |
value |
변환한 속성 값을 돌려줄 곳의 포인터 |
conversion 값
| 값 | 뜻 |
|---|---|
| 's' | 문자열, rep = s |
| 'b' | 바이트 시퀀스, rep = s(예: "0x56FFE67") |
| 'l' | long, rep = n |
| 'i' | int, rep = n |
| 'h' | short(half), rep = n |
| 'f' | float, rep = n |
| 'c' | char, rep = n 또는 s |
| 'a' | 주소, rep = n |
반환값
성공하면 0을, 아니면 -1을 돌려줍니다.
영어 원문
get_diag_att
Purpose
Reads an attribute from the predefined database PDiagAtt.
Syntax
#include <diag/modid.h>
int get_diag_att ( type, attribute, conversion, byte_count, value )
char * type ;
char * attribute ;
char conversion ;
int * byte_count ;
void * value ;
Description
The get_diag_att subroutine gets attributes from the predefined diagnostic database PDiagAtt.
Parameters
The arguments are defined as follows:
- type — Device type, which should be Class/SubClass/Type string. This fully qualified string reduces the chance of finding two objects having the same Type value in the PdDv object class.
- attribute — Attribute name to get from the Predefined Attribute Object Class.
- conversion — The data type to which the attribute is to be converted, including the following: 's' = string rep = s 'b' = byte sequence rep = s (for example "0x56FFE67") 'l' = long rep = n 'i' = int rep = n 'h' = short (half) rep = n 'f' = float rep = n 'c' = char rep = n, or s 'a' = address rep = n
byte_count— Number of bytes (for byte sequence only).- value — Pointer to where the converted attribute value is returned.
Return Value
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned.
관련 글: 진단 라이브러리 (2), 진단 라이브러리 (4), 진단 작업 (1)