File: pg_snakeoil--1.sql

package info (click to toggle)
pg-snakeoil 1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 224 kB
  • sloc: ansic: 159; sql: 26; makefile: 24; sh: 13
file content (40 lines) | stat: -rw-r--r-- 1,636 bytes parent folder | download
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
\echo Use "CREATE EXTENSION pg_snakeoil" to load this file. \quit

-- ------------------------------------------------------------------------
-- Text Functions
-- ------------------------------------------------------------------------

-- Returns true if the given data matches a signature in the virus database
CREATE FUNCTION so_is_infected (text) RETURNS bool
AS 'MODULE_PATHNAME', 'so_is_infected'
LANGUAGE C IMMUTABLE STRICT;

-- Returns virus name if the given data matches a signature in the
-- virus database, empty string otherwise
CREATE FUNCTION so_virus_name (text) RETURNS text
AS 'MODULE_PATHNAME', 'so_virus_name'
LANGUAGE C IMMUTABLE STRICT;

-- ------------------------------------------------------------------------
-- bytea Functions
-- ------------------------------------------------------------------------

-- Returns true if the given data matches a signature in the virus database
CREATE FUNCTION so_is_infected (bytea) RETURNS bool
AS 'MODULE_PATHNAME', 'so_is_infected'
LANGUAGE C IMMUTABLE STRICT;

-- Returns virus name if the given data matches a signature in the
-- virus database, empty string otherwise
CREATE FUNCTION so_virus_name (bytea) RETURNS text
AS 'MODULE_PATHNAME', 'so_virus_name'
LANGUAGE C IMMUTABLE STRICT;

-- ------------------------------------------------------------------------
-- Management Functions
-- ------------------------------------------------------------------------

-- Update signatures, returns true if signatures changed, false otherwise
CREATE FUNCTION so_update_signatures () RETURNS bool
AS 'MODULE_PATHNAME', 'so_update_signatures'
LANGUAGE C IMMUTABLE STRICT;