File: link-to-library

package info (click to toggle)
sfarklib 2.24-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 332 kB
  • sloc: cpp: 2,395; makefile: 105; sh: 50
file content (66 lines) | stat: -rwxr-xr-x 1,368 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

set -e

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > sfarktest.cc
#include <sfArkLib.h>
#include <cstdio>

// sfarlib requires these 4 functions to be defined in any code which links to it:
// (copied from sfarkxtc.cpp)

void sfkl_msg(const char *MessageText, int Flags)
{
  if (Flags & SFARKLIB_MSG_PopUp) printf("*** ");
  printf("%s\n", MessageText);
}

void sfkl_UpdateProgress(int ProgressPercent)
{
    printf("\r");

    printf("Progress: %d%%", ProgressPercent);
    fflush(stdout);
    if (ProgressPercent == 100)  printf("\n");
  return;
}

bool sfkl_GetLicenseAgreement(const char *LicenseText, const char *OutFileName)
{
        char c;

  printf("%s\n\nDo you agree to the above terms? (Y/N) ", LicenseText);
  //c = getc(stdin);
        c = 'y';
  while (c != 'y' && c != 'Y' && c != 'n' &&  c != 'N')
  {
            printf("\nPlease answer Y or N and press return: ");
            c = getc(stdin);
  }
  if (c == 'y' || c == 'Y')
    return true;
  else
    return false;
}

void sfkl_DisplayNotes(const char *NotesFilePath, const char* OutFileName)        // Display not    es text file
{
  printf("Notes text file extracted to: %s\n ", NotesFilePath);
}

int main()
{
    return 0;
}
EOF


g++ -o sfarktest sfarktest.cc -lsfark
echo "build: OK"
[ -x sfarktest ]
./sfarktest
echo "run: OK"