view anagram/guisupport/brt.h @ 7:57b2cc9b87f7

Use memcpy instead of strncpy when we know the length anyway. Modern gcc seems to think it knows how to detect misuse of strncpy, but it's wrong (in fact: very, very wrong) and the path of least resistance is to not try to fight with it.
author David A. Holland
date Mon, 30 May 2022 23:47:52 -0400
parents 13d2b8934445
children
line wrap: on
line source

/*
 * AnaGram, A System for Syntax Directed Programming
 * Copyright 1993-2002 Parsifal Software. All Rights Reserved.
 * See the file COPYING for license and usage terms.
 *
 * brt.h
 */

#ifndef BRT_H
#define BRT_H

#include "agarray.h"
#include "dc.h"


class help_dc : public dc {
private:
  AgString msg;
  AgArray<int> lines;
  AgArray<int> xref;
  int width;

public:
  unsigned msg_number;
  help_dc(unsigned, const AgString);
  help_dc(help_dc &x)
  : dc(x), msg(x.msg), lines(x.lines), 
  xref(x.xref), width(x.width), msg_number(x.msg_number) {}

  //AgString expand_help_block(short *pairs, const AgArray<char>);
  //void load_help(help_screen_map *m);
  //void find_xref(void);

  virtual void getLine(unsigned) const;
};

class help_index_dc : public dc {
public:
  help_index_dc(void);
  help_index_dc(help_index_dc &x) : dc(x) {}

  virtual void getLine(unsigned)const;
  virtual AgString findHelpTopic();
};

class param_table_dc : public dc {
public:
  param_table_dc(void);
  param_table_dc(param_table_dc &x) : dc(x) {}

  virtual void getLine(unsigned) const;
  virtual AgString findHelpTopic();
};

class text_window_dc : public dc {
protected:
  AgString text;

public:
  text_window_dc(void) {text = NULL;}
  text_window_dc(AgString title, AgString data);
  text_window_dc(text_window_dc &x) : dc(x), text(x.text) {}

  virtual void getLine(unsigned) const;
};


#endif /* BRT_H */