/*
 * FreeUDFLibC - copyright (c) 1999 Gregory Deatz
 *
 *   Declarations script for all FreeUDFLib UDFs.
 */


/* String functions */

declare external function f_character 
  integer
  returns cstring(2) free_it
  entry_point 'character' module_name 'FreeUDFLibC';

declare external function f_crlf
  returns cstring(3) free_it
  entry_point 'crlf' module_name 'FreeUDFLibC';

declare external function f_encrypt_md5
  cstring(128)
  returns cstring(33) free_it
  entry_point 'encrypt_md5' module_name 'FreeUDFLibC';

declare external function f_find_word
  cstring(256), integer
  returns cstring(33) free_it
  entry_point 'find_word' module_name 'FreeUDFLibC';

declare external function f_find_word_index
  cstring(256), integer
  returns integer by value
  entry_point 'find_word_index' module_name 'FreeUDFLibC';

declare external function f_left
  cstring(256), integer
  returns cstring(256) free_it
  entry_point 'left' module_name 'FreeUDFLibC';

declare external function f_line_wrap
  cstring(256), integer, integer
  returns cstring(256) free_it
  entry_point 'line_wrap' module_name 'FreeUDFLibC';

declare external function f_l_trim
  cstring(256)
  returns cstring(256) free_it
  entry_point 'l_trim' module_name 'FreeUDFLibC';

declare external function f_lr_trim
  cstring(256)
  returns cstring(256) free_it
  entry_point 'lr_trim' module_name 'FreeUDFLibC';

declare external function f_mid
  cstring(256), integer, integer
  returns cstring(256) free_it
  entry_point 'mid' module_name 'FreeUDFLibC';

declare external function f_pad_left
  cstring(256), cstring(16), integer
  returns cstring(256) free_it
  entry_point 'pad_left' module_name 'FreeUDFLibC';

declare external function f_pad_right
  cstring(256), cstring(16), integer
  returns cstring(256) free_it
  entry_point 'pad_right' module_name 'FreeUDFLibC';

declare external function f_proper_case
  cstring(256)
  returns cstring(256) free_it
  entry_point 'proper_case' module_name 'FreeUDFLibC';

declare external function f_replace
  cstring(256), cstring(16), cstring(16)
  returns cstring(256) free_it
  entry_point 'replace' module_name 'FreeUDFLibC';

declare external function f_right
  cstring(256), integer
  returns cstring(256) free_it
  entry_point 'right' module_name 'FreeUDFLibC';

declare external function f_r_trim
  cstring(256)
  returns cstring(256) free_it
  entry_point 'r_trim' module_name 'FreeUDFLibC';

declare external function f_soundex
  cstring(256)
  returns cstring(6) free_it
  entry_point 'soundex' module_name 'FreeUDFLibC';

declare external function f_string_length
  cstring(256)
  returns integer by value
  entry_point 'string_length' module_name 'FreeUDFLibC';

declare external function f_strip_string
  cstring(256), cstring(64)
  returns cstring(256) free_it
  entry_point 'strip_string' module_name 'FreeUDFLibC';

declare external function f_substr
  cstring(256), cstring(32)
  returns integer by value
  entry_point 'substr' module_name 'FreeUDFLibC';

/*
 * Math routines
 */

declare external function f_convert_from_33
  cstring(32)
  returns integer by value
  entry_point 'convert_from_33' module_name 'FreeUDFLibC';

declare external function f_convert_to_33
  integer
  returns cstring(32) free_it
  entry_point 'convert_to_33' module_name 'FreeUDFLibC';

declare external function f_convert_from_base
  cstring(32), integer, cstring(8)
  returns integer by value
  entry_point 'convert_from_base' module_name 'FreeUDFLibC';

declare external function f_convert_to_base
  integer, integer, cstring(8)
  returns cstring(32) free_it
  entry_point 'convert_to_base' module_name 'FreeUDFLibC';

declare external function f_convert_to_dollar
  double precision
  returns cstring(32) free_it
  entry_point 'convert_to_dollar' module_name 'FreeUDFLibC';

declare external function f_double_abs
  double precision
  returns double precision by value
  entry_point 'double_abs' module_name 'FreeUDFLibC';

declare external function f_fixed_point
  double precision, integer
  returns cstring(32) free_it
  entry_point 'fixed_point' module_name 'FreeUDFLibC';

declare external function f_integer_abs
  integer
  returns integer by value
  entry_point 'integer_abs' module_name 'FreeUDFLibC';

declare external function f_modulo
  integer, integer
  returns integer by value
  entry_point 'modulo' module_name 'FreeUDFLibC';

declare external function f_round
  double precision
  returns integer by value
  entry_point 'round' module_name 'FreeUDFLibC';

declare external function f_truncate
  double precision
  returns integer by value
  entry_point 'truncate' module_name 'FreeUDFLibC';

/*
 * Date and time routines
 */

declare external function f_add_month
  date, integer
  returns date free_it
  entry_point 'add_month' module_name 'FreeUDFLibC';

declare external function f_add_year
  date, integer
  returns date free_it
  entry_point 'add_year' module_name 'FreeUDFLibC';

declare external function f_age_in_months
  date, date
  returns integer by value
  entry_point 'age_in_months' module_name 'FreeUDFLibC';

declare external function f_age_in_weeks
  date, date
  returns integer by value
  entry_point 'age_in_weeks' module_name 'FreeUDFLibC';

declare external function f_cdow_long
  date
  returns cstring(16) free_it
  entry_point 'cdow_long' module_name 'FreeUDFLibC';

declare external function f_cdow_short
  date
  returns cstring(4) free_it
  entry_point 'cdow_short' module_name 'FreeUDFLibC';

declare external function f_cmonth_long
  date
  returns cstring(16) free_it
  entry_point 'cmonth_long' module_name 'FreeUDFLibC';

declare external function f_cmonth_short
  date
  returns cstring(4) free_it
  entry_point 'cmonth_short' module_name 'FreeUDFLibC';

declare external function f_day_of_month
  date
  returns integer by value
  entry_point 'day_of_month' module_name 'FreeUDFLibC';

declare external function f_day_of_week
  date
  returns integer by value
  entry_point 'day_of_week' module_name 'FreeUDFLibC';

declare external function f_day_of_year
  date
  returns integer by value
  entry_point 'day_of_year' module_name 'FreeUDFLibC';

declare external function f_is_leap_year
  date
  returns integer by value
  entry_point 'is_leap_year' module_name 'FreeUDFLibC';

declare external function f_max_date
  date, date
  returns date free_it
  entry_point 'max_date' module_name 'FreeUDFLibC';

declare external function f_min_date
  date, date
  returns date free_it
  entry_point 'min_date' module_name 'FreeUDFLibC';

declare external function f_month
  date
  returns integer by value
  entry_point 'month' module_name 'FreeUDFLibC';

declare external function f_quarter
  date
  returns integer by value
  entry_point 'quarter' module_name 'FreeUDFLibC';

declare external function f_strip_date
  date
  returns date free_it
  entry_point 'strip_date' module_name 'FreeUDFLibC';

declare external function f_strip_time
  date
  returns date free_it
  entry_point 'strip_time' module_name 'FreeUDFLibC';

declare external function f_str_to_time
  cstring(12)
  returns date free_it
  entry_point 'str_to_time' module_name 'FreeUDFLibC';

declare external function f_week
  date
  returns integer by value
  entry_point 'week' module_name 'FreeUDFLibC';

declare external function f_week_of_year
  date
  returns integer by value
  entry_point 'week_of_year' module_name 'FreeUDFLibC';

declare external function f_woy
  date
  returns cstring(8) free_it
  entry_point 'woy' module_name 'FreeUDFLibC';

declare external function f_year
  date
  returns integer by value
  entry_point 'year' module_name 'FreeUDFLibC';

declare external function f_year_of_year
  date
  returns integer by value
  entry_point 'year_of_year' module_name 'FreeUDFLibC';

declare external function f_hour
  date
  returns integer by value
  entry_point 'hour' module_name 'FreeUDFLibC';

declare external function f_minute
  date
  returns integer by value
  entry_point 'minute' module_name 'FreeUDFLibC';

declare external function f_second
  date
  returns integer by value
  entry_point 'second' module_name 'FreeUDFLibC';

