This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
c0isc_register.c
90 lines (79 loc) · 2.01 KB
/
c0isc_register.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* -*- C -*- */
/*
* Copyright (c) 2017-2020 Seagate Technology LLC and/or its Affiliates
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For any questions about this software or licensing,
* please email opensource@seagate.com or cortx-questions@seagate.com.
*
* Original author: Ganesan Umanesan <ganesan.umanesan@seagate.com>
* Original creation date: 10-Jan-2017
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libgen.h>
#include "c0appz.h"
#include "c0appz_isc.h"
#include "fid/fid.h"
#include "lib/buf.h"
#include "lib/misc.h"
#include "iscservice/isc.h"
#include "rpc/link.h"
char *prog;
/* main */
int main(int argc, char **argv)
{
int rc = 0;
prog = basename(strdup(argv[0]));
/* check input */
if (argc != 2) {
fprintf(stderr,"Usage:\n");
fprintf(stderr,"%s libpath\n", prog);
return -1;
}
/* time in */
c0appz_timein();
c0appz_setrc(prog);
c0appz_putrc();
/* initialize resources */
rc = c0appz_init(0);
if (rc != 0) {
fprintf(stderr,"error! c0appz_init() failed: %d\n", rc);
return -2;
}
rc = c0appz_isc_api_register(argv[1]);
if ( rc != 0)
fprintf(stderr, "error! loading of library from %s failed. \n",
argv[1]);
/* free resources*/
c0appz_free();
/* time out */
c0appz_timeout(0);
/* success */
if (rc == 0)
fprintf(stderr,"%s success\n", prog);
else
fprintf(stderr,"%s fail\n", prog);
return rc;
}
/*
* Local variables:
* c-indentation-style: "K&R"
* c-basic-offset: 8
* tab-width: 8
* fill-column: 80
* scroll-step: 1
* End:
*/