Skip to content

Instantly share code, notes, and snippets.

@mariuz
Created August 4, 2015 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariuz/efc321ba8a38929a5541 to your computer and use it in GitHub Desktop.
Save mariuz/efc321ba8a38929a5541 to your computer and use it in GitHub Desktop.
isc_service_attach test gcc isc_service_attach.c -lfbclient
#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