util/yaz-illclient.c
Z_PromptObject1 *makeprompt(struct prog_args *args, ODR odr) {
    Z_PromptObject1 *p = (Z_PromptObject1 *) odr_malloc(odr, sizeof(*p) );
    Z_ResponseUnit1 *ru = (Z_ResponseUnit1 *) odr_malloc(odr, sizeof(*ru) );

    p->which=Z_PromptObject1_response;
    p->u.response = (Z_Response1*) odr_malloc(odr, sizeof(*(p->u.response)) );
    p->u.response->num=2;
    p->u.response->elements= (Z_ResponseUnit1 **) odr_malloc(odr,
             p->u.response->num*sizeof(*(p->u.response->elements)) );
    /* user id, aka "oclc authorization number" */
    p->u.response->elements[0] = ru;
    ru->promptId = (Z_PromptId *) odr_malloc(odr, sizeof(*(ru->promptId) ));
    ru->promptId->which = Z_PromptId_enumeratedPrompt;
    ru->promptId->u.enumeratedPrompt = (Z_PromptIdEnumeratedPrompt *)
        odr_malloc(odr, sizeof(*(ru->promptId->u.enumeratedPrompt) ));
    ru->promptId->u.enumeratedPrompt->type =
         odr_intdup(odr,Z_PromptIdEnumeratedPrompt_userId);
    ru->promptId->u.enumeratedPrompt->suggestedString = 0 ;
    ru->which = Z_ResponseUnit1_string ;
    ru->u.string = odr_strdup(odr, args->auth_userid);
    /* password */
    ru = (Z_ResponseUnit1 *) odr_malloc(odr, sizeof(*ru) );
    p->u.response->elements[1] = ru;
    ru->promptId = (Z_PromptId *) odr_malloc(odr, sizeof(*(ru->promptId) ));
    ru->promptId->which = Z_PromptId_enumeratedPrompt;
    ru->promptId->u.enumeratedPrompt =  (Z_PromptIdEnumeratedPrompt *)
        odr_malloc(odr, sizeof(*(ru->promptId->u.enumeratedPrompt) ));
    ru->promptId->u.enumeratedPrompt->type =
         odr_intdup(odr,Z_PromptIdEnumeratedPrompt_password);
    ru->promptId->u.enumeratedPrompt->suggestedString = 0 ;
    ru->which = Z_ResponseUnit1_string ;
    ru->u.string = odr_strdup(odr, args->auth_passwd);
    return p;
}
/* * * * * * * * * * * * * * * */
/* Makes a Z39.50-like prompt package with username and password */
Makes a Z39.50-like prompt package with username and password
Makes a Z39 . 50 - like prompt package with username and password
Z_PromptObject1 *makeprompt(struct prog_args *args, ODR odr) {
    Z_PromptObject1 *p = (Z_PromptObject1 *) odr_malloc(odr, sizeof(*p) );
    Z_ResponseUnit1 *ru = (Z_ResponseUnit1 *) odr_malloc(odr, sizeof(*ru) );
    p->which=Z_PromptObject1_response;
    p->u.response = (Z_Response1*) odr_malloc(odr, sizeof(*(p->u.response)) );
    p->u.response->num=2;
    p->u.response->elements= (Z_ResponseUnit1 **) odr_malloc(odr,
             p->u.response->num*sizeof(*(p->u.response->elements)) );
    p->u.response->elements[0] = ru;
    ru->promptId = (Z_PromptId *) odr_malloc(odr, sizeof(*(ru->promptId) ));
    ru->promptId->which = Z_PromptId_enumeratedPrompt;
    ru->promptId->u.enumeratedPrompt = (Z_PromptIdEnumeratedPrompt *)
        odr_malloc(odr, sizeof(*(ru->promptId->u.enumeratedPrompt) ));
    ru->promptId->u.enumeratedPrompt->type =
         odr_intdup(odr,Z_PromptIdEnumeratedPrompt_userId);
    ru->promptId->u.enumeratedPrompt->suggestedString = 0 ;
    ru->which = Z_ResponseUnit1_string ;
    ru->u.string = odr_strdup(odr, args->auth_userid);
    ru = (Z_ResponseUnit1 *) odr_malloc(odr, sizeof(*ru) );
    p->u.response->elements[1] = ru;
    ru->promptId = (Z_PromptId *) odr_malloc(odr, sizeof(*(ru->promptId) ));
    ru->promptId->which = Z_PromptId_enumeratedPrompt;
    ru->promptId->u.enumeratedPrompt =  (Z_PromptIdEnumeratedPrompt *)
        odr_malloc(odr, sizeof(*(ru->promptId->u.enumeratedPrompt) ));
    ru->promptId->u.enumeratedPrompt->type =
         odr_intdup(odr,Z_PromptIdEnumeratedPrompt_password);
    ru->promptId->u.enumeratedPrompt->suggestedString = 0 ;
    ru->which = Z_ResponseUnit1_string ;
    ru->u.string = odr_strdup(odr, args->auth_passwd);
    return p;
}
Z_PromptObject1 * makeprompt ( struct prog_args * args , ODR odr ) { Z_PromptObject1 * p = ( Z_PromptObject1 * ) odr_malloc ( odr , sizeof ( * p ) ) ; Z_ResponseUnit1 * ru = ( Z_ResponseUnit1 * ) odr_malloc ( odr , sizeof ( * ru ) ) ; p -> which = Z_PromptObject1_response ; p -> u . response = ( Z_Response1 * ) odr_malloc ( odr , sizeof ( * ( p -> u . response ) ) ) ; p -> u . response -> num = 2 ; p -> u . response -> elements = ( Z_ResponseUnit1 * * ) odr_malloc ( odr , p -> u . response -> num * sizeof ( * ( p -> u . response -> elements ) ) ) ; p -> u . response -> elements [ 0 ] = ru ; ru -> promptId = ( Z_PromptId * ) odr_malloc ( odr , sizeof ( * ( ru -> promptId ) ) ) ; ru -> promptId -> which = Z_PromptId_enumeratedPrompt ; ru -> promptId -> u . enumeratedPrompt = ( Z_PromptIdEnumeratedPrompt * ) odr_malloc ( odr , sizeof ( * ( ru -> promptId -> u . enumeratedPrompt ) ) ) ; ru -> promptId -> u . enumeratedPrompt -> type = odr_intdup ( odr , Z_PromptIdEnumeratedPrompt_userId ) ; ru -> promptId -> u . enumeratedPrompt -> suggestedString = 0 ; ru -> which = Z_ResponseUnit1_string ; ru -> u . string = odr_strdup ( odr , args -> auth_userid ) ; ru = ( Z_ResponseUnit1 * ) odr_malloc ( odr , sizeof ( * ru ) ) ; p -> u . response -> elements [ 1 ] = ru ; ru -> promptId = ( Z_PromptId * ) odr_malloc ( odr , sizeof ( * ( ru -> promptId ) ) ) ; ru -> promptId -> which = Z_PromptId_enumeratedPrompt ; ru -> promptId -> u . enumeratedPrompt = ( Z_PromptIdEnumeratedPrompt * ) odr_malloc ( odr , sizeof ( * ( ru -> promptId -> u . enumeratedPrompt ) ) ) ; ru -> promptId -> u . enumeratedPrompt -> type = odr_intdup ( odr , Z_PromptIdEnumeratedPrompt_password ) ; ru -> promptId -> u . enumeratedPrompt -> suggestedString = 0 ; ru -> which = Z_ResponseUnit1_string ; ru -> u . string = odr_strdup ( odr , args -> auth_passwd ) ; return p ; }
* * * * * * * * * * * * 
Makes a Z39.50-like prompt package with username and password
* * * * * * * * * * * * Makes a Z39 . 50 - like prompt package with username and password
/* user id, aka "oclc authorization number" */ /* password */