include

Including one C source file in another?

Is it OK (or even recommended/good practice) to #include .c file in another .c file? What happens when they are included in a project file? ...

Weird #include problem

I have a problem with a simple included file. The file being included is in two MFC programs - one of which is a dll, and it also compiles itself into a non-mfc dll. Recently I was using the larger dll which wraps around the source of the smaller dll when I wanted access to some of the features of the original code that isn't exposed b...

What is a good reference documenting patterns of use of ".h" files in C?

"C Interfaces and Implementations" shows some interesting usage patterns for data structures, but I am sure there are others out there. http://www.amazon.com/Interfaces-Implementations-Techniques-Addison-Wesley-Professional/dp/0201498413 ...

What is a good reference documenting patterns of use of X-Macros in C (or possibly C++)?

A basic definition and example and a few references for "X-Macros" is given in this wikipedia entry on the C pre-processor: An X-Macro is a header file (commonly using a ".def" extension instead of the traditional ".h") that contains a list of similar macro calls (which can be referred to as "component macros"). What are s...

What is the best way to include PHP libraries when using static factory pattern?

I have several static factory patterns in my PHP library. However, memory footprint is getting out of hand and we want to reduce the number of files required during execution time. Here is an example of where we are today: require_once('Car.php'); require_once('Truck.php'); abstract class Auto { // ... some stuff ... public st...

Inclusion cycles in C header files

How does one prevent an inclusion cycle in C? ie. You shouldn't have a.h #include "b.h", which #include's "c.h" which #include's "a.h". I'm looking for a way of preventing this from happening using some sort of C directive. I had originally thought this would've prevented this from happening: Contents of a.h: #ifndef __A_H #define __A...

Copy Directory to Output Directory - Console Application .NET

Is there a way to copy an entire directory to the output directory in a console application in C#.NET? I know for files you can right click them, properties and mark copy to output directory. But I'm not going to do that for 20.000 files... Thx, Lieven Cardoen aka Johlero ...

How to structure #includes in C

Say I have a C program which is broken to a set of *.c and *.h files. If code from one file uses functions from another file, where should I include the header file? Inside the *.c file that used the function, or inside the header of that file? E.g. file foo.c includes foo.h, which contains all declarations for foo.c; same for bar.c and...

Professional #include contents

I need to create an API that will allow my customer's developers to use a proprietary C module that will be released as a library (think .lib or .so -- not source). I'd like to make the header as developer-friendly as possible (so I won't need to be), following best practices and providing comments with descriptions, examples, caveats, ...

How do you organise your STL headers?

I am working on a large project that uses the STL and have a question about your preferred way to organise your STL #includes. Do you prefer to #include each header in the source file it is used. For example, if both foo.cpp and bar.cpp require std::string, then both will #include <string>. Do you prefer to have a single header file t...

Load ajax load in JSF

Ok, heres my issue: I have a JSF application and some JSP files. Let's say i have main.jsp which has a view and includes sub.jsp. This works fine. sub.jsp contains a subview. As a result all the ID's of the form elements in sub.jsp follow the form of 'subview:component'. Now suppose I'm using some ajax and want to fetch the jsp page sub....

What is the difference between using #include<filename> and #include<filename.h> in c++

What is the difference between using #include<filename> and #include<filename.h> in c++ which of the two is used and why it is used ...

In Django, Problem with {{ block.super }}, How do I avoid duplicating a `block` in multiple template files?

For 2 child template files inheriting a block, the {{ block.super }} does not resolve Python 2.5.2, Django 1.0, Windows XP SP3 Sample skeleton code for files involved: base.html item_base.html show_info_for_all_items.html show_info_for_single_item.html FILE : base.html {% block content %} {% endblock %} FILE : item_base.html {%...

xampp includes not working

First off, how do I know if my html file is running on localhost in Xampp? Is there a tutorial on how to manage files/directories and get that all working under htdocs? Is there a good tutorial on how to setup includes? I want to use "includes" in Xampp with my html. Can I use both html includes AND php includes? Do I have to put shtml?...

How do I run a file on localhost?

How do I actually run a file on localhost? I know it is working, but how do I run a file on it, and how do I verify that the file is in fact running on localhost? Server newbie here, additional questions (I have xampp running Apache 2.2): From your responses it sounds like I have to type in the path in the browser in order to open the f...

Includes: SSI or PHP for basic HTML and Javascript in separate files

Thanks to everyone here, got the Xampp server running!!! and can run my html in subdirectories now, as well. (can't have spaces in the subdirectory names) NEXT UP - SSI Includes or PHP Includes Xampp says SSI is deactivated. Tried uncommenting the lines for includes, but it doesn't change the deactivation. How do I activate SSI? Then...

php includes in html files-directories

Do all php include files have to be in an include directory, or is that just an organizational convenience? Can I include files from any directory using the path to that directory? Do html files that contain php includes have to have a php extension? If so, I guess that would mean all of my html docs would be php if they all have the men...

How to "include" a file?

Here's the code I have in the html file to "include" the file "vmenu.php" <div id="apDivVistaMenus"> ?php include 'vmenu.php'; ?> !-- Begin Vista-Buttons.com --> !-- End Vista-Buttons.com --> /div> The menus used to be between the comments below the php include request. But I save that code into the vmenu.php file, which l...

How do I include a common file in VBScript (similar to C #include)?

VBScript doesn't appear to have a way to include a common file of functions. Is there a way to achieve this? ...

jQuery/JavaScript - performance-issue when having a lot of small .js-Files?

Hi all, i've got a site with a lot of referenced .js-Files; those are rather small files, but I want to keep my methods separated by topic/functionality. Is it better to keep all the methods in one .js-File or is it no problem to have many (~ 20 - 30) small files all including only some lines? ...