-/* Copyright (c) 2012-2014, Bastien Dejean
+/* Copyright (c) 2012, Bastien Dejean
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those
- * of the authors and should not be interpreted as representing official policies,
- * either expressed or implied, of the FreeBSD Project.
*/
#include <stdio.h>
rule_consequence_t *make_rule_conquence(void)
{
rule_consequence_t *rc = calloc(1, sizeof(rule_consequence_t));
- rc->manage = rc->focus = true;
+ rc->manage = rc->focus = rc->border = true;
return rc;
}
SETCSQ(follow)
SETCSQ(manage)
SETCSQ(focus)
+ SETCSQ(border)
#undef SETCSQ
}
}
-void list_rules(char *pattern, char *rsp)
+void list_rules(char *pattern, FILE *rsp)
{
- char line[MAXLEN];
for (rule_t *r = rule_head; r != NULL; r = r->next) {
if (pattern != NULL && !streq(pattern, r->cause))
continue;
- snprintf(line, sizeof(line), "%s => %s\n", r->cause, r->effect);
- strncat(rsp, line, REMLEN(rsp));
+ fprintf(rsp, "%s => %s\n", r->cause, r->effect);
}
}