Created
August 4, 2015 17:02
-
-
Save mariuz/efc321ba8a38929a5541 to your computer and use it in GitHub Desktop.
isc_service_attach test gcc isc_service_attach.c -lfbclient
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <ibase.h> | |
int main (void) { | |
char *user = "SYSDBA", | |
*pass = "masterkey"; | |
char *x; | |
ISC_STATUS status [20]; | |
isc_svc_handle *svc_handle = NULL; | |
char svc_name[32], | |
spb_buff[128], | |
*spb = spb_buff; | |
ISC_USHORT spblen; | |
*spb++ = isc_spb_version; | |
*spb++ = isc_spb_current_version; | |
*spb++ = isc_spb_user_name; | |
*spb++ = strlen (user); | |
for (x = user; *x;) | |
*spb++ = *x++; | |
*spb++ = isc_spb_password; | |
*spb++ = strlen (pass); | |
for (x = pass; *x;) | |
*spb++ = *x++; | |
sprintf(svc_name, "service_mgr"); /* Local */ | |
spblen = spb - spb_buff; | |
if (isc_service_attach (status, 0, svc_name, &svc_handle, spblen, spb_buff)) | |
{ | |
isc_print_status (status); | |
exit (1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment