1*2a99deb5Smartijn /* $OpenBSD: parsemsg.h,v 1.1 2022/01/13 10:34:07 martijn Exp $ */ 2*2a99deb5Smartijn 3*2a99deb5Smartijn /* 4*2a99deb5Smartijn * Copyright (c) 2022 Martijn van Duren <martijn@openbsd> 5*2a99deb5Smartijn * 6*2a99deb5Smartijn * Permission to use, copy, modify, and distribute this software for any 7*2a99deb5Smartijn * purpose with or without fee is hereby granted, provided that the above 8*2a99deb5Smartijn * copyright notice and this permission notice appear in all copies. 9*2a99deb5Smartijn * 10*2a99deb5Smartijn * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11*2a99deb5Smartijn * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12*2a99deb5Smartijn * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13*2a99deb5Smartijn * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14*2a99deb5Smartijn * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15*2a99deb5Smartijn * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16*2a99deb5Smartijn * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17*2a99deb5Smartijn */ 18*2a99deb5Smartijn 19*2a99deb5Smartijn /* included by .c files */ 20*2a99deb5Smartijn /* 21*2a99deb5Smartijn #include <limits.h> 22*2a99deb5Smartijn #include <syslog.h> 23*2a99deb5Smartijn */ 24*2a99deb5Smartijn 25*2a99deb5Smartijn struct msg { 26*2a99deb5Smartijn int m_pri; 27*2a99deb5Smartijn char m_timestamp[33]; 28*2a99deb5Smartijn char m_prog[NAME_MAX + 1]; 29*2a99deb5Smartijn char m_msg[LOG_MAXLINE + 1]; 30*2a99deb5Smartijn }; 31*2a99deb5Smartijn 32*2a99deb5Smartijn struct msg *parsemsg(const char *, struct msg *); 33*2a99deb5Smartijn size_t parsemsg_priority(const char *, int *); 34