+
+# remove leading and trailing spaces from an input string
+sub unpad
+{
+ my $s = shift;
+ $s =~ s/\s+$//;
+ $s =~ s/^\s+//;
+ return $s;
+}
+
+# check that a field only has callsign characters in it
+sub is_callsign
+{
+ return $_[0] !~ /[^A-Z0-9\-]/;
+}
+
+# check that a PC protocol field is valid text
+sub is_pctext
+{
+ return $_[0] !~ /[^\x20-\xA8\xE0-\xEF]/;
+}
+
+# check that a PC prot flag is set correctly
+sub is_pcflag
+{
+ return $_[0] !~ /^[^01\*]$/;
+}